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

rpc can't server state based data until persisted #2700

Open
advaita-saha opened this issue Oct 4, 2024 · 1 comment · May be fixed by #2824
Open

rpc can't server state based data until persisted #2700

advaita-saha opened this issue Oct 4, 2024 · 1 comment · May be fixed by #2824
Labels
EL RPC JSON-RPC over HTTP/websocket

Comments

@advaita-saha
Copy link
Contributor

advaita-saha commented Oct 4, 2024

When the blocks are in memory and is not persisted to the database, during that time rpc requests raise an exception due to

proc ledgerFromTag(api: ServerAPIRef, blockTag: BlockTag): Result[LedgerRef, string] =
let header = ?api.headerFromTag(blockTag)
if api.chain.stateReady(header):
ok(LedgerRef.init(api.com.db, header.stateRoot))
else:
# TODO: Replay state?
err("Block state not ready")

One of the ways is to replay the state, but on every rpc request state getting replayed might be a bad idea.
This also directly affects the working of eth_getTransactionCount endpoint raising an exception and stopping the blob-spammer of kurtosis

@arnetheduck
Copy link
Member

These requests need to be routed to forkedchainref which will keep a version of the state for each known unpersisted state in memory - for now, that involves a replay, but that should be easy to switch to a list of "known heads".

@jangko jangko added EL RPC JSON-RPC over HTTP/websocket labels Oct 6, 2024
@advaita-saha advaita-saha linked a pull request Nov 3, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
EL RPC JSON-RPC over HTTP/websocket
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants