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

Permissioned L1 stake table #2325

Merged
merged 37 commits into from
Dec 10, 2024
Merged

Permissioned L1 stake table #2325

merged 37 commits into from
Dec 10, 2024

Conversation

sveitser
Copy link
Collaborator

@sveitser sveitser commented Nov 25, 2024

Some info: https://www.notion.so/espressosys/Permissioned-stake-table-contract-for-Dec-2024-release-1462431b68e980a0a4abcd6bb65d7e43?pvs=4

TODO

  • Pass stake table loaded from file to contract during deployment. This requires conversion from the PeerConfigKeys to the solidity struct NodeInfo.
  • Clean up hotshot/jellyfish to and from solidity types conversion code: should all be moved to the contract adapter crate.
  • Add deployment of permissoned stake table to demos.
  • Fetching: See Fetch Permissioned Stake Table from L1 #2361
  • E2E test for stake table upgrade. (-> separate issue)
  • Tests for crypto key conversions between solidity and rust

Follow up work

@sveitser sveitser linked an issue Nov 25, 2024 that may be closed by this pull request
@sveitser sveitser changed the title Initial draft for minimal L1 stake table Permissioned L1 stake table Nov 26, 2024
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.
contracts/src/PermissionedStakeTable.sol Outdated Show resolved Hide resolved
contracts/src/PermissionedStakeTable.sol Show resolved Hide resolved
contracts/src/PermissionedStakeTable.sol Show resolved Hide resolved
contracts/src/PermissionedStakeTable.sol Show resolved Hide resolved
contracts/src/PermissionedStakeTable.sol Show resolved Hide resolved
justfile Show resolved Hide resolved
utils/src/deployer.rs Outdated Show resolved Hide resolved
docker-compose.yaml Show resolved Hide resolved
tbro added a commit that referenced this pull request Dec 5, 2024
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.
tbro added a commit that referenced this pull request Dec 6, 2024
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.
alysiahuggins and others added 2 commits December 6, 2024 16:02
* align comment with implementation

* added more clarity

* comment format

* clearer comment

* update comment to make it clear that there may be outdated elements in the state history
imabdulbasit and others added 7 commits December 6, 2024 16:02
* add stake table tests

* remove stake types

* verify token allowance, balance and reprioritize verification order on registration

* set the fixed stake amount, added related tests, updated data types

* add more verification checks to the withdraw function

* updated errror types

* added TODO statements in comments to be explicit about outdated functions that need to be updated to the new spec
docker-compose.yaml Outdated Show resolved Hide resolved
sveitser and others added 4 commits December 9, 2024 16:27
* 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
@sveitser sveitser marked this pull request as ready for review December 10, 2024 15:29
Copy link
Contributor

@alysiahuggins alysiahuggins left a comment

Choose a reason for hiding this comment

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

Approving so that work can progress but a question around event logs.

So theres's an event when the stakers list is updated but not an event when one is inserted or removed.
Is that because inserts only happen at the beginning when the existing list of stakers are added to the contract?
Though I presume a removal can only happen in the future.

Assuming there's a service that depends entirely on this contract to know the full active set of stakers, shouldn't there be emit logs for those methods too?

EDITED

only the update is public so nevermind


// public methods

function update(NodeInfo[] memory stakersToRemove, NodeInfo[] memory newStakers)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@alysiahuggins only the update method is public.

Copy link
Contributor

Choose a reason for hiding this comment

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

ah missed that, thanks

@sveitser sveitser merged commit 979cfb3 into main Dec 10, 2024
23 of 24 checks passed
@sveitser sveitser deleted the ma/simple-stake-table branch December 10, 2024 17:32
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.

Permissioned stake table contract
6 participants