Repository navigation
fix(whitelist): fit the caps to one governance call, and benchmark the critical paths on pallet-revive #359
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
Open
re-gius
wants to merge
7
commits into
master
Choose a base branch
from
re-gius/revive-bench
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
30fd863
fix(whitelist): fit the grant and claimant caps to one governance call
re-gius 0f23984
ci: benchmark the critical paths on pallet-revive weekly
re-gius 9308e1c
ci: pass the benchmark threshold through env and validate it
re-gius a6ef74e
docs(whitelist): drop weight figures from the cap NatSpec
re-gius 19cc25c
Merge branch 'master' into re-gius/revive-bench
re-gius 87a8814
Merge branch 'master' into re-gius/revive-bench
re-gius 05fd7d1
fix(bench): cover the store path, measure the whitelist bounds with t…
re-gius File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| name: pallet-revive Benchmark | ||
|
|
||
| # Dry-runs the critical dotNS paths on pallet-revive against live Paseo Asset Hub Next and Polkadot | ||
| # Asset Hub state, under the limit each one runs with in production. Read-only: nothing is signed | ||
| # or submitted, and no secret is used. `deployed` measures the contracts live on the network, | ||
| # `build` this checkout's implementations upgraded into the same state. | ||
| on: | ||
| schedule: | ||
| - cron: "0 6 * * 1" | ||
| workflow_dispatch: | ||
| inputs: | ||
| fail-at: | ||
| description: Fail a path above this share of its limit, in percent | ||
| default: "95" | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: revive-bench-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| bench: | ||
| name: ${{ matrix.network }} (${{ matrix.target }}) | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 30 | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| network: [paseo, polkadot] | ||
| target: [deployed, build] | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| submodules: recursive | ||
|
|
||
| - uses: ./.github/actions/setup-foundry | ||
| if: matrix.target == 'build' | ||
|
|
||
| - uses: oven-sh/setup-bun@v2 | ||
| with: | ||
| bun-version: "1.2.6" | ||
| no-cache: true | ||
|
|
||
| # The postinstall (`setup.bash`) fetches `lib/`, which only the build needs. | ||
| - run: bun install ${{ matrix.target == 'deployed' && '--ignore-scripts' || '' }} | ||
|
|
||
| - run: forge build | ||
| if: matrix.target == 'build' | ||
|
|
||
| - name: Run benchmark | ||
| env: | ||
| FAIL_AT: ${{ inputs.fail-at || '95' }} | ||
| run: | | ||
| bun scripts/bench/revive-bench.mjs \ | ||
| --network ${{ matrix.network }} \ | ||
| ${{ matrix.target == 'build' && '--build' || '' }} \ | ||
| --fail-at "$FAIL_AT" \ | ||
| --json revive-bench-${{ matrix.network }}-${{ matrix.target }}.json | ||
|
|
||
| - uses: actions/upload-artifact@v4 | ||
| if: always() | ||
| with: | ||
| name: revive-bench-${{ matrix.network }}-${{ matrix.target }} | ||
| path: revive-bench-${{ matrix.network }}-${{ matrix.target }}.json | ||
| if-no-files-found: ignore |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I was wondering what happens when a name has more claims on the live network, would these upper bound still hold?
The cap only stops new requests, so a name with ~30+ existing claims couldn’t be granted in one call. Should we check live claimantCount before, or note that governance would need to reject some 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.
Also can we add respective dev comments where required with reason like so, "one call fits a referendum’s weight limit" or smthg like this??
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.
Right, the cap only stops new requests, so a name that collected more claims under a higher cap needs governance to
rejectsome first, one per call, before a grant fits. That's now in thesetMaxClaimantsNatSpec. Paseo has 4 active names; I'll check Polkadot's claim counts before its upgrade.Each bound also has a
@devnote now: one governance call at the bound still fits the weight a referendum can execute, and the benchmark checks it.