Skip to content

core/state: skip HistoricDB OpenTrie error to read historic state#1847

Closed
yysung1123 wants to merge 1 commit into0xPolygon:developfrom
yysung1123:skip-historic-db-open-trie
Closed

core/state: skip HistoricDB OpenTrie error to read historic state#1847
yysung1123 wants to merge 1 commit into0xPolygon:developfrom
yysung1123:skip-historic-db-open-trie

Conversation

@yysung1123
Copy link
Copy Markdown
Contributor

@yysung1123 yysung1123 commented Oct 28, 2025

Description

NewWithReader previously returned an error when OpenTrie failed.
For HistoricDB, skip the error to allow construction to proceed.
This PR enables reading historic state in RPC older than 128 blocks when running in PBSS archive mode.
A TODO is included to remove once HistoricDB implements OpenTrie.

Changes

  • Bugfix (non-breaking change that solves an issue)
  • Hotfix (change that solves an urgent issue, and requires immediate attention)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (change that is not backwards-compatible and/or changes current functionality)
  • Changes only for a subset of nodes

Breaking changes

Please complete this section if any breaking changes have been made, otherwise delete it

Nodes audience

In case this PR includes changes that must be applied only to a subset of nodes, please specify how you handled it (e.g. by adding a flag with a default value...)

Checklist

  • I have added at least 2 reviewer or the whole pos-v1 team
  • I have added sufficient documentation in code
  • I will be resolving comments - if any - by pushing each fix in a separate commit and linking the commit hash in the comment reply
  • Created a task in Jira and informed the team for implementation in Erigon client (if applicable)
  • Includes RPC methods changes, and the Notion documentation has been updated

Cross repository changes

  • This PR requires changes to heimdall
    • In case link the PR here:
  • This PR requires changes to matic-cli
    • In case link the PR here:

Testing

  • I have added unit tests
  • I have added tests to CI
  • I have tested this code manually on local environment
  • I have tested this code manually on remote devnet using express-cli
  • I have tested this code manually on amoy
  • I have created new e2e tests into express-cli

Manual tests

Please complete this section with the steps you performed if you ran manual tests for this functionality, otherwise delete it

Additional comments

Please post additional comments in this section if you have them, otherwise delete it

NewWithReader previously returned an error when OpenTrie failed.
For HistoricDB, skip the error to allow construction to proceed.
A TODO is included to remove once HistoricDB implements OpenTrie.
@sonarqubecloud
Copy link
Copy Markdown

@avalkov
Copy link
Copy Markdown
Contributor

avalkov commented Nov 3, 2025

Thank you, but fix is already applied here #1858

@yysung1123
Copy link
Copy Markdown
Contributor Author

yysung1123 commented Nov 3, 2025

Hi @avalkov,

I would like to know if it’s safe to remove db.OpenTrie introduced from the following commit:

5cab03d

If it’s not safe, we can undo the revert through this PR.
If it is safe, we can go ahead and close this PR.

Thanks!

@avalkov
Copy link
Copy Markdown
Contributor

avalkov commented Nov 3, 2025

As you can see all tests in the PR passed, also our archive nodes are syncing with this fix just fine.

@yysung1123 yysung1123 closed this Nov 3, 2025
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.

2 participants