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

turbo/execution: drop td lookup in getters #12832

Merged
merged 2 commits into from
Nov 21, 2024
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
22 changes: 0 additions & 22 deletions turbo/execution/eth1/ethereum_execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,6 @@ func NewEthereumExecutionModule(blockReader services.FullBlockReader, db kv.RwDB
}

func (e *EthereumExecutionModule) getHeader(ctx context.Context, tx kv.Tx, blockHash libcommon.Hash, blockNumber uint64) (*types.Header, error) {
td, err := rawdb.ReadTd(tx, blockHash, blockNumber)
if err != nil {
return nil, err
}
if td == nil {
return nil, nil
}

if e.blockReader == nil {
return rawdb.ReadHeader(tx, blockHash, blockNumber), nil
}
Expand All @@ -142,13 +134,6 @@ func (e *EthereumExecutionModule) getTD(_ context.Context, tx kv.Tx, blockHash l
}

func (e *EthereumExecutionModule) getBody(ctx context.Context, tx kv.Tx, blockHash libcommon.Hash, blockNumber uint64) (*types.Body, error) {
td, err := rawdb.ReadTd(tx, blockHash, blockNumber)
if err != nil {
return nil, err
}
if td == nil {
return nil, nil
}
if e.blockReader == nil {
body, _, _ := rawdb.ReadBody(tx, blockHash, blockNumber)
return body, nil
Expand All @@ -175,13 +160,6 @@ func (e *EthereumExecutionModule) canonicalHash(ctx context.Context, tx kv.Tx, b
}
}

td, err := rawdb.ReadTd(tx, canonical, blockNumber)
if err != nil {
return libcommon.Hash{}, err
}
if td == nil {
return libcommon.Hash{}, nil
}
return canonical, nil
}

Expand Down
7 changes: 0 additions & 7 deletions turbo/execution/eth1/getters.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,6 @@ func (e *EthereumExecutionModule) GetBody(ctx context.Context, req *execution.Ge
if err != nil {
return nil, fmt.Errorf("ethereumExecutionModule.GetBody: parseSegmentRequest error %w", err)
}
td, err := rawdb.ReadTd(tx, blockHash, blockNumber)
if err != nil {
return nil, fmt.Errorf("ethereumExecutionModule.GetBody: ReadTd error %w", err)
}
if td == nil {
return &execution.GetBodyResponse{Body: nil}, nil
}
body, err := e.getBody(ctx, tx, blockHash, blockNumber)
if err != nil {
return nil, fmt.Errorf("ethereumExecutionModule.GetBody: getBody error %w", err)
Expand Down
Loading