-
Notifications
You must be signed in to change notification settings - Fork 103
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
feat: Epoch change to Light Client contract and prover service #2706
base: main
Are you sure you want to change the base?
Conversation
|
||
// === System Parameters === | ||
// | ||
/// @notice number of blocks per epoch | ||
uint64 public BLOCKS_PER_EPOCH; | ||
|
||
// === Storage === | ||
// | ||
/// @notice genesis stake commitment | ||
StakeTableState public genesisStakeTableState; |
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 are we still keeping the genesis state?
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 think it's because we can't remove any members due to this being an upgradable contract: https://docs.openzeppelin.com/upgrades-plugins/writing-upgradeable#modifying-your-contracts
@alxiong from that PoV shouldn't BLOCKS_PER_EPOCH be added at the end?
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.
yah, that's a good point. maybe I need to relocate this.
I should have add a "fork test" to make sure we can upgrade existing LC contract to this one.
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 think we definitely need some kind of test to show that the contract still works as expected after upgrading.
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 decide to use a child contract to contain all the diff instead. @sveitser thanks for pointing out the concern.
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.
LGTM with a minor comment
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 putting request for changes here based on the discussion so we don't accidentally merge early because there's already an approval.
Closes #2684
This PR:
Apologize for such a large PR, but many components are so interconnected that I have to fix them all to even compile, let alone pass all the tests.
locally just
just sol-test
andcargo test -p hotshot-state-prover
should show all tests passing.This PR is best reviewed commit by commit -- I have tried my best to make each one self-contained and limited in scope.
This PR does not:
Fetch the actual Stake table for the next block from Sequencer's URL, which is handled in #2702
in future follow-up, We need to utilize this API return to parse out the input to
newFinalizedState()
Key places to review:
Contracts:
LightClient.sol
,PlonkVerifier.sol
,deployer.rs
Prover:
cirucit.rs
,service.rs