Skip to content

Commit

Permalink
Merge pull request #10111 from filecoin-project/asr/fix-eth-get-storage
Browse files Browse the repository at this point in the history
fix: EthAPI: Drop hack in GetStorageAt
  • Loading branch information
arajasek authored Jan 25, 2023
2 parents 926e2b0 + 8864782 commit 1c2446d
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions node/impl/full/eth.go
Original file line number Diff line number Diff line change
Expand Up @@ -500,18 +500,8 @@ func (a *EthModule) EthGetStorageAt(ctx context.Context, ethAddr ethtypes.EthAdd
return nil, fmt.Errorf("failed to construct system sender address: %w", err)
}

// TODO super duper hack (raulk). The EVM runtime actor uses the U256 parameter type in
// GetStorageAtParams, which serializes as a hex-encoded string. It should serialize
// as bytes. We didn't get to fix in time for Iron, so for now we just pass
// through the hex-encoded value passed through the Eth JSON-RPC API, by remarshalling it.
// We don't fix this at origin (builtin-actors) because we are not updating the bundle
// for Iron.
tmp, err := position.MarshalJSON()
if err != nil {
panic(err)
}
params, err := actors.SerializeParams(&evm.GetStorageAtParams{
StorageKey: tmp[1 : len(tmp)-1], // TODO strip the JSON-encoding quotes -- yuck
StorageKey: position,
})
if err != nil {
return nil, fmt.Errorf("failed to serialize parameters: %w", err)
Expand Down

0 comments on commit 1c2446d

Please sign in to comment.