Skip to content

[pallet-revive] weight charge in sr25519_verify and ecdsa_to_eth_address precompiles#10861

Merged
pgherveou merged 4 commits intomasterfrom
cl/charge
Jan 22, 2026
Merged

[pallet-revive] weight charge in sr25519_verify and ecdsa_to_eth_address precompiles#10861
pgherveou merged 4 commits intomasterfrom
cl/charge

Conversation

@xermicus
Copy link
Copy Markdown
Member

@xermicus xermicus commented Jan 21, 2026

I couldn't see where the weight is charged in those builtin pre-compiles and a quick test indicated that there's no charges implemented. Assuming those are compute-heavy functions, the missing weight charges seem like a serious DoS vector.

Signed-off-by: xermicus <cyrill@parity.io>
@xermicus xermicus added A4-backport-unstable2507 Pull request must be backported to the unstable2507 release branch A4-backport-stable2512 Pull request must be backported to the stable2512 release branch labels Jan 21, 2026
@xermicus
Copy link
Copy Markdown
Member Author

/cmd fmt

Signed-off-by: xermicus <cyrill@parity.io>
@xermicus
Copy link
Copy Markdown
Member Author

/cmd prdoc --audience runtime_dev --bump patch

@xermicus xermicus requested review from 0xRVE and marian-radu January 21, 2026 15:12
Copy link
Copy Markdown
Contributor

@pgherveou pgherveou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

@burdges
Copy link
Copy Markdown
Contributor

burdges commented Jan 21, 2026

Yup, they're costly, sr25519 should cost like 45 microseconds on one CPU core. And ecdsa should be somewhat more expensive.

@pgherveou pgherveou added this pull request to the merge queue Jan 22, 2026
Merged via the queue into master with commit 2eb4350 Jan 22, 2026
239 of 241 checks passed
@pgherveou pgherveou deleted the cl/charge branch January 22, 2026 14:36
@paritytech-release-backport-bot
Copy link
Copy Markdown

Created backport PR for unstable2507:

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin backport-10861-to-unstable2507
git worktree add --checkout .worktree/backport-10861-to-unstable2507 backport-10861-to-unstable2507
cd .worktree/backport-10861-to-unstable2507
git reset --hard HEAD^
git cherry-pick -x 2eb43506e24f8d19028b0d928c3039d2830e7572
git push --force-with-lease

paritytech-release-backport-bot bot pushed a commit that referenced this pull request Jan 22, 2026
…ddress` precompiles (#10861)

I couldn't see where the weight is charged in those builtin pre-compiles
and a quick test indicated that there's no charges implemented. Assuming
those are compute-heavy functions, the missing weight charges seem like
a serious DoS vector.

---------

Signed-off-by: xermicus <cyrill@parity.io>
Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
(cherry picked from commit 2eb4350)
@paritytech-release-backport-bot
Copy link
Copy Markdown

Successfully created backport PR for stable2512:

EgorPopelyaev pushed a commit that referenced this pull request Jan 22, 2026
Backport #10861 into `stable2512` from xermicus.

See the
[documentation](https://github.com/paritytech/polkadot-sdk/blob/master/docs/BACKPORT.md)
on how to use this bot.

<!--
  # To be used by other automation, do not modify:
  original-pr-number: #${pull_number}
-->

Signed-off-by: xermicus <cyrill@parity.io>
Co-authored-by: xermicus <cyrill@parity.io>
Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@xermicus xermicus removed the A4-backport-unstable2507 Pull request must be backported to the unstable2507 release branch label Jan 22, 2026
pgherveou pushed a commit that referenced this pull request Jan 22, 2026
…ddress` precompiles (#10861)

I couldn't see where the weight is charged in those builtin pre-compiles
and a quick test indicated that there's no charges implemented. Assuming
those are compute-heavy functions, the missing weight charges seem like
a serious DoS vector.

---------

Signed-off-by: xermicus <cyrill@parity.io>
Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
(cherry picked from commit 2eb4350)
arturgontijo pushed a commit to moonbeam-foundation/polkadot-sdk that referenced this pull request Apr 1, 2026
Backport paritytech#10861 into `stable2512` from xermicus.

See the
[documentation](https://github.com/paritytech/polkadot-sdk/blob/master/docs/BACKPORT.md)
on how to use this bot.

<!--
  # To be used by other automation, do not modify:
  original-pr-number: #${pull_number}
-->

Signed-off-by: xermicus <cyrill@parity.io>
Co-authored-by: xermicus <cyrill@parity.io>
Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A4-backport-stable2512 Pull request must be backported to the stable2512 release branch

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants