Skip to content
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

pallet-ethereum: kill Pending storage when finalizing block #638

Merged
merged 1 commit into from Apr 19, 2022
Merged

pallet-ethereum: kill Pending storage when finalizing block #638

merged 1 commit into from Apr 19, 2022

Conversation

koushiro
Copy link
Collaborator

Signed-off-by: koushiro koushiro.cqx@gmail.com

The current implementation will store the Pending on-chain, but I don't think it's necessary

Signed-off-by: koushiro <koushiro.cqx@gmail.com>
@koushiro koushiro requested a review from sorpaas as a code owner April 18, 2022 07:55
@koushiro
Copy link
Collaborator Author

koushiro commented Apr 18, 2022

/cc @tgmichel @AsceticBear

Copy link
Collaborator

@boundless-forest boundless-forest left a comment

Choose a reason for hiding this comment

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

LGTM, the pending data has been stored in store_block(...).

@sorpaas sorpaas merged commit 7afad9a into polkadot-evm:master Apr 19, 2022
@koushiro koushiro deleted the kill-pending-storage branch April 19, 2022 23:48
@tgmichel
Copy link
Contributor

cc @sorpaas This PR introduces a bug in pallet-ethereum storage on runtime upgrade.

Block #1 - Runtime version 1
- on_initialize kill Pending -> Storage Pending []
- User sends transaction A
- Storage Pending[A]

Block #2 - Runtime version 1
- on_initialize kill Pending -> Storage Pending []
- User sends transaction B
- Storage Pending[B]

---- Runtime Upgrade version 1 -> version 2 -----

Block #3 - Runtime version 2
- (on_initialize kill Pending WAS REMOVED)
- User sends transaction C
- Storage Pending[B, C]
- on_finalize kill Pending -> Storage Pending []

Results in transaction B to exist in runtime storage for two different blocks (and mapped in the offchain db also).

@tgmichel
Copy link
Contributor

So a migration is needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants