-
Notifications
You must be signed in to change notification settings - Fork 886
fix(evmrpc): return pruned errors from debug_trace* at unavailable heights (PLT-975) #3888
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
base: main
Are you sure you want to change the base?
Changes from all commits
4198af5
19a24a5
6bc998d
c964dcd
1845b87
a558ab6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -410,26 +410,12 @@ func (b *Backend) ChainDb() ethdb.Database { | |
| panic("implement me") | ||
| } | ||
|
|
||
| func (b Backend) ConvertBlockNumber(bn rpc.BlockNumber) int64 { | ||
| blockNum := bn.Int64() | ||
| switch blockNum { | ||
| case rpc.SafeBlockNumber.Int64(), rpc.FinalizedBlockNumber.Int64(), rpc.LatestBlockNumber.Int64(): | ||
| blockNum = b.ctxProvider(LatestCtxHeight).BlockHeight() | ||
| case rpc.EarliestBlockNumber.Int64(): | ||
| genesisRes, err := b.tmClient.Genesis(context.Background()) | ||
| if err != nil { | ||
| panic("could not get genesis info from tendermint") | ||
| } | ||
| blockNum = genesisRes.Genesis.InitialHeight | ||
| case rpc.PendingBlockNumber.Int64(): | ||
| panic("tracing on pending block is not supported") | ||
| } | ||
| return blockNum | ||
| } | ||
|
|
||
| func (b Backend) BlockByNumber(ctx context.Context, bn rpc.BlockNumber) (*ethtypes.Block, []tracersutils.TraceBlockMetadata, error) { | ||
| blockNum := b.ConvertBlockNumber(bn) | ||
| tmBlock, err := blockByNumberRespectingWatermarks(ctx, b.tmClient, b.watermarks, &blockNum, 1) | ||
| blockNumberPtr, err := getBlockNumber(ctx, b.tmClient, bn) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [nit] Swapping |
||
| if err != nil { | ||
| return nil, nil, err | ||
| } | ||
| tmBlock, err := blockByNumberRespectingWatermarks(ctx, b.tmClient, b.watermarks, blockNumberPtr, 1) | ||
| if err != nil { | ||
| return nil, nil, err | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.