-
Notifications
You must be signed in to change notification settings - Fork 827
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
Add Runtime::OmniNode
variant to polkadot-parachain
#4805
Changes from 7 commits
df831b6
110f282
df08dba
d2e8881
e0a3e1f
84b1d32
2c36b25
e766b02
37cf6dd
52c3551
a796cd8
f758ade
819d06d
db414bd
afee2dc
df2a0a5
c19b29a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
# Motivation | ||
|
||
Demonstrate that | ||
[FastAggregateVerify](https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-bls-signature-04#section-3.3.4) is the most | ||
expensive call in ethereum beacon light client, though in [#13031](https://github.com/paritytech/substrate/pull/13031) | ||
Parity team has wrapped some low level host functions for `bls-12381` but adding a high level host function specific | ||
for it is super helpful. | ||
|
||
# Benchmark | ||
|
||
We add several benchmarks | ||
[here](https://github.com/Snowfork/snowbridge/blob/8891ca3cdcf2e04d8118c206588c956541ae4710/parachain/pallets/ethereum-client/src/benchmarking/mod.rs#L98-L124) | ||
as following to demonstrate | ||
|
@@ -15,25 +17,31 @@ is the main bottleneck. Test data | |
is real from goerli network which contains 512 public keys from sync committee. | ||
|
||
## sync_committee_period_update | ||
Base line benchmark for extrinsic [sync_committee_period_update](https://github.com/Snowfork/snowbridge/blob/8891ca3cdcf2e04d8118c206588c956541ae4710/parachain/pallets/ethereum-client/src/lib.rs#L233) | ||
|
||
Base line benchmark for | ||
extrinsic [sync_committee_period_update](https://github.com/Snowfork/snowbridge/blob/8891ca3cdcf2e04d8118c206588c956541ae4710/parachain/pallets/ethereum-client/src/lib.rs#L233) | ||
|
||
## bls_fast_aggregate_verify | ||
|
||
Subfunction of extrinsic `sync_committee_period_update` which does what | ||
[FastAggregateVerify](https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-bls-signature-04#section-3.3.4) requires. | ||
|
||
## bls_aggregate_pubkey | ||
|
||
Subfunction of `bls_fast_aggregate_verify` which decompress and instantiate G1 pubkeys only. | ||
|
||
## bls_verify_message | ||
Subfunction of `bls_fast_aggregate_verify` which verify the prepared signature only. | ||
|
||
Subfunction of `bls_fast_aggregate_verify` which verify the prepared signature only. | ||
|
||
# Result | ||
|
||
## hardware spec | ||
|
||
Run benchmark in a EC2 instance | ||
|
||
``` | ||
cargo run --release --bin polkadot-parachain --features runtime-benchmarks -- benchmark machine --base-path /mnt/scratch/benchmark | ||
cargo run --release --bin polkadot-parachain-omni-node --features runtime-benchmarks -- benchmark machine --base-path /mnt/scratch/benchmark | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From my understanding, all |
||
|
||
+----------+----------------+-------------+-------------+-------------------+ | ||
| Category | Function | Score | Minimum | Result | | ||
|
@@ -53,7 +61,7 @@ cargo run --release --bin polkadot-parachain --features runtime-benchmarks -- be | |
## benchmark | ||
|
||
``` | ||
cargo run --release --bin polkadot-parachain \ | ||
cargo run --release --bin polkadot-parachain-omni-node \ | ||
--features runtime-benchmarks \ | ||
-- \ | ||
benchmark pallet \ | ||
|
@@ -68,18 +76,21 @@ benchmark pallet \ | |
|
||
### [Weights](https://github.com/Snowfork/cumulus/blob/ron/benchmark-beacon-bridge/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/snowbridge_pallet_ethereum_client.rs) | ||
|
||
|extrinsic | minimum execution time benchmarked(us) | | ||
| --------------------------------------- |----------------------------------------| | ||
|sync_committee_period_update | 123_126 | | ||
|bls_fast_aggregate_verify| 121_083 | | ||
|bls_aggregate_pubkey | 90_306 | | ||
|bls_verify_message | 28_000 | | ||
| extrinsic | minimum execution time benchmarked(us) | | ||
|------------------------------|----------------------------------------| | ||
| sync_committee_period_update | 123_126 | | ||
| bls_fast_aggregate_verify | 121_083 | | ||
| bls_aggregate_pubkey | 90_306 | | ||
| bls_verify_message | 28_000 | | ||
|
||
- [bls_fast_aggregate_verify](#bls_fast_aggregate_verify) consumes 98% execution time of [sync_committee_period_update](#sync_committee_period_update) | ||
- [bls_fast_aggregate_verify](#bls_fast_aggregate_verify) consumes 98% execution time | ||
of [sync_committee_period_update](#sync_committee_period_update) | ||
|
||
- [bls_aggregate_pubkey](#bls_aggregate_pubkey) consumes 75% execution time of [bls_fast_aggregate_verify](#bls_fast_aggregate_verify) | ||
- [bls_aggregate_pubkey](#bls_aggregate_pubkey) consumes 75% execution time | ||
of [bls_fast_aggregate_verify](#bls_fast_aggregate_verify) | ||
|
||
- [bls_verify_message](#bls_verify_message) consumes 23% execution time of [bls_fast_aggregate_verify](#bls_fast_aggregate_verify) | ||
- [bls_verify_message](#bls_verify_message) consumes 23% execution time | ||
of [bls_fast_aggregate_verify](#bls_fast_aggregate_verify) | ||
|
||
# Conclusion | ||
|
||
|
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.
@ggwpez the days for this command is also numbered, is there a ticket to move this to the omni-bencher?
Side question: can the omni-node do benchmarking as well? what are the runtime-dependent parts of the benchmarking code that live in the node side? I suppose there are dependencies that led to the omni-bencher being created, but idk what they are.