diff --git a/turbo/adapter/ethapi/api.go b/turbo/adapter/ethapi/api.go index d40b0c2e795..6fcf309a5e0 100644 --- a/turbo/adapter/ethapi/api.go +++ b/turbo/adapter/ethapi/api.go @@ -165,11 +165,11 @@ func (args *CallArgs) ToMessage(globalGasCap uint64, baseFee *uint256.Int) (type // if statDiff is set, all diff will be applied first and then execute the call // message. type Account struct { - Nonce *hexutil.Uint64 `json:"nonce"` - Code *hexutility.Bytes `json:"code"` - Balance **hexutil.Big `json:"balance"` - State *map[libcommon.Hash]uint256.Int `json:"state"` - StateDiff *map[libcommon.Hash]uint256.Int `json:"stateDiff"` + Nonce *hexutil.Uint64 `json:"nonce"` + Code *hexutility.Bytes `json:"code"` + Balance **hexutil.Big `json:"balance"` + State *map[libcommon.Hash]uint256.Int `json:"state"` + StateDiff *map[libcommon.Hash]libcommon.Hash `json:"stateDiff"` } func NewRevertError(result *core.ExecutionResult) *RevertError { diff --git a/turbo/adapter/ethapi/state_overrides.go b/turbo/adapter/ethapi/state_overrides.go index 1ce2655acad..f47718a8fc1 100644 --- a/turbo/adapter/ethapi/state_overrides.go +++ b/turbo/adapter/ethapi/state_overrides.go @@ -8,6 +8,7 @@ import ( libcommon "github.com/ledgerwatch/erigon-lib/common" "github.com/ledgerwatch/erigon/core/state" + "github.com/ledgerwatch/log/v3" ) type StateOverrides map[libcommon.Address]Account @@ -41,8 +42,10 @@ func (overrides *StateOverrides) Override(state *state.IntraBlockState) error { // Apply state diff into specified accounts. if account.StateDiff != nil { for key, value := range *account.StateDiff { + log.Info("StateDiff override at", "addr", addr, "key", key, "value", value); key := key - state.SetState(addr, &key, value) + intValue := new(uint256.Int).SetBytes32(value.Bytes()) + state.SetState(addr, &key, *intValue) } } }