mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-22 19:50:36 +00:00
trace read parent header from snapshot and lru #4042
This commit is contained in:
parent
c896807bfe
commit
533970d31c
@ -17,7 +17,6 @@ import (
|
||||
"github.com/ledgerwatch/erigon/common/hexutil"
|
||||
math2 "github.com/ledgerwatch/erigon/common/math"
|
||||
"github.com/ledgerwatch/erigon/core"
|
||||
"github.com/ledgerwatch/erigon/core/rawdb"
|
||||
"github.com/ledgerwatch/erigon/core/state"
|
||||
"github.com/ledgerwatch/erigon/core/types"
|
||||
"github.com/ledgerwatch/erigon/core/types/accounts"
|
||||
@ -1034,7 +1033,13 @@ func (api *TraceAPIImpl) CallMany(ctx context.Context, calls json.RawMessage, pa
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
parentHeader := rawdb.ReadHeader(dbtx, hash, blockNumber)
|
||||
|
||||
// TODO: can read here only parent header
|
||||
parentBlock, err := api.blockWithSenders(dbtx, hash, blockNumber)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
parentHeader := parentBlock.Header()
|
||||
if parentHeader == nil {
|
||||
return nil, fmt.Errorf("parent header %d(%x) not found", blockNumber, hash)
|
||||
}
|
||||
@ -1085,7 +1090,12 @@ func (api *TraceAPIImpl) doCallMany(ctx context.Context, dbtx kv.Tx, msgs []type
|
||||
noop := state.NewNoopWriter()
|
||||
cachedWriter := state.NewCachedWriter(noop, stateCache)
|
||||
|
||||
parentHeader := rawdb.ReadHeader(dbtx, hash, blockNumber)
|
||||
// TODO: can read here only parent header
|
||||
parentBlock, err := api.blockWithSenders(dbtx, hash, blockNumber)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
parentHeader := parentBlock.Header()
|
||||
if parentHeader == nil {
|
||||
return nil, fmt.Errorf("parent header %d(%x) not found", blockNumber, hash)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user