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

Cleanup logic of applying old chunk #9639

Open
Longarithm opened this issue Oct 5, 2023 · 0 comments
Open

Cleanup logic of applying old chunk #9639

Longarithm opened this issue Oct 5, 2023 · 0 comments
Labels
C-housekeeping Category: Refactoring, cleanups, code quality T-core Team: issues relevant to the core team

Comments

@Longarithm
Copy link
Member

Longarithm commented Oct 5, 2023

When there is no chunk at some height, chunk header is just copied from previous block and Chain::get_apply_chunk_job_old_chunk is called.

Inside it, RuntimeAdapter::apply_transactions is called, which may look like that transactions and receipts are applied, but in fact it is not the case after ProtocolFeature::FixApplyChunks. It means that a bunch of fields is not needed, like receipts, transactions, gas_price, block_timestamp, so we can simplify the logic in such case.

The only updates which can happen are Runtime::update_validator_accounts and Runtime::apply_migrations, and they must be preserved. But I suggest to investigate moving them to their own Runtime method, potentially we can remove bunch of code after that.

More context near.zulipchat.com/#narrow/stream/295302-general/topic/.E2.9C.94.20gas.20price.20inconsistency/near/394894144

@Longarithm Longarithm added C-housekeeping Category: Refactoring, cleanups, code quality T-core Team: issues relevant to the core team labels Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-housekeeping Category: Refactoring, cleanups, code quality T-core Team: issues relevant to the core team
Projects
None yet
Development

No branches or pull requests

1 participant