Summary
Implement hybrid query routing for Bonsai Archive nodes, routing recent block reads to the fast O(1) Bonsai layer and historical reads to the Archive layer via seekForPrev. This follows the sync-as-Bonsai-then-migrate work in #9608.
Background
Once an archive node has synced and migrated historical state to [hash+blockN] archive keys, the node needs a routing layer to serve queries from the right storage layer:
- Recent blocks (HEAD to HEAD - boundary): O(1) direct
[hash] key lookups via the Bonsai layer
- Historical blocks (beyond HEAD - boundary): seekForPrev via the Archive layer using
[hash+blockN] keys
This preserves Engine API and recent query performance (same as regular Bonsai) while retaining full historical query support.
Acceptance Criteria
Prerequisites
Summary
Implement hybrid query routing for Bonsai Archive nodes, routing recent block reads to the fast O(1) Bonsai layer and historical reads to the Archive layer via seekForPrev. This follows the sync-as-Bonsai-then-migrate work in #9608.
Background
Once an archive node has synced and migrated historical state to
[hash+blockN]archive keys, the node needs a routing layer to serve queries from the right storage layer:[hash]key lookups via the Bonsai layer[hash+blockN]keysThis preserves Engine API and recent query performance (same as regular Bonsai) while retaining full historical query support.
Acceptance Criteria
[hash]keys (O(1), no seekForPrev)BonsaiArchiveFlatDbStrategy[hash]keys to the Bonsai layerPrerequisites