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

refactor(protocol): optimize ProverPool #14069

Merged
merged 8 commits into from
Jun 30, 2023
Merged

refactor(protocol): optimize ProverPool #14069

merged 8 commits into from
Jun 30, 2023

Conversation

dantaik
Copy link
Contributor

@dantaik dantaik commented Jun 28, 2023

  • Staked amount means wei, no longer 1 TKO token
  • Merge weight into Prover struct and make prover a list, not packed tightly
  • Optimized gas cost
  • Slash at least 1 TKO token

Previously

Deployment Cost Deployment Size
1662543 8336
Function Name min avg median max # calls
assignProver 28905 37634 41290 46905 463
getProvers 58132 58132 58132 58132 3
getStaker 2022 2022 2022 2022 18
init 93061 93061 93061 93061 8
releaseProver 4251 10774 4251 19321 365
slashProver 5632 13568 7333 21787 9
stake 22978 123403 114764 185356 151

Now

Deployment Cost Deployment Size
1695578 8501
Function Name min avg median max # calls
assignProver 15351 18150 17286 81351 463
getProvers 47886 47886 47886 47886 3
getStaker 1660 1660 1660 1660 18
init 93061 93061 93061 93061 8
releaseProver 2408 3105 3127 3127 365
slashProver 5621 5801 5824 5824 9
stake 29587 73869 77005 172248 151

@dantaik dantaik requested a review from adaki2004 June 28, 2023 16:24
@dantaik dantaik marked this pull request as ready for review June 28, 2023 16:24
@adaki2004
Copy link
Contributor

Looks good to me.

Also putting here as a benchmark:
proposeBlock average: 57.527
verifyBlocks average: 17.712

@dantaik dantaik merged commit 4cb7367 into alpha-4 Jun 30, 2023
@dantaik dantaik deleted the improve_staking5 branch June 30, 2023 00:48
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.

3 participants