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

perf: optimize quorum #56

Merged
merged 2 commits into from
Oct 25, 2023
Merged

perf: optimize quorum #56

merged 2 commits into from
Oct 25, 2023

Conversation

ZzzzHui
Copy link
Contributor

@ZzzzHui ZzzzHui commented Aug 30, 2023

No description provided.

@ZzzzHui ZzzzHui self-assigned this Aug 30, 2023
@ZzzzHui ZzzzHui linked an issue Aug 30, 2023 that may be closed by this pull request
@guidanoli
Copy link
Collaborator

guidanoli commented Aug 30, 2023

I'd be interested in a gas cost analysis on this PR and on #57. :-)
I'll write some Forge tests so that you can run them with --gas-report.

@guidanoli guidanoli force-pushed the feature/quorum branch 2 times, most recently from 528b1e8 to 8735702 Compare September 6, 2023 17:23
@guidanoli guidanoli changed the title feat: optimize quorum perf: optimize quorum Sep 14, 2023
@xdaniortega xdaniortega mentioned this pull request Sep 20, 2023
@guidanoli guidanoli force-pushed the feature/quorum branch 2 times, most recently from 8cce1d9 to a3b1038 Compare September 21, 2023 18:57
@ZzzzHui ZzzzHui force-pushed the feature/optimize-quorum branch from c894212 to 33b4453 Compare September 22, 2023 09:04
@ZzzzHui
Copy link
Contributor Author

ZzzzHui commented Sep 22, 2023

After running forge test --match-contract Quorum --gas-report --fuzz-seed 1, here is the gas report:

contracts/consensus/quorum/Quorum.sol:Quorum contract
Deployment Cost Deployment Size
1146872 6461
Function Name min avg median max # calls
getHistory 236 236 236 236 1
submitClaim 25775 33265 26346 47675 3

Compared with the benchmark (base branch feature/quorum)

  • deployment cost reduced 616828 (34.97%)
  • submitClaim function reduced: min 22854 (47.00%); avg 23521 (41.42%); max 24854 (34.27%)

@guidanoli
Copy link
Collaborator

guidanoli commented Sep 23, 2023

Using a script I made, here is the diff table (in relation to #49):

Contract Function Min Avg Max
Quorum -616828 (-34.97%)
Quorum getHistory -44 (-15.71%) -44 (-15.71%) -44 (-15.71%)
Quorum submitClaim -22854 (-47.00%) -23521 (-41.42%) -24854 (-34.27%)

@ZzzzHui ZzzzHui force-pushed the feature/optimize-quorum branch from f5b21d8 to fdbf7af Compare October 24, 2023 04:21
@ZzzzHui ZzzzHui requested a review from guidanoli October 24, 2023 04:37
@guidanoli guidanoli removed the request for review from xdaniortega October 24, 2023 15:06
@ZzzzHui ZzzzHui merged commit a8d9d46 into feature/quorum Oct 25, 2023
3 checks passed
@ZzzzHui ZzzzHui deleted the feature/optimize-quorum branch October 25, 2023 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🚀 Done
Development

Successfully merging this pull request may close these issues.

optimize Quorum
2 participants