-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merge contract repositories #517
Comments
Created a repository with combined main branch history: https://github.com/shutter-network/contracts |
Question @jannikluhn :
By keeping only the |
I guess for clarity it would be good
|
Hmm, for …
contract KeyperSetManager is RestrictedPausable, IKeyperSetManager {
…
function getKeyperSetIndexByBlock(
uint64 blockNumber
) external view returns (uint64) {
for (uint256 i = keyperSets.length; i > 0; i--) {
if (keyperSets[i - 1].activationBlock <= blockNumber) {
return uint64(i - 1);
}
}
revert NoActiveKeyperSet();
}
function getKeyperSetActivationBlock(
uint64 index
) external view returns (uint64) {
return keyperSets[index].activationBlock;
}
function getKeyperSetAddress(uint64 index) external view returns (address) {
return keyperSets[index].contractAddress;
}
function getKeyperSetIndexBySlot(
uint64 slot
) external view returns (uint64) {
for (uint256 i = activationSlots.length; i > 0; i--) {
if (activationSlots[i - 1] <= slot) {
return uint64(i - 1);
}
}
revert NoActiveKeyperSet();
}
function getKeyperSetAddress(uint64 index) external view returns (address) {
return contracts[index];
}
function getKeyperSetActivationSlot(
uint64 index
) external view returns (uint64) {
return activationSlots[index];
} |
Apparently, |
@ulope can you state |
@ezdac Can you give some input on what is absolutely necessary to be kept from |
The snapshot integration doesn't have requirements on the contracts per-se. It only uses the contracts as far as required for Keyper set management. In the old (currently still in use) implementation the Snapshot hub interface "pretends" to be the (now removed) collator, since that was the easiest way to allow it to issue and sign decryption requests. |
The codegen bindings are all necessary, however you can re-use the overlapping common code packages as long as the contracts used in both are interchangeable (which they seem to be). This means you only have to keep the Inbox source code and integrate that in the abigen code (which you are already doing). Maybe it would be good to add a prefix so that it's called The "predeploy" code can be kept as is. The important part here is the |
Currently, we have two separate contract repositories: shutter-network/shop-contracts and shutter-network/gnosh-contracts. We should merge them into one (e.g.
shutter-network/contracts
) and get rid of unused contracts. In particular:shop-contracts
:KeyperSetManager
,KeyperSet
,KeyBroadcast
andEonKeyPublish
is used in both the SHOP and the GNOSH implementationInbox
is used in the SHOP implementationgnosh-contracts
:KeyperSetManager
,KeyperSet
,KeyBroadcast
andEonKeyPublish
are unused and can be removedSequencer
andValidatorRegistry
are used in the GNOSH implementationIKeyperSetManager
,IKeyperSet
,IKeybroadcast
,IValidatorRegistry
andISequencer
are references to the GNOSH spec and should be preservedgen/gen.go
inshop-contracts
andgen_bindings.sh
ingnosh-contracts
). I personally prefer the latter, but others may disagree. We should end up with either a single or two separate packages. A single is probably preferable for simplicity.shop-contracts
there's some predeploy code that probably should be preserved, but I'm not entirely sure if we still need it.The text was updated successfully, but these errors were encountered: