Prevent precompiles removal at pallet-evm-system#1519
Merged
dmitrylavrenov merged 15 commits intomasterfrom Apr 11, 2025
Merged
Prevent precompiles removal at pallet-evm-system#1519dmitrylavrenov merged 15 commits intomasterfrom
pallet-evm-system#1519dmitrylavrenov merged 15 commits intomasterfrom
Conversation
Contributor
|
Contributor
Author
Thanks
|
e11487a to
93335c7
Compare
Contributor
|
What I meant regarding (3) is that the type itself that we use to represent the PrecompilesSet (instead of No that we don't want to solve the events issue. |
Contributor
Author
I see, thanks, now it's clear! |
d60b793 to
8bf5bdf
Compare
ce88b73 to
9864d20
Compare
9864d20 to
c8bb381
Compare
pallet-evm-systempallet-evm-system
MOZGIII
approved these changes
Apr 10, 2025
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Issue
By default, precompiled accounts are created at the
pallet-evm-system <- pallet-evm <- pallet-dummy-precompiles-code:The issue is that a precompiled account is removed at
pallet-evm-systemin case withdrawing full balance from this account if the balance is not empty.Later if some tokens are transferred to the account -> the account is created again. Withdrawing full tokens -> the account is removed again. It's repeated again and again.
So, it means we should prevent precompiled accounts removal.
Proposed solution
It sounds reasonable to introduce and use additional
IsPrecompileat pallet config that allows checking whether a given account is a precompile or not. As a result, prevent removal if the account is a precompiled one.