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

feat: add Stake Table contract API #748

Merged
merged 43 commits into from
Nov 17, 2023
Merged

feat: add Stake Table contract API #748

merged 43 commits into from
Nov 17, 2023

Conversation

alxiong
Copy link
Contributor

@alxiong alxiong commented Nov 14, 2023

Closes #673

This is a replicate of #743 which is accidentally closed.

///
/// @dev No validity check on `schnorrVK`, as it's assumed to be sender's responsibility,
/// the contract only treat it as auxiliary info submitted by `blsVK`.
function register(
Copy link
Contributor

Choose a reason for hiding this comment

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

There are some slight differences when dealing with stake delegation (see PR #14) . In all cases I think it is better to agree on this version of API first, and then make the changes to support delegation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure! is there a TL;DR for the potential conflicts or major incompatibility you can foresee?
I can also try to address some concerns in this PR if desired.

Copy link
Contributor

@philippecamacho philippecamacho Nov 16, 2023

Choose a reason for hiding this comment

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

TL;DR

  • We need to register pool members in addition to pool operators. Pool members do not need a BLS/Schnorr key because by they don't run a validator.
  • We need to handle pool operator fees (when registering a pool and also allow the operator to modify the fee)
  • Reward collection is performed by pool members for better UX.

But again I think it would be better to have the whole system working with delegation first. Adding delegation later should not be too difficult I think.

Base automatically changed from plonk-verifier to main November 15, 2023 14:42
flake.nix Outdated Show resolved Hide resolved
@alxiong alxiong requested a review from sveitser November 17, 2023 12:59
Copy link
Contributor

@philippecamacho philippecamacho left a comment

Choose a reason for hiding this comment

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

LGTM

flake.nix Outdated Show resolved Hide resolved
@sveitser
Copy link
Collaborator

No idea what's wrong with the CI. I'm having a look.

Copy link
Member

@jbearer jbearer left a comment

Choose a reason for hiding this comment

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

LGTM

Just one take-it-or-leave-it suggestion

contracts/src/interfaces/IStakeTable.sol Outdated Show resolved Hide resolved
@sveitser
Copy link
Collaborator

@alxiong Can reproduce CI failure locally when using latest foundry so error is likely something related to anvil. I think we can ignore these tests until that's fixed.

@alxiong alxiong enabled auto-merge (squash) November 17, 2023 16:55
@alxiong alxiong merged commit c7f77e8 into main Nov 17, 2023
@alxiong alxiong deleted the stake-table-api branch November 17, 2023 17:02
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.

Define and review the interface of the stake table
4 participants