Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion rpc/jsonrpc/eth_call.go
Original file line number Diff line number Diff line change
Expand Up @@ -432,11 +432,20 @@ func (api *APIImpl) GetProof(ctx context.Context, address common.Address, storag
}
defer roTx.Rollback()

requestedBlockNr, _, _, err := rpchelper.GetCanonicalBlockNumber(ctx, blockNrOrHash, roTx, api._blockReader, api.filters)
// nil filters: the gate below and the commitment-history reads both go through
// this plain roTx, so the tag has to resolve on that same committed view.
requestedBlockNr, _, _, err := rpchelper.GetCanonicalBlockNumber(ctx, blockNrOrHash, roTx, api._blockReader, nil)
if err != nil {
return nil, err
}

// A canonical hash exists for blocks the header stage has downloaded but
// execution has not reached; the commitment history getProof needs is only
// written by execution.
if err := rpchelper.CheckBlockExecuted(roTx, uint64(requestedBlockNr)); err != nil {
return nil, err
Comment thread
awskii marked this conversation as resolved.
}

err = api.BaseAPI.checkPruneHistory(ctx, roTx, uint64(requestedBlockNr))
if err != nil {
return nil, err
Expand Down
7 changes: 6 additions & 1 deletion rpc/jsonrpc/parity_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,12 @@ func (api *ParityAPIImpl) ListStorageKeys(ctx context.Context, account common.Ad
}

bn := rawdb.ReadCurrentBlockNumber(tx)
minTxNum, err := api._txNumReader.Min(ctx, tx, *bn)
if bn == nil {
return nil, errors.New("current block number not found")
}
// Min(bn+1) is the first txNum past bn — the state the latest-state account
// read above sees. Min(bn) would scan storage as of the end of bn-1.
minTxNum, err := api._txNumReader.Min(ctx, tx, *bn+1)
if err != nil {
Comment thread
awskii marked this conversation as resolved.
return nil, err
}
Expand Down
Loading