Skip to content
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

Update preconf registry 2 #72

Merged
merged 5 commits into from
Aug 22, 2024
Merged

Update preconf registry 2 #72

merged 5 commits into from
Aug 22, 2024

Conversation

AnshuJalan
Copy link
Collaborator

  • Added indexToPreconfer mapping to remove the need to index preconfers on the node.
  • Validators are now stored in a separate validators map and can be pulled by node (to build the lookahead) using getValidator view.
  • Replaced signature nonce with an expiry timestamp.
  • Generalised addValidators and removeValidators so they can be called by anyone with the correct signatures and not necessarily the preconfer's address.

revert InvalidValidatorSignature();
}

// Revert if the signature has expired
if (block.timestamp > addValidatorParams[i].signatureExpiry) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should check it before verifying the signature?

emit ValidatorRemoved(msg.sender, validatorPubKeyHashes[i]);

// Revert if the signature has expired
if (block.timestamp > removeValidatorParams[i].signatureExpiry) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should check it before verifying the signature?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The transaction libraries stop the transaction on estimation stage itself, so in practise, the order of reverts usually does not matter in the contracts.

pragma solidity 0.8.25;

library PreconfConstants {
uint256 internal constant TWO_EPOCHS = 768;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
uint256 internal constant TWO_EPOCHS = 768;
uint256 internal constant TWO_EPOCHS = 768; // 2 * 32 slots * 12 sec

Update lookahead and connect it to new registry
@AnshuJalan AnshuJalan merged commit d8059d5 into master Aug 22, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants