Skip to content

Commit

Permalink
dissable get storage at
Browse files Browse the repository at this point in the history
  • Loading branch information
sideninja committed Sep 12, 2024
1 parent 04ba8f7 commit 4a34223
Showing 1 changed file with 1 addition and 29 deletions.
30 changes: 1 addition & 29 deletions api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -888,35 +888,7 @@ func (b *BlockChainAPI) GetStorageAt(
storageSlot string,
blockNumberOrHash rpc.BlockNumberOrHash,
) (hexutil.Bytes, error) {
l := b.logger.With().
Str("endpoint", "getStorageAt").
Str("address", address.String()).
Logger()

if err := rateLimit(ctx, b.limiter, l); err != nil {
return nil, err
}

key, _, err := decodeHash(storageSlot)
if err != nil {
return handleError[hexutil.Bytes](
fmt.Errorf("%w: %w", errs.ErrInvalid, err),
l,
b.collector,
)
}

evmHeight, err := b.getBlockNumber(&blockNumberOrHash)
if err != nil {
return handleError[hexutil.Bytes](err, l, b.collector)
}

result, err := b.evm.GetStorageAt(ctx, address, key, evmHeight)
if err != nil {
return handleError[hexutil.Bytes](err, l, b.collector)
}

return result[:], nil
return nil, errs.ErrEndpointNotSupported
}

func (b *BlockChainAPI) fetchBlockTransactions(
Expand Down

0 comments on commit 4a34223

Please sign in to comment.