-
Notifications
You must be signed in to change notification settings - Fork 51
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
RMNHome #1469
RMNHome #1469
Conversation
LCOV of commit
|
98b61fa
to
d8e1df6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Think we should allow only state transitions we want:
- init->candidate
- candidate->active
- active->init
- active->active/candidate
- active/candidate->active
- active/candidate->active/candidate
then revert on everything else
/// in case one of the configs is too large to be returnable by one of the other getters. | ||
/// @param configDigest The digest of the config to fetch. | ||
/// @return versionedConfig The config and its version. | ||
/// @return ok True if the config was found, false otherwise. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just wondering if this is needed, won't configDigest
on the VersionedConfig
be ZERO_DIGEST
which is always an invalid digest and hence config does not exist?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is true, but using the bool is more explicit. It's not strictly needed but I kinda like it.
(PREFIX & PREFIX_MASK) | ||
| ( | ||
uint256( | ||
keccak256(bytes.concat(abi.encode(bytes32("EVM"), block.chainid, address(this), version), staticConfig)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is staticConfig
bytes.concat
'd and not abi.encode
'd?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both components are already abi.encoded. Afaik this should not compromise anything as the first section is all static length anyway
/// - Init: promoteCandidateAndRevokeActive(), as there is no config to promote. | ||
/// - Init: revokeCandidate(), as there is no config to revoke | ||
/// - Active: revokeCandidate(), as there is no candidate to revoke | ||
/// Note that we explicitly do allow promoteCandidateAndRevokeActive() to be called when there is an active config but |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd maybe add one more note (for completeness), that the other state transitions ActiveAndCandidate->Init, Candidate -> Init are not possible in one step given the transition functions available. Alternatively would be more clear to have a little ascii diagram
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 to cute ascii diagram with state transitions.
Quality Gate passedIssues Measures |
New PR to have this be standalone