You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Quantify the performance impact of VoteExtensions #609
As of v0.38, CometBFT introduces VoteExtensions (VE) as part of ABCI2.0. The content of VE is protected by signatures. A man-in-the-middle attack is now possible, between the validator who submitted each VE and the application. For example, a node can perform a MITM attack: while gossiping the pre-commit message to its peers it can stripping out or replace a VE.
To prevent such an attack, Comet handles the verification of extensions signature.
This issue captures the need to quantify or benchmark the impact of this additional verification step has on the overall performance of the system.
Problem Definition
Why do we need this work?
Because of application concerns that the additional signature verification incurs a heavy performance hit.
What problems may be addressed by introducing this work? Quantify with data the impact, and provide a ground to further reason about optimization that might be necessary to alleviate the performance impact.
Proposal
Beside signature verification, additionally assess the performance impact of different VE sizes (in bytes).
From first principles, I'm not sure why we'd expect there to be a significant performance impact from additional signature verification. Signature verification is pretty cheap, and for schemes like Ed25519, an optimized implementation can even batch verification together. Here's the output of cargo bench in a checkout of the ed25519-consensus repo (slightly tweaked to have more relevant batch sizes):
Batch Verification/Unbatched verification/100
time: [3.8417 ms 3.8460 ms 3.8504 ms]
thrpt: [25.971 Kelem/s 26.001 Kelem/s 26.030 Kelem/s]
Batch Verification/Signatures with Distinct Pubkeys/100
time: [1.9653 ms 1.9677 ms 1.9703 ms]
thrpt: [50.753 Kelem/s 50.820 Kelem/s 50.884 Kelem/s]
Batch Verification/Unbatched verification/200
time: [7.7384 ms 7.7460 ms 7.7533 ms]
thrpt: [25.796 Kelem/s 25.820 Kelem/s 25.845 Kelem/s]
Batch Verification/Signatures with Distinct Pubkeys/200
time: [3.5768 ms 3.5819 ms 3.5870 ms]
thrpt: [55.758 Kelem/s 55.836 Kelem/s 55.915 Kelem/s]
The Go implementation might be slower, but not by much, and 2-4ms per block doesn't seem particularly significant.
changed the title [-]Quantify the performance impact of signature verification on VoteExtensions[/-][+]Quantify the performance impact of VoteExtensions[/+]on Jun 7, 2023
Activity
sergio-mena commentedon Mar 29, 2023
Results shown in #547 partially address this. More will be done as part of
v0.38.xQAhdevalence commentedon Mar 31, 2023
From first principles, I'm not sure why we'd expect there to be a significant performance impact from additional signature verification. Signature verification is pretty cheap, and for schemes like Ed25519, an optimized implementation can even batch verification together. Here's the output of
cargo benchin a checkout of theed25519-consensusrepo (slightly tweaked to have more relevant batch sizes):The Go implementation might be slower, but not by much, and 2-4ms per block doesn't seem particularly significant.
[-]Quantify the performance impact of signature verification on VoteExtensions[/-][+]Quantify the performance impact of VoteExtensions[/+]