-
Notifications
You must be signed in to change notification settings - Fork 80
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
Fetch Permissioned Stake Table from L1 #2361
base: main
Are you sure you want to change the base?
Conversation
Missing conversion from G2 Affine to BLSPubKey.
- Update bindings. - Add tests for event emission.
- The stake table isn't useful without stakers I think it makes sense to require it to be provided on deployment.
We will add some more ergonomic code for conversion to jellyfish at some point. This code can be used as a stop gap until then.
Co-authored-by: Alysia Tech <[email protected]>
breaks if we use: `serde.workspace = true`
* change lc proxy addr * fix deploy-sequencer-contracts in docker compose * test for stake table from toml file * initial stake table toml file * exclude toml file in typos * remove custom deser
* remove generic from stake table * lint * move types to top, remove some more specified types * update v99 reference test files
// If the last event for a stakers is `Added` the staker is currently | ||
// staking, if the last event is removed or (or the staker is not present) | ||
// they are not staking. | ||
let currently_staking = changes_per_node |
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.
can a node be added and then removed or vice versa?
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.
so all the deltas of a node will have removed events first and then added? What happens if it is added and then removed? I am trying to understand the order of events in Vec<StakersUpdatedFilter>
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.
Yes, the removed events are processed first.
So you can remove a node and in the same transaction add it again (to update the keys or DA status of that node).
Adding and removing is possible but not inside the same Ethereum transaction because the removals are processed first.
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.
so Vec<StakersUpdatedFilter>
is all the events from the start till the current block right? so we may do that in different transactions but always process the removed one first?
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.
A transaction sent to the permissioned stake table contract will emit one event which will give us one StakersUpdatedFilter
. That type has two Vecs of NodeInfo for removing and adding nodes respectively.
When doing the query with ethers one can set the "from block" and the "to block" to fetch a subset of events. Currenly here we would assume that we set "from block" to zero but "to block" we need to set correctly. So that we exclude changes during the current epoch until the next epoch.
…tb/pos/fetch-stake-table2
Cleanup l1 fetcher, method on `StakeCommittee` and assert something in the test.
Branched from #2325. Adds most everything from #2237. Main blocker now is to iron out
ChainConfig
versions. Then we can get into the actual stake table retrieval logic.Closes #EspressoSystems/HotShot#3726
Supersedes: #2237
Targets: #2325
This PR
Adds the ability to fetch stake table from l1. It adds
StaticCommittee
type which replaces hotshot'sStaticCommittee
. This new type implements Membershp trait, holds L1Client in order to updateSelf.stake_table
. In this way, hotshot will be able to obtainStakeTable
viaSystemContextHandle.members
.TODO