diff --git a/mocks/mock_vm.go b/mocks/mock_vm.go index fb831acbc..fce753bd3 100644 --- a/mocks/mock_vm.go +++ b/mocks/mock_vm.go @@ -43,24 +43,24 @@ func (m *MockVM) EXPECT() *MockVMMockRecorder { } // Call mocks base method. -func (m *MockVM) Call(arg0 *vm.CallInfo, arg1 *vm.BlockInfo, arg2 core.StateReader, arg3 *utils.Network, arg4 uint64, arg5 bool) ([]*felt.Felt, error) { +func (m *MockVM) Call(arg0 *vm.CallInfo, arg1 *vm.BlockInfo, arg2 core.StateReader, arg3 *utils.Network, arg4 uint64) ([]*felt.Felt, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Call", arg0, arg1, arg2, arg3, arg4, arg5) + ret := m.ctrl.Call(m, "Call", arg0, arg1, arg2, arg3, arg4) ret0, _ := ret[0].([]*felt.Felt) ret1, _ := ret[1].(error) return ret0, ret1 } // Call indicates an expected call of Call. -func (mr *MockVMMockRecorder) Call(arg0, arg1, arg2, arg3, arg4, arg5 any) *gomock.Call { +func (mr *MockVMMockRecorder) Call(arg0, arg1, arg2, arg3, arg4 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Call", reflect.TypeOf((*MockVM)(nil).Call), arg0, arg1, arg2, arg3, arg4, arg5) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Call", reflect.TypeOf((*MockVM)(nil).Call), arg0, arg1, arg2, arg3, arg4) } // Execute mocks base method. -func (m *MockVM) Execute(arg0 []core.Transaction, arg1 []core.Class, arg2 []*felt.Felt, arg3 *vm.BlockInfo, arg4 core.StateReader, arg5 *utils.Network, arg6, arg7, arg8, arg9 bool) ([]*felt.Felt, []core.GasConsumed, []vm.TransactionTrace, uint64, error) { +func (m *MockVM) Execute(arg0 []core.Transaction, arg1 []core.Class, arg2 []*felt.Felt, arg3 *vm.BlockInfo, arg4 core.StateReader, arg5 *utils.Network, arg6, arg7, arg8 bool) ([]*felt.Felt, []core.GasConsumed, []vm.TransactionTrace, uint64, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Execute", arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) + ret := m.ctrl.Call(m, "Execute", arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) ret0, _ := ret[0].([]*felt.Felt) ret1, _ := ret[1].([]core.GasConsumed) ret2, _ := ret[2].([]vm.TransactionTrace) @@ -70,7 +70,7 @@ func (m *MockVM) Execute(arg0 []core.Transaction, arg1 []core.Class, arg2 []*fel } // Execute indicates an expected call of Execute. -func (mr *MockVMMockRecorder) Execute(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9 any) *gomock.Call { +func (mr *MockVMMockRecorder) Execute(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Execute", reflect.TypeOf((*MockVM)(nil).Execute), arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Execute", reflect.TypeOf((*MockVM)(nil).Execute), arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) } diff --git a/node/node.go b/node/node.go index ccb316c84..38df2d9d1 100644 --- a/node/node.go +++ b/node/node.go @@ -209,7 +209,7 @@ func New(cfg *Config, version string) (*Node, error) { //nolint:gocyclo,funlen return nil, err } jsonrpcServerLegacy := jsonrpc.NewServer(maxGoroutines, log).WithValidator(validator.Validator()) - legacyMethods, legacyPath := rpcHandler.MethodsV0_6() + legacyMethods, legacyPath := rpcHandler.MethodsV0_7() if err = jsonrpcServerLegacy.RegisterMethods(legacyMethods...); err != nil { return nil, err } diff --git a/node/throttled_vm.go b/node/throttled_vm.go index 4612f3749..f50c66be1 100644 --- a/node/throttled_vm.go +++ b/node/throttled_vm.go @@ -20,19 +20,18 @@ func NewThrottledVM(res vm.VM, concurrenyBudget uint, maxQueueLen int32) *Thrott } func (tvm *ThrottledVM) Call(callInfo *vm.CallInfo, blockInfo *vm.BlockInfo, state core.StateReader, - network *utils.Network, maxSteps uint64, useBlobData bool, + network *utils.Network, maxSteps uint64, ) ([]*felt.Felt, error) { var ret []*felt.Felt return ret, tvm.Do(func(vm *vm.VM) error { var err error - ret, err = (*vm).Call(callInfo, blockInfo, state, network, maxSteps, useBlobData) + ret, err = (*vm).Call(callInfo, blockInfo, state, network, maxSteps) return err }) } func (tvm *ThrottledVM) Execute(txns []core.Transaction, declaredClasses []core.Class, paidFeesOnL1 []*felt.Felt, - blockInfo *vm.BlockInfo, state core.StateReader, network *utils.Network, skipChargeFee, skipValidate, errOnRevert, - useBlobData bool, + blockInfo *vm.BlockInfo, state core.StateReader, network *utils.Network, skipChargeFee, skipValidate, errOnRevert bool, ) ([]*felt.Felt, []core.GasConsumed, []vm.TransactionTrace, uint64, error) { var ret []*felt.Felt var traces []vm.TransactionTrace @@ -41,7 +40,7 @@ func (tvm *ThrottledVM) Execute(txns []core.Transaction, declaredClasses []core. return ret, daGas, traces, numSteps, tvm.Do(func(vm *vm.VM) error { var err error ret, daGas, traces, numSteps, err = (*vm).Execute(txns, declaredClasses, paidFeesOnL1, blockInfo, state, network, - skipChargeFee, skipValidate, errOnRevert, useBlobData) + skipChargeFee, skipValidate, errOnRevert) return err }) } diff --git a/rpc/block.go b/rpc/block.go index 44114e947..290297807 100644 --- a/rpc/block.go +++ b/rpc/block.go @@ -193,17 +193,6 @@ func (h *Handler) BlockWithTxHashes(id BlockID) (*BlockWithTxHashes, *jsonrpc.Er }, nil } -func (h *Handler) BlockWithTxHashesV0_6(id BlockID) (*BlockWithTxHashes, *jsonrpc.Error) { - resp, err := h.BlockWithTxHashes(id) - if err != nil { - return nil, err - } - - resp.L1DAMode = nil - resp.L1DataGasPrice = nil - return resp, nil -} - // BlockTransactionCount returns the number of transactions in a block // identified by the given BlockID. // @@ -240,7 +229,7 @@ func (h *Handler) BlockWithReceipts(id BlockID) (*BlockWithReceipts, *jsonrpc.Er txsWithReceipts[index] = TransactionWithReceipt{ Transaction: AdaptTransaction(txn), // block_hash, block_number are optional in BlockWithReceipts response - Receipt: AdaptReceipt(r, txn, finalityStatus, nil, 0, false), + Receipt: AdaptReceipt(r, txn, finalityStatus, nil, 0), } } @@ -278,17 +267,6 @@ func (h *Handler) BlockWithTxs(id BlockID) (*BlockWithTxs, *jsonrpc.Error) { }, nil } -func (h *Handler) BlockWithTxsV0_6(id BlockID) (*BlockWithTxs, *jsonrpc.Error) { - resp, err := h.BlockWithTxs(id) - if err != nil { - return nil, err - } - - resp.L1DAMode = nil - resp.L1DataGasPrice = nil - return resp, nil -} - func (h *Handler) blockStatus(id BlockID, block *core.Block) (BlockStatus, *jsonrpc.Error) { l1H, jsonErr := h.l1Head() if jsonErr != nil { diff --git a/rpc/block_test.go b/rpc/block_test.go index 1db7d2855..a6fa1d28a 100644 --- a/rpc/block_test.go +++ b/rpc/block_test.go @@ -501,7 +501,7 @@ func TestBlockWithTxHashesV013(t *testing.T) { mockReader.EXPECT().BlockByNumber(gomock.Any()).Return(coreBlock, nil) mockReader.EXPECT().L1Head().Return(&core.L1Head{}, nil) - got, rpcErr := handler.BlockWithTxsV0_6(rpc.BlockID{Number: blockNumber}) + got, rpcErr := handler.BlockWithTxs(rpc.BlockID{Number: blockNumber}) require.Nil(t, rpcErr) got.Transactions = got.Transactions[:1] @@ -512,10 +512,15 @@ func TestBlockWithTxHashesV013(t *testing.T) { NewRoot: coreBlock.GlobalStateRoot, Number: &coreBlock.Number, ParentHash: coreBlock.ParentHash, + L1DAMode: utils.Ptr(rpc.Blob), L1GasPrice: &rpc.ResourcePrice{ InFri: utils.HexToFelt(t, "0x17882b6aa74"), InWei: utils.HexToFelt(t, "0x3b9aca10"), }, + L1DataGasPrice: &rpc.ResourcePrice{ + InFri: utils.HexToFelt(t, "0x2cc6d7f596e1"), + InWei: utils.HexToFelt(t, "0x716a8f6dd"), + }, SequencerAddress: coreBlock.SequencerAddress, Timestamp: coreBlock.Timestamp, }, @@ -604,7 +609,7 @@ func TestBlockWithReceipts(t *testing.T) { txsWithReceipt = append(txsWithReceipt, rpc.TransactionWithReceipt{ Transaction: adaptedTx, - Receipt: rpc.AdaptReceipt(receipt, tx, rpc.TxnAcceptedOnL2, nil, 0, false), + Receipt: rpc.AdaptReceipt(receipt, tx, rpc.TxnAcceptedOnL2, nil, 0), }) } @@ -648,7 +653,7 @@ func TestBlockWithReceipts(t *testing.T) { transactions = append(transactions, rpc.TransactionWithReceipt{ Transaction: adaptedTx, - Receipt: rpc.AdaptReceipt(receipt, tx, rpc.TxnAcceptedOnL1, nil, 0, false), + Receipt: rpc.AdaptReceipt(receipt, tx, rpc.TxnAcceptedOnL1, nil, 0), }) } diff --git a/rpc/estimate_fee.go b/rpc/estimate_fee.go index 55aebb5a4..3af789c4f 100644 --- a/rpc/estimate_fee.go +++ b/rpc/estimate_fee.go @@ -1,7 +1,6 @@ package rpc import ( - "encoding/json" "errors" "fmt" "net/http" @@ -36,27 +35,6 @@ type FeeEstimate struct { DataGasPrice *felt.Felt `json:"data_gas_price"` OverallFee *felt.Felt `json:"overall_fee"` Unit *FeeUnit `json:"unit,omitempty"` - // pre 13.1 response - v0_6Response bool -} - -func (f FeeEstimate) MarshalJSON() ([]byte, error) { - if f.v0_6Response { - return json.Marshal(struct { - GasConsumed *felt.Felt `json:"gas_consumed"` - GasPrice *felt.Felt `json:"gas_price"` - OverallFee *felt.Felt `json:"overall_fee"` - Unit *FeeUnit `json:"unit,omitempty"` - }{ - GasConsumed: f.GasConsumed, - GasPrice: f.GasPrice, - OverallFee: f.OverallFee, - Unit: f.Unit, - }) - } else { - type alias FeeEstimate // avoid infinite recursion - return json.Marshal(alias(f)) - } } /**************************************************** @@ -66,20 +44,7 @@ func (f FeeEstimate) MarshalJSON() ([]byte, error) { func (h *Handler) EstimateFee(broadcastedTxns []BroadcastedTransaction, simulationFlags []SimulationFlag, id BlockID, ) ([]FeeEstimate, http.Header, *jsonrpc.Error) { - result, httpHeader, err := h.simulateTransactions(id, broadcastedTxns, append(simulationFlags, SkipFeeChargeFlag), false, true) - if err != nil { - return nil, httpHeader, err - } - - return utils.Map(result, func(tx SimulatedTransaction) FeeEstimate { - return tx.FeeEstimation - }), httpHeader, nil -} - -func (h *Handler) EstimateFeeV0_6(broadcastedTxns []BroadcastedTransaction, - simulationFlags []SimulationFlag, id BlockID, -) ([]FeeEstimate, http.Header, *jsonrpc.Error) { - result, httpHeader, err := h.simulateTransactions(id, broadcastedTxns, append(simulationFlags, SkipFeeChargeFlag), true, true) + result, httpHeader, err := h.simulateTransactions(id, broadcastedTxns, append(simulationFlags, SkipFeeChargeFlag), true) if err != nil { return nil, httpHeader, err } @@ -93,19 +58,6 @@ func (h *Handler) EstimateMessageFee(msg MsgFromL1, id BlockID) (*FeeEstimate, h return h.estimateMessageFee(msg, id, h.EstimateFee) } -func (h *Handler) EstimateMessageFeeV0_6(msg MsgFromL1, id BlockID) (*FeeEstimate, http.Header, *jsonrpc.Error) { //nolint:gocritic - feeEstimate, httpHeader, rpcErr := h.estimateMessageFee(msg, id, h.EstimateFeeV0_6) - if rpcErr != nil { - return nil, httpHeader, rpcErr - } - - feeEstimate.v0_6Response = true - feeEstimate.DataGasPrice = nil - feeEstimate.DataGasConsumed = nil - - return feeEstimate, httpHeader, nil -} - type estimateFeeHandler func(broadcastedTxns []BroadcastedTransaction, simulationFlags []SimulationFlag, id BlockID, ) ([]FeeEstimate, http.Header, *jsonrpc.Error) diff --git a/rpc/estimate_fee_test.go b/rpc/estimate_fee_test.go index d075e5a0c..fdc3699a8 100644 --- a/rpc/estimate_fee_test.go +++ b/rpc/estimate_fee_test.go @@ -3,101 +3,19 @@ package rpc_test import ( "encoding/json" "errors" - "fmt" "testing" "github.com/NethermindEth/juno/core" "github.com/NethermindEth/juno/core/felt" - "github.com/NethermindEth/juno/db" "github.com/NethermindEth/juno/mocks" "github.com/NethermindEth/juno/rpc" "github.com/NethermindEth/juno/utils" "github.com/NethermindEth/juno/vm" - "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.uber.org/mock/gomock" ) -func TestEstimateMessageFeeV0_6(t *testing.T) { - mockCtrl := gomock.NewController(t) - t.Cleanup(mockCtrl.Finish) - - n := utils.Ptr(utils.Mainnet) - mockReader := mocks.NewMockReader(mockCtrl) - mockReader.EXPECT().Network().Return(n).AnyTimes() - mockVM := mocks.NewMockVM(mockCtrl) - - handler := rpc.New(mockReader, nil, mockVM, "", utils.NewNopZapLogger()) - msg := rpc.MsgFromL1{ - From: common.HexToAddress("0xDEADBEEF"), - To: *new(felt.Felt).SetUint64(1337), - Payload: []felt.Felt{*new(felt.Felt).SetUint64(1), *new(felt.Felt).SetUint64(2)}, - Selector: *new(felt.Felt).SetUint64(44), - } - - t.Run("block not found", func(t *testing.T) { - mockReader.EXPECT().HeadState().Return(nil, nil, db.ErrKeyNotFound) - _, httpHeader, err := handler.EstimateMessageFeeV0_6(msg, rpc.BlockID{Latest: true}) - require.Equal(t, rpc.ErrBlockNotFound, err) - require.NotEmpty(t, httpHeader.Get(rpc.ExecutionStepsHeader)) - }) - - latestHeader := &core.Header{ - Number: 9, - Timestamp: 456, - GasPrice: new(felt.Felt).SetUint64(42), - } - mockState := mocks.NewMockStateHistoryReader(mockCtrl) - - mockReader.EXPECT().HeadState().Return(mockState, nopCloser, nil) - mockReader.EXPECT().HeadsHeader().Return(latestHeader, nil) - - expectedGasConsumed := new(felt.Felt).SetUint64(37) - mockVM.EXPECT().Execute(gomock.Any(), gomock.Any(), gomock.Any(), &vm.BlockInfo{ - Header: latestHeader, - }, gomock.Any(), &utils.Mainnet, gomock.Any(), false, true, false).DoAndReturn( - func(txns []core.Transaction, declaredClasses []core.Class, paidFeesOnL1 []*felt.Felt, blockInfo *vm.BlockInfo, - state core.StateReader, network *utils.Network, skipChargeFee, skipValidate, errOnRevert, useBlobData bool, - ) ([]*felt.Felt, []core.GasConsumed, []vm.TransactionTrace, uint64, error) { - require.Len(t, txns, 1) - assert.NotNil(t, txns[0].(*core.L1HandlerTransaction)) - - assert.Empty(t, declaredClasses) - assert.Len(t, paidFeesOnL1, 1) - - actualFee := new(felt.Felt).Mul(expectedGasConsumed, blockInfo.Header.GasPrice) - daGas := []core.GasConsumed{{L1Gas: 0, L1DataGas: 0}} - return []*felt.Felt{actualFee}, daGas, []vm.TransactionTrace{{ - StateDiff: &vm.StateDiff{ - StorageDiffs: []vm.StorageDiff{}, - Nonces: []vm.Nonce{}, - DeployedContracts: []vm.DeployedContract{}, - DeprecatedDeclaredClasses: []*felt.Felt{}, - DeclaredClasses: []vm.DeclaredClass{}, - ReplacedClasses: []vm.ReplacedClass{}, - }, - }}, uint64(123), nil - }, - ) - - estimateFee, httpHeader, err := handler.EstimateMessageFeeV0_6(msg, rpc.BlockID{Latest: true}) - require.Nil(t, err) - expectedJSON := fmt.Sprintf( - `{"gas_consumed":%q,"gas_price":%q,"overall_fee":%q,"unit":"WEI"}`, - expectedGasConsumed, - latestHeader.GasPrice, - new(felt.Felt).Mul(expectedGasConsumed, latestHeader.GasPrice), - ) - - // we check json response here because some fields are private and we can't set them and assert.Equal fails - // also in 0.6 response some fields should not be presented - estimateFeeJSON, jsonErr := json.Marshal(estimateFee) - require.NoError(t, jsonErr) - require.Equal(t, expectedJSON, string(estimateFeeJSON)) - require.NotEmpty(t, httpHeader.Get(rpc.ExecutionStepsHeader)) -} - func TestEstimateFee(t *testing.T) { mockCtrl := gomock.NewController(t) defer mockCtrl.Finish() @@ -116,7 +34,7 @@ func TestEstimateFee(t *testing.T) { blockInfo := vm.BlockInfo{Header: &core.Header{}} t.Run("ok with zero values", func(t *testing.T) { - mockVM.EXPECT().Execute([]core.Transaction{}, nil, []*felt.Felt{}, &blockInfo, mockState, n, true, false, true, true). + mockVM.EXPECT().Execute([]core.Transaction{}, nil, []*felt.Felt{}, &blockInfo, mockState, n, true, false, true). Return([]*felt.Felt{}, []core.GasConsumed{}, []vm.TransactionTrace{}, uint64(123), nil) _, httpHeader, err := handler.EstimateFee([]rpc.BroadcastedTransaction{}, []rpc.SimulationFlag{}, rpc.BlockID{Latest: true}) @@ -125,7 +43,7 @@ func TestEstimateFee(t *testing.T) { }) t.Run("ok with zero values, skip validate", func(t *testing.T) { - mockVM.EXPECT().Execute([]core.Transaction{}, nil, []*felt.Felt{}, &blockInfo, mockState, n, true, true, true, true). + mockVM.EXPECT().Execute([]core.Transaction{}, nil, []*felt.Felt{}, &blockInfo, mockState, n, true, true, true). Return([]*felt.Felt{}, []core.GasConsumed{}, []vm.TransactionTrace{}, uint64(123), nil) _, httpHeader, err := handler.EstimateFee([]rpc.BroadcastedTransaction{}, []rpc.SimulationFlag{rpc.SkipValidateFlag}, rpc.BlockID{Latest: true}) @@ -134,7 +52,7 @@ func TestEstimateFee(t *testing.T) { }) t.Run("transaction execution error", func(t *testing.T) { - mockVM.EXPECT().Execute([]core.Transaction{}, nil, []*felt.Felt{}, &blockInfo, mockState, n, true, true, true, true). + mockVM.EXPECT().Execute([]core.Transaction{}, nil, []*felt.Felt{}, &blockInfo, mockState, n, true, true, true). Return(nil, nil, nil, uint64(0), vm.TransactionExecutionError{ Index: 44, Cause: errors.New("oops"), diff --git a/rpc/handlers.go b/rpc/handlers.go index cfaf1f37a..e4ef62167 100644 --- a/rpc/handlers.go +++ b/rpc/handlers.go @@ -68,8 +68,7 @@ const ( ) type traceCacheKey struct { - blockHash felt.Felt - v0_6Response bool + blockHash felt.Felt } type Handler struct { @@ -164,14 +163,14 @@ func (h *Handler) Version() (string, *jsonrpc.Error) { } func (h *Handler) SpecVersion() (string, *jsonrpc.Error) { - return "0.7.1", nil + return "0.8.0", nil } -func (h *Handler) SpecVersionV0_6() (string, *jsonrpc.Error) { - return "0.6.0", nil +func (h *Handler) SpecVersionV0_7() (string, *jsonrpc.Error) { + return "0.7.1", nil } -func (h *Handler) Methods() ([]jsonrpc.Method, string) { //nolint: funlen +func (h *Handler) Methods() ([]jsonrpc.Method, string) { //nolint: funlen, dupl return []jsonrpc.Method{ { Name: "starknet_chainId", @@ -326,10 +325,10 @@ func (h *Handler) Methods() ([]jsonrpc.Method, string) { //nolint: funlen Params: []jsonrpc.Parameter{{Name: "block_id"}}, Handler: h.BlockWithReceipts, }, - }, "/v0_7" + }, "/v0_8" } -func (h *Handler) MethodsV0_6() ([]jsonrpc.Method, string) { //nolint: funlen +func (h *Handler) MethodsV0_7() ([]jsonrpc.Method, string) { //nolint: funlen, dupl return []jsonrpc.Method{ { Name: "starknet_chainId", @@ -346,12 +345,12 @@ func (h *Handler) MethodsV0_6() ([]jsonrpc.Method, string) { //nolint: funlen { Name: "starknet_getBlockWithTxHashes", Params: []jsonrpc.Parameter{{Name: "block_id"}}, - Handler: h.BlockWithTxHashesV0_6, + Handler: h.BlockWithTxHashes, }, { Name: "starknet_getBlockWithTxs", Params: []jsonrpc.Parameter{{Name: "block_id"}}, - Handler: h.BlockWithTxsV0_6, + Handler: h.BlockWithTxs, }, { Name: "starknet_getTransactionByHash", @@ -361,7 +360,7 @@ func (h *Handler) MethodsV0_6() ([]jsonrpc.Method, string) { //nolint: funlen { Name: "starknet_getTransactionReceipt", Params: []jsonrpc.Parameter{{Name: "transaction_hash"}}, - Handler: h.TransactionReceiptByHashV0_6, + Handler: h.TransactionReceiptByHash, }, { Name: "starknet_getBlockTransactionCount", @@ -439,36 +438,36 @@ func (h *Handler) MethodsV0_6() ([]jsonrpc.Method, string) { //nolint: funlen { Name: "starknet_call", Params: []jsonrpc.Parameter{{Name: "request"}, {Name: "block_id"}}, - Handler: h.CallV0_6, + Handler: h.Call, }, { Name: "starknet_estimateFee", Params: []jsonrpc.Parameter{{Name: "request"}, {Name: "simulation_flags"}, {Name: "block_id"}}, - Handler: h.EstimateFeeV0_6, + Handler: h.EstimateFee, }, { Name: "starknet_estimateMessageFee", Params: []jsonrpc.Parameter{{Name: "message"}, {Name: "block_id"}}, - Handler: h.EstimateMessageFeeV0_6, + Handler: h.EstimateMessageFee, }, { Name: "starknet_traceTransaction", Params: []jsonrpc.Parameter{{Name: "transaction_hash"}}, - Handler: h.TraceTransactionV0_6, + Handler: h.TraceTransaction, }, { Name: "starknet_simulateTransactions", Params: []jsonrpc.Parameter{{Name: "block_id"}, {Name: "transactions"}, {Name: "simulation_flags"}}, - Handler: h.SimulateTransactionsV0_6, + Handler: h.SimulateTransactions, }, { Name: "starknet_traceBlockTransactions", Params: []jsonrpc.Parameter{{Name: "block_id"}}, - Handler: h.TraceBlockTransactionsV0_6, + Handler: h.TraceBlockTransactions, }, { Name: "starknet_specVersion", - Handler: h.SpecVersionV0_6, + Handler: h.SpecVersion, }, { Name: "juno_subscribeNewHeads", @@ -479,5 +478,10 @@ func (h *Handler) MethodsV0_6() ([]jsonrpc.Method, string) { //nolint: funlen Params: []jsonrpc.Parameter{{Name: "id"}}, Handler: h.Unsubscribe, }, - }, "/v0_6" + { + Name: "starknet_getBlockWithReceipts", + Params: []jsonrpc.Parameter{{Name: "block_id"}}, + Handler: h.BlockWithReceipts, + }, + }, "/v0_7" } diff --git a/rpc/handlers_test.go b/rpc/handlers_test.go index c34b7727d..af5e9ae7a 100644 --- a/rpc/handlers_test.go +++ b/rpc/handlers_test.go @@ -30,11 +30,11 @@ func TestSpecVersion(t *testing.T) { handler := rpc.New(nil, nil, nil, "", nil) version, rpcErr := handler.SpecVersion() require.Nil(t, rpcErr) - require.Equal(t, "0.7.1", version) + require.Equal(t, "0.8.0", version) - legacyVersion, rpcErr := handler.SpecVersionV0_6() + legacyVersion, rpcErr := handler.SpecVersionV0_7() require.Nil(t, rpcErr) - require.Equal(t, "0.6.0", legacyVersion) + require.Equal(t, "0.7.1", legacyVersion) } func TestThrottledVMError(t *testing.T) { diff --git a/rpc/helpers.go b/rpc/helpers.go index 50db59c1e..dae08c5ff 100644 --- a/rpc/helpers.go +++ b/rpc/helpers.go @@ -87,15 +87,10 @@ func (h *Handler) blockHeaderByID(id *BlockID) (*core.Header, *jsonrpc.Error) { return header, nil } -func adaptExecutionResources(resources *core.ExecutionResources, v0_6Response bool) *ExecutionResources { +func adaptExecutionResources(resources *core.ExecutionResources) *ExecutionResources { if resources == nil { - var dataAvailability *DataAvailability - if !v0_6Response { - dataAvailability = &DataAvailability{} - } - return &ExecutionResources{ - DataAvailability: dataAvailability, + DataAvailability: &DataAvailability{}, } } @@ -112,15 +107,12 @@ func adaptExecutionResources(resources *core.ExecutionResources, v0_6Response bo Poseidon: resources.BuiltinInstanceCounter.Poseidon, SegmentArena: resources.BuiltinInstanceCounter.SegmentArena, }, + DataAvailability: &DataAvailability{}, } - if !v0_6Response { - if resources.DataAvailability == nil { - res.DataAvailability = &DataAvailability{} - } else { - res.DataAvailability = &DataAvailability{ - L1Gas: resources.DataAvailability.L1Gas, - L1DataGas: resources.DataAvailability.L1DataGas, - } + if resources.DataAvailability != nil { + res.DataAvailability = &DataAvailability{ + L1Gas: resources.DataAvailability.L1Gas, + L1DataGas: resources.DataAvailability.L1DataGas, } } diff --git a/rpc/simulation.go b/rpc/simulation.go index 940fabdd9..3dda777ed 100644 --- a/rpc/simulation.go +++ b/rpc/simulation.go @@ -53,20 +53,12 @@ type TracedBlockTransaction struct { func (h *Handler) SimulateTransactions(id BlockID, transactions []BroadcastedTransaction, simulationFlags []SimulationFlag, ) ([]SimulatedTransaction, http.Header, *jsonrpc.Error) { - return h.simulateTransactions(id, transactions, simulationFlags, false, false) -} - -// pre 13.1 -func (h *Handler) SimulateTransactionsV0_6(id BlockID, transactions []BroadcastedTransaction, - simulationFlags []SimulationFlag, -) ([]SimulatedTransaction, http.Header, *jsonrpc.Error) { - // todo double check errOnRevert = false - return h.simulateTransactions(id, transactions, simulationFlags, true, false) + return h.simulateTransactions(id, transactions, simulationFlags, false) } //nolint:funlen,gocyclo func (h *Handler) simulateTransactions(id BlockID, transactions []BroadcastedTransaction, - simulationFlags []SimulationFlag, v0_6Response, errOnRevert bool, + simulationFlags []SimulationFlag, errOnRevert bool, ) ([]SimulatedTransaction, http.Header, *jsonrpc.Error) { skipFeeCharge := slices.Contains(simulationFlags, SkipFeeChargeFlag) skipValidate := slices.Contains(simulationFlags, SkipValidateFlag) @@ -113,9 +105,8 @@ func (h *Handler) simulateTransactions(id BlockID, transactions []BroadcastedTra Header: header, BlockHashToBeRevealed: blockHashToBeRevealed, } - useBlobData := !v0_6Response overallFees, daGas, traces, numSteps, err := h.vm.Execute(txns, classes, paidFeesOnL1, &blockInfo, - state, h.bcReader.Network(), skipFeeCharge, skipValidate, errOnRevert, useBlobData) + state, h.bcReader.Network(), skipFeeCharge, skipValidate, errOnRevert) httpHeader.Set(ExecutionStepsHeader, strconv.FormatUint(numSteps, 10)) @@ -153,12 +144,8 @@ func (h *Handler) simulateTransactions(id BlockID, transactions []BroadcastedTra var gasConsumed *felt.Felt daGasL1DataGas := new(felt.Felt).SetUint64(daGas[i].L1DataGas) - if !v0_6Response { - dataGasFee := new(felt.Felt).Mul(daGasL1DataGas, dataGasPrice) - gasConsumed = new(felt.Felt).Sub(overallFee, dataGasFee) - } else { - gasConsumed = overallFee.Clone() - } + dataGasFee := new(felt.Felt).Mul(daGasL1DataGas, dataGasPrice) + gasConsumed = new(felt.Felt).Sub(overallFee, dataGasFee) gasConsumed = gasConsumed.Div(gasConsumed, gasPrice) // division by zero felt is zero felt estimate := FeeEstimate{ @@ -168,18 +155,15 @@ func (h *Handler) simulateTransactions(id BlockID, transactions []BroadcastedTra DataGasPrice: dataGasPrice, OverallFee: overallFee, Unit: utils.Ptr(feeUnit), - v0_6Response: v0_6Response, } - if !v0_6Response { - trace := traces[i] - executionResources := trace.TotalExecutionResources() - executionResources.DataAvailability = &vm.DataAvailability{ - L1Gas: daGas[i].L1Gas, - L1DataGas: daGas[i].L1DataGas, - } - traces[i].ExecutionResources = executionResources + trace := traces[i] + executionResources := trace.TotalExecutionResources() + executionResources.DataAvailability = &vm.DataAvailability{ + L1Gas: daGas[i].L1Gas, + L1DataGas: daGas[i].L1DataGas, } + traces[i].ExecutionResources = executionResources result = append(result, SimulatedTransaction{ TransactionTrace: &traces[i], diff --git a/rpc/simulation_test.go b/rpc/simulation_test.go index d15f0908d..8798bdfa0 100644 --- a/rpc/simulation_test.go +++ b/rpc/simulation_test.go @@ -16,7 +16,7 @@ import ( ) //nolint:dupl -func TestSimulateTransactionsV0_6(t *testing.T) { +func TestSimulateTransactions(t *testing.T) { mockCtrl := gomock.NewController(t) defer mockCtrl.Finish() @@ -38,10 +38,10 @@ func TestSimulateTransactionsV0_6(t *testing.T) { stepsUsed := uint64(123) mockVM.EXPECT().Execute([]core.Transaction{}, nil, []*felt.Felt{}, &vm.BlockInfo{ Header: headsHeader, - }, mockState, n, true, false, false, false). + }, mockState, n, true, false, false). Return([]*felt.Felt{}, []core.GasConsumed{}, []vm.TransactionTrace{}, stepsUsed, nil) - _, httpHeader, err := handler.SimulateTransactionsV0_6(rpc.BlockID{Latest: true}, []rpc.BroadcastedTransaction{}, []rpc.SimulationFlag{rpc.SkipFeeChargeFlag}) + _, httpHeader, err := handler.SimulateTransactions(rpc.BlockID{Latest: true}, []rpc.BroadcastedTransaction{}, []rpc.SimulationFlag{rpc.SkipFeeChargeFlag}) require.Nil(t, err) assert.Equal(t, httpHeader.Get(rpc.ExecutionStepsHeader), "123") }) @@ -50,35 +50,19 @@ func TestSimulateTransactionsV0_6(t *testing.T) { stepsUsed := uint64(123) mockVM.EXPECT().Execute([]core.Transaction{}, nil, []*felt.Felt{}, &vm.BlockInfo{ Header: headsHeader, - }, mockState, n, false, true, false, false). + }, mockState, n, false, true, false). Return([]*felt.Felt{}, []core.GasConsumed{}, []vm.TransactionTrace{}, stepsUsed, nil) - _, httpHeader, err := handler.SimulateTransactionsV0_6(rpc.BlockID{Latest: true}, []rpc.BroadcastedTransaction{}, []rpc.SimulationFlag{rpc.SkipValidateFlag}) + _, httpHeader, err := handler.SimulateTransactions(rpc.BlockID{Latest: true}, []rpc.BroadcastedTransaction{}, []rpc.SimulationFlag{rpc.SkipValidateFlag}) require.Nil(t, err) assert.Equal(t, httpHeader.Get(rpc.ExecutionStepsHeader), "123") }) t.Run("transaction execution error", func(t *testing.T) { - t.Run("v0_6", func(t *testing.T) { //nolint:dupl + t.Run("v0_7, v0_8", func(t *testing.T) { //nolint:dupl mockVM.EXPECT().Execute([]core.Transaction{}, nil, []*felt.Felt{}, &vm.BlockInfo{ Header: headsHeader, - }, mockState, n, false, true, false, false). - Return(nil, nil, nil, uint64(0), vm.TransactionExecutionError{ - Index: 44, - Cause: errors.New("oops"), - }) - - _, httpHeader, err := handler.SimulateTransactionsV0_6(rpc.BlockID{Latest: true}, []rpc.BroadcastedTransaction{}, []rpc.SimulationFlag{rpc.SkipValidateFlag}) - require.Equal(t, rpc.ErrTransactionExecutionError.CloneWithData(rpc.TransactionExecutionErrorData{ - TransactionIndex: 44, - ExecutionError: "oops", - }), err) - require.Equal(t, httpHeader.Get(rpc.ExecutionStepsHeader), "0") - }) - t.Run("v0_7", func(t *testing.T) { //nolint:dupl - mockVM.EXPECT().Execute([]core.Transaction{}, nil, []*felt.Felt{}, &vm.BlockInfo{ - Header: headsHeader, - }, mockState, n, false, true, false, true). + }, mockState, n, false, true, false). Return(nil, nil, nil, uint64(0), vm.TransactionExecutionError{ Index: 44, Cause: errors.New("oops"), diff --git a/rpc/trace.go b/rpc/trace.go index 0faeed20b..17aa11c68 100644 --- a/rpc/trace.go +++ b/rpc/trace.go @@ -132,16 +132,10 @@ func adaptFeederExecutionResources(resources *starknet.ExecutionResources) *vm.E // It follows the specification defined here: // https://github.com/starkware-libs/starknet-specs/blob/1ae810e0137cc5d175ace4554892a4f43052be56/api/starknet_trace_api_openrpc.json#L11 func (h *Handler) TraceTransaction(ctx context.Context, hash felt.Felt) (*vm.TransactionTrace, http.Header, *jsonrpc.Error) { - return h.traceTransaction(ctx, &hash, false) + return h.traceTransaction(ctx, &hash) } -func (h *Handler) TraceTransactionV0_6(ctx context.Context, hash felt.Felt) (*vm.TransactionTrace, http.Header, *jsonrpc.Error) { - return h.traceTransaction(ctx, &hash, true) -} - -func (h *Handler) traceTransaction(ctx context.Context, hash *felt.Felt, v0_6Response bool) (*vm.TransactionTrace, - http.Header, *jsonrpc.Error, -) { +func (h *Handler) traceTransaction(ctx context.Context, hash *felt.Felt) (*vm.TransactionTrace, http.Header, *jsonrpc.Error) { _, blockHash, _, err := h.bcReader.Receipt(hash) httpHeader := http.Header{} httpHeader.Set(ExecutionStepsHeader, "0") @@ -175,7 +169,7 @@ func (h *Handler) traceTransaction(ctx context.Context, hash *felt.Felt, v0_6Res return nil, httpHeader, ErrTxnHashNotFound } - traceResults, header, traceBlockErr := h.traceBlockTransactions(ctx, block, v0_6Response) + traceResults, header, traceBlockErr := h.traceBlockTransactions(ctx, block) if traceBlockErr != nil { return nil, header, traceBlockErr } @@ -191,20 +185,11 @@ func (h *Handler) TraceBlockTransactions(ctx context.Context, id BlockID) ([]Tra return nil, httpHeader, rpcErr } - return h.traceBlockTransactions(ctx, block, false) + return h.traceBlockTransactions(ctx, block) } -func (h *Handler) TraceBlockTransactionsV0_6(ctx context.Context, id BlockID) ([]TracedBlockTransaction, http.Header, *jsonrpc.Error) { - block, rpcErr := h.blockByID(&id) - if rpcErr != nil { - return nil, nil, rpcErr - } - - return h.traceBlockTransactions(ctx, block, true) -} - -func (h *Handler) traceBlockTransactions(ctx context.Context, block *core.Block, v0_6Response bool, //nolint: gocyclo, funlen -) ([]TracedBlockTransaction, http.Header, *jsonrpc.Error) { +//nolint:funlen,gocyclo +func (h *Handler) traceBlockTransactions(ctx context.Context, block *core.Block) ([]TracedBlockTransaction, http.Header, *jsonrpc.Error) { httpHeader := http.Header{} httpHeader.Set(ExecutionStepsHeader, "0") @@ -219,38 +204,35 @@ func (h *Handler) traceBlockTransactions(ctx context.Context, block *core.Block, return nil, httpHeader, err } - if !v0_6Response { - txDataAvailability := make(map[felt.Felt]vm.DataAvailability, len(block.Receipts)) - for _, receipt := range block.Receipts { - if receipt.ExecutionResources == nil { - continue - } - if receiptDA := receipt.ExecutionResources.DataAvailability; receiptDA != nil { - da := vm.DataAvailability{ - L1Gas: receiptDA.L1Gas, - L1DataGas: receiptDA.L1DataGas, - } - txDataAvailability[*receipt.TransactionHash] = da + txDataAvailability := make(map[felt.Felt]vm.DataAvailability, len(block.Receipts)) + for _, receipt := range block.Receipts { + if receipt.ExecutionResources == nil { + continue + } + if receiptDA := receipt.ExecutionResources.DataAvailability; receiptDA != nil { + da := vm.DataAvailability{ + L1Gas: receiptDA.L1Gas, + L1DataGas: receiptDA.L1DataGas, } + txDataAvailability[*receipt.TransactionHash] = da } + } - // add execution resources on root level - for index, trace := range result { - executionResources := trace.TraceRoot.TotalExecutionResources() - // fgw doesn't provide this data in traces endpoint - // some receipts don't have data availability data in this case we don't - da := txDataAvailability[*trace.TransactionHash] - executionResources.DataAvailability = &da - result[index].TraceRoot.ExecutionResources = executionResources - } + // add execution resources on root level + for index, trace := range result { + executionResources := trace.TraceRoot.TotalExecutionResources() + // fgw doesn't provide this data in traces endpoint + // some receipts don't have data availability data in this case we don't + da := txDataAvailability[*trace.TransactionHash] + executionResources.DataAvailability = &da + result[index].TraceRoot.ExecutionResources = executionResources } return result, httpHeader, err } if trace, hit := h.blockTraceCache.Get(traceCacheKey{ - blockHash: *block.Hash, - v0_6Response: v0_6Response, + blockHash: *block.Hash, }); hit { return trace, httpHeader, nil } @@ -304,9 +286,8 @@ func (h *Handler) traceBlockTransactions(ctx context.Context, block *core.Block, BlockHashToBeRevealed: blockHashToBeRevealed, } - useBlobData := !v0_6Response _, daGas, traces, numSteps, err := h.vm.Execute(block.Transactions, classes, paidFeesOnL1, - &blockInfo, state, network, false, false, false, useBlobData) + &blockInfo, state, network, false, false, false) httpHeader.Set(ExecutionStepsHeader, strconv.FormatUint(numSteps, 10)) @@ -321,14 +302,12 @@ func (h *Handler) traceBlockTransactions(ctx context.Context, block *core.Block, result := make([]TracedBlockTransaction, 0, len(traces)) for index, trace := range traces { - if !v0_6Response { - executionResources := trace.TotalExecutionResources() - executionResources.DataAvailability = &vm.DataAvailability{ - L1Gas: daGas[index].L1Gas, - L1DataGas: daGas[index].L1DataGas, - } - traces[index].ExecutionResources = executionResources + executionResources := trace.TotalExecutionResources() + executionResources.DataAvailability = &vm.DataAvailability{ + L1Gas: daGas[index].L1Gas, + L1DataGas: daGas[index].L1DataGas, } + traces[index].ExecutionResources = executionResources result = append(result, TracedBlockTransaction{ TraceRoot: &traces[index], TransactionHash: block.Transactions[index].Hash(), @@ -337,8 +316,7 @@ func (h *Handler) traceBlockTransactions(ctx context.Context, block *core.Block, if !isPending { h.blockTraceCache.Add(traceCacheKey{ - blockHash: *block.Hash, - v0_6Response: v0_6Response, + blockHash: *block.Hash, }, result) } @@ -372,14 +350,6 @@ func (h *Handler) fetchTraces(ctx context.Context, blockHash *felt.Felt) ([]Trac // https://github.com/starkware-libs/starknet-specs/blob/e0b76ed0d8d8eba405e182371f9edac8b2bcbc5a/api/starknet_api_openrpc.json#L401-L445 func (h *Handler) Call(funcCall FunctionCall, id BlockID) ([]*felt.Felt, *jsonrpc.Error) { //nolint:gocritic - return h.call(funcCall, id, true) -} - -func (h *Handler) CallV0_6(call FunctionCall, id BlockID) ([]*felt.Felt, *jsonrpc.Error) { //nolint:gocritic - return h.call(call, id, false) -} - -func (h *Handler) call(funcCall FunctionCall, id BlockID, useBlobData bool) ([]*felt.Felt, *jsonrpc.Error) { //nolint:gocritic state, closer, rpcErr := h.stateByBlockID(&id) if rpcErr != nil { return nil, rpcErr @@ -409,7 +379,7 @@ func (h *Handler) call(funcCall FunctionCall, id BlockID, useBlobData bool) ([]* }, &vm.BlockInfo{ Header: header, BlockHashToBeRevealed: blockHashToBeRevealed, - }, state, h.bcReader.Network(), h.callMaxSteps, useBlobData) + }, state, h.bcReader.Network(), h.callMaxSteps) if err != nil { if errors.Is(err, utils.ErrResourceBusy) { return nil, ErrInternal.CloneWithData(throttledVMErr) diff --git a/rpc/trace_test.go b/rpc/trace_test.go index a4a77adc0..f1050e5de 100644 --- a/rpc/trace_test.go +++ b/rpc/trace_test.go @@ -164,7 +164,7 @@ func TestTraceTransaction(t *testing.T) { stepsUsedStr := "123" mockVM.EXPECT().Execute([]core.Transaction{tx}, []core.Class{declaredClass.Class}, []*felt.Felt{}, &vm.BlockInfo{Header: header}, gomock.Any(), &utils.Mainnet, false, false, - false, true).Return(overallFee, consumedGas, []vm.TransactionTrace{*vmTrace}, stepsUsed, nil) + false).Return(overallFee, consumedGas, []vm.TransactionTrace{*vmTrace}, stepsUsed, nil) trace, httpHeader, err := handler.TraceTransaction(context.Background(), *hash) require.Nil(t, err) @@ -254,7 +254,7 @@ func TestTraceTransaction(t *testing.T) { stepsUsed := uint64(123) stepsUsedStr := "123" mockVM.EXPECT().Execute([]core.Transaction{tx}, []core.Class{declaredClass.Class}, []*felt.Felt{}, - &vm.BlockInfo{Header: header}, gomock.Any(), &utils.Mainnet, false, false, false, true). + &vm.BlockInfo{Header: header}, gomock.Any(), &utils.Mainnet, false, false, false). Return(overallFee, consumedGas, []vm.TransactionTrace{*vmTrace}, stepsUsed, nil) trace, httpHeader, err := handler.TraceTransaction(context.Background(), *hash) @@ -271,143 +271,7 @@ func TestTraceTransaction(t *testing.T) { }) } -func TestTraceTransactionV0_6(t *testing.T) { - mockCtrl := gomock.NewController(t) - t.Cleanup(mockCtrl.Finish) - - mockReader := mocks.NewMockReader(mockCtrl) - mockReader.EXPECT().Network().Return(&utils.Mainnet).AnyTimes() - mockVM := mocks.NewMockVM(mockCtrl) - handler := rpc.New(mockReader, nil, mockVM, "", utils.NewNopZapLogger()) - - t.Run("not found", func(t *testing.T) { - hash := utils.HexToFelt(t, "0xBBBB") - // Receipt() returns error related to db - mockReader.EXPECT().Receipt(hash).Return(nil, nil, uint64(0), db.ErrKeyNotFound) - - trace, httpHeader, err := handler.TraceTransactionV0_6(context.Background(), *hash) - assert.Nil(t, trace) - assert.Equal(t, httpHeader.Get(rpc.ExecutionStepsHeader), "0") - assert.Equal(t, rpc.ErrTxnHashNotFound, err) - }) - t.Run("ok", func(t *testing.T) { - hash := utils.HexToFelt(t, "0x37b244ea7dc6b3f9735fba02d183ef0d6807a572dd91a63cc1b14b923c1ac0") - tx := &core.DeclareTransaction{ - TransactionHash: hash, - ClassHash: utils.HexToFelt(t, "0x000000000"), - } - - header := &core.Header{ - Hash: utils.HexToFelt(t, "0xCAFEBABE"), - ParentHash: utils.HexToFelt(t, "0x0"), - SequencerAddress: utils.HexToFelt(t, "0X111"), - ProtocolVersion: "99.12.3", - } - block := &core.Block{ - Header: header, - Transactions: []core.Transaction{tx}, - } - declaredClass := &core.DeclaredClass{ - At: 3002, - Class: &core.Cairo1Class{}, - } - - mockReader.EXPECT().Receipt(hash).Return(nil, header.Hash, header.Number, nil) - mockReader.EXPECT().BlockByHash(header.Hash).Return(block, nil) - - mockReader.EXPECT().StateAtBlockHash(header.ParentHash).Return(nil, nopCloser, nil) - headState := mocks.NewMockStateHistoryReader(mockCtrl) - headState.EXPECT().Class(tx.ClassHash).Return(declaredClass, nil) - mockReader.EXPECT().HeadState().Return(headState, nopCloser, nil) - - vmTraceJSON := json.RawMessage(`{ - "validate_invocation": {"contract_address": "0xd747220b2744d8d8d48c8a52bd3869fb98aea915665ab2485d5eadb49def6a", "entry_point_selector": "0x162da33a4585851fe8d3af3c2a9c60b557814e221e0d4f30ff0b2189d9c7775", "calldata": ["0x2", "0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "0x219209e083275171774dab1df80982e9df2096516f06319c5c6d71ae0a8480c", "0x0", "0x3", "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "0x1171593aa5bdadda4d6b0efde6cc94ee7649c3163d5efeb19da6c16d63a2a63", "0x3", "0x10", "0x13", "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "0x1e8480", "0x0", "0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "0x1e8480", "0x0", "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "0x420eeb770f7a4", "0x0", "0x40139799e37e4", "0x0", "0xd747220b2744d8d8d48c8a52bd3869fb98aea915665ab2485d5eadb49def6a", "0x0", "0x0", "0x1", "0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "0x7a6f98c03379b9513ca84cca1373ff452a7462a3b61598f0af5bb27ad7f76d1", "0x64"], "caller_address": "0x0", "class_hash": "0x25ec026985a3bf9d0cc1fe17326b245dfdc3ff89b8fde106542a3ea56c5a918", "entry_point_type": "EXTERNAL", "call_type": "CALL", "result": [], "calls": [{"contract_address": "0xd747220b2744d8d8d48c8a52bd3869fb98aea915665ab2485d5eadb49def6a", "entry_point_selector": "0x162da33a4585851fe8d3af3c2a9c60b557814e221e0d4f30ff0b2189d9c7775", "calldata": ["0x2", "0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "0x219209e083275171774dab1df80982e9df2096516f06319c5c6d71ae0a8480c", "0x0", "0x3", "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "0x1171593aa5bdadda4d6b0efde6cc94ee7649c3163d5efeb19da6c16d63a2a63", "0x3", "0x10", "0x13", "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "0x1e8480", "0x0", "0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "0x1e8480", "0x0", "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "0x420eeb770f7a4", "0x0", "0x40139799e37e4", "0x0", "0xd747220b2744d8d8d48c8a52bd3869fb98aea915665ab2485d5eadb49def6a", "0x0", "0x0", "0x1", "0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "0x7a6f98c03379b9513ca84cca1373ff452a7462a3b61598f0af5bb27ad7f76d1", "0x64"], "caller_address": "0x0", "class_hash": "0x33434ad846cdd5f23eb73ff09fe6fddd568284a0fb7d1be20ee482f044dabe2", "entry_point_type": "EXTERNAL", "call_type": "DELEGATE", "result": [], "calls": [], "events": [], "messages": []}], "events": [], "messages": []}, - "execute_invocation": {"contract_address": "0xd747220b2744d8d8d48c8a52bd3869fb98aea915665ab2485d5eadb49def6a", "entry_point_selector": "0x15d40a3d6ca2ac30f4031e42be28da9b056fef9bb7357ac5e85627ee876e5ad", "calldata": ["0x2", "0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "0x219209e083275171774dab1df80982e9df2096516f06319c5c6d71ae0a8480c", "0x0", "0x3", "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "0x1171593aa5bdadda4d6b0efde6cc94ee7649c3163d5efeb19da6c16d63a2a63", "0x3", "0x10", "0x13", "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "0x1e8480", "0x0", "0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "0x1e8480", "0x0", "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "0x420eeb770f7a4", "0x0", "0x40139799e37e4", "0x0", "0xd747220b2744d8d8d48c8a52bd3869fb98aea915665ab2485d5eadb49def6a", "0x0", "0x0", "0x1", "0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "0x7a6f98c03379b9513ca84cca1373ff452a7462a3b61598f0af5bb27ad7f76d1", "0x64"], "caller_address": "0x0", "class_hash": "0x25ec026985a3bf9d0cc1fe17326b245dfdc3ff89b8fde106542a3ea56c5a918", "entry_point_type": "EXTERNAL", "call_type": "CALL", "result": ["0x1", "0x1"], "calls": [{"contract_address": "0xd747220b2744d8d8d48c8a52bd3869fb98aea915665ab2485d5eadb49def6a", "entry_point_selector": "0x15d40a3d6ca2ac30f4031e42be28da9b056fef9bb7357ac5e85627ee876e5ad", "calldata": ["0x2", "0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "0x219209e083275171774dab1df80982e9df2096516f06319c5c6d71ae0a8480c", "0x0", "0x3", "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "0x1171593aa5bdadda4d6b0efde6cc94ee7649c3163d5efeb19da6c16d63a2a63", "0x3", "0x10", "0x13", "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "0x1e8480", "0x0", "0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "0x1e8480", "0x0", "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "0x420eeb770f7a4", "0x0", "0x40139799e37e4", "0x0", "0xd747220b2744d8d8d48c8a52bd3869fb98aea915665ab2485d5eadb49def6a", "0x0", "0x0", "0x1", "0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "0x7a6f98c03379b9513ca84cca1373ff452a7462a3b61598f0af5bb27ad7f76d1", "0x64"], "caller_address": "0x0", "class_hash": "0x33434ad846cdd5f23eb73ff09fe6fddd568284a0fb7d1be20ee482f044dabe2", "entry_point_type": "EXTERNAL", "call_type": "DELEGATE", "result": ["0x1", "0x1"], "calls": [{"contract_address": "0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "entry_point_selector": "0x219209e083275171774dab1df80982e9df2096516f06319c5c6d71ae0a8480c", "calldata": ["0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "0x1e8480", "0x0"], "caller_address": "0xd747220b2744d8d8d48c8a52bd3869fb98aea915665ab2485d5eadb49def6a", "class_hash": "0x52c7ba99c77fc38dd3346beea6c0753c3471f2e3135af5bb837d6c9523fff62", "entry_point_type": "EXTERNAL", "call_type": "CALL", "result": ["0x1"], "calls": [{"contract_address": "0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "entry_point_selector": "0x219209e083275171774dab1df80982e9df2096516f06319c5c6d71ae0a8480c", "calldata": ["0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "0x1e8480", "0x0"], "caller_address": "0xd747220b2744d8d8d48c8a52bd3869fb98aea915665ab2485d5eadb49def6a", "class_hash": "0x2760f25d5a4fb2bdde5f561fd0b44a3dee78c28903577d37d669939d97036a0", "entry_point_type": "EXTERNAL", "call_type": "DELEGATE", "result": ["0x1"], "calls": [], "events": [{"keys": ["0x134692b230b9e1ffa39098904722134159652b09c5bc41d88d6698779d228ff"], "data": ["0xd747220b2744d8d8d48c8a52bd3869fb98aea915665ab2485d5eadb49def6a", "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "0x1e8480", "0x0"]}], "messages": []}], "events": [], "messages": []}, {"contract_address": "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "entry_point_selector": "0x1171593aa5bdadda4d6b0efde6cc94ee7649c3163d5efeb19da6c16d63a2a63", "calldata": ["0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "0x1e8480", "0x0", "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "0x420eeb770f7a4", "0x0", "0x40139799e37e4", "0x0", "0xd747220b2744d8d8d48c8a52bd3869fb98aea915665ab2485d5eadb49def6a", "0x0", "0x0", "0x1", "0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "0x7a6f98c03379b9513ca84cca1373ff452a7462a3b61598f0af5bb27ad7f76d1", "0x64"], "caller_address": "0xd747220b2744d8d8d48c8a52bd3869fb98aea915665ab2485d5eadb49def6a", "class_hash": "0x5ee939756c1a60b029c594da00e637bf5923bf04a86ff163e877e899c0840eb", "entry_point_type": "EXTERNAL", "call_type": "CALL", "result": ["0x1"], "calls": [{"contract_address": "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "entry_point_selector": "0x1171593aa5bdadda4d6b0efde6cc94ee7649c3163d5efeb19da6c16d63a2a63", "calldata": ["0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "0x1e8480", "0x0", "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "0x420eeb770f7a4", "0x0", "0x40139799e37e4", "0x0", "0xd747220b2744d8d8d48c8a52bd3869fb98aea915665ab2485d5eadb49def6a", "0x0", "0x0", "0x1", "0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "0x7a6f98c03379b9513ca84cca1373ff452a7462a3b61598f0af5bb27ad7f76d1", "0x64"], "caller_address": "0xd747220b2744d8d8d48c8a52bd3869fb98aea915665ab2485d5eadb49def6a", "class_hash": "0x38627c278c0b3cb3c84ddee2c783fb22c3c3a3f0e667ea2b82be0ea2253bce4", "entry_point_type": "EXTERNAL", "call_type": "DELEGATE", "result": ["0x1"], "calls": [{"contract_address": "0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "entry_point_selector": "0x41b033f4a31df8067c24d1e9b550a2ce75fd4a29e1147af9752174f0e6cb20", "calldata": ["0xd747220b2744d8d8d48c8a52bd3869fb98aea915665ab2485d5eadb49def6a", "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "0x1e8480", "0x0"], "caller_address": "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "class_hash": "0x52c7ba99c77fc38dd3346beea6c0753c3471f2e3135af5bb837d6c9523fff62", "entry_point_type": "EXTERNAL", "call_type": "CALL", "result": ["0x1"], "calls": [{"contract_address": "0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "entry_point_selector": "0x41b033f4a31df8067c24d1e9b550a2ce75fd4a29e1147af9752174f0e6cb20", "calldata": ["0xd747220b2744d8d8d48c8a52bd3869fb98aea915665ab2485d5eadb49def6a", "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "0x1e8480", "0x0"], "caller_address": "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "class_hash": "0x2760f25d5a4fb2bdde5f561fd0b44a3dee78c28903577d37d669939d97036a0", "entry_point_type": "EXTERNAL", "call_type": "DELEGATE", "result": ["0x1"], "calls": [], "events": [{"keys": ["0x99cd8bde557814842a3121e8ddfd433a539b8c9f14bf31ebf108d12e6196e9"], "data": ["0xd747220b2744d8d8d48c8a52bd3869fb98aea915665ab2485d5eadb49def6a", "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "0x1e8480", "0x0"]}], "messages": []}], "events": [], "messages": []}, {"contract_address": "0x1ed6790cdca923073adc728080b06c159d9784cc9bf8fb26181acfdbe4256e6", "entry_point_selector": "0x260bb04cf90403013190e77d7e75f3d40d3d307180364da33c63ff53061d4e8", "calldata": [], "caller_address": "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "class_hash": "0x5ee939756c1a60b029c594da00e637bf5923bf04a86ff163e877e899c0840eb", "entry_point_type": "EXTERNAL", "call_type": "CALL", "result": ["0x0", "0x0", "0x5"], "calls": [{"contract_address": "0x1ed6790cdca923073adc728080b06c159d9784cc9bf8fb26181acfdbe4256e6", "entry_point_selector": "0x260bb04cf90403013190e77d7e75f3d40d3d307180364da33c63ff53061d4e8", "calldata": [], "caller_address": "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "class_hash": "0x46668cd07d83af5d7158e7cd62c710f1a7573501bcd4f4092c6a4e1ecd2bf61", "entry_point_type": "EXTERNAL", "call_type": "DELEGATE", "result": ["0x0", "0x0", "0x5"], "calls": [], "events": [], "messages": []}], "events": [], "messages": []}, {"contract_address": "0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "entry_point_selector": "0x2e4263afad30923c891518314c3c95dbe830a16874e8abc5777a9a20b54c76e", "calldata": ["0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f"], "caller_address": "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "class_hash": "0x52c7ba99c77fc38dd3346beea6c0753c3471f2e3135af5bb837d6c9523fff62", "entry_point_type": "EXTERNAL", "call_type": "CALL", "result": ["0x1e8480", "0x0"], "calls": [{"contract_address": "0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "entry_point_selector": "0x2e4263afad30923c891518314c3c95dbe830a16874e8abc5777a9a20b54c76e", "calldata": ["0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f"], "caller_address": "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "class_hash": "0x2760f25d5a4fb2bdde5f561fd0b44a3dee78c28903577d37d669939d97036a0", "entry_point_type": "EXTERNAL", "call_type": "DELEGATE", "result": ["0x1e8480", "0x0"], "calls": [], "events": [], "messages": []}], "events": [], "messages": []}, {"contract_address": "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "entry_point_selector": "0x15543c3708653cda9d418b4ccd3be11368e40636c10c44b18cfe756b6d88b29", "calldata": ["0x7a6f98c03379b9513ca84cca1373ff452a7462a3b61598f0af5bb27ad7f76d1", "0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "0x1e8480", "0x0", "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "0x0", "0x0", "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f"], "caller_address": "0xd747220b2744d8d8d48c8a52bd3869fb98aea915665ab2485d5eadb49def6a", "class_hash": "0x2ceb6369dba6af865bca639f9f1342dfb1ae4e5d0d0723de98028b812e7cdd2", "entry_point_type": "EXTERNAL", "call_type": "DELEGATE", "result": [], "calls": [{"contract_address": "0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "entry_point_selector": "0x219209e083275171774dab1df80982e9df2096516f06319c5c6d71ae0a8480c", "calldata": ["0x7a6f98c03379b9513ca84cca1373ff452a7462a3b61598f0af5bb27ad7f76d1", "0x1e8480", "0x0"], "caller_address": "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "class_hash": "0x52c7ba99c77fc38dd3346beea6c0753c3471f2e3135af5bb837d6c9523fff62", "entry_point_type": "EXTERNAL", "call_type": "CALL", "result": ["0x1"], "calls": [{"contract_address": "0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "entry_point_selector": "0x219209e083275171774dab1df80982e9df2096516f06319c5c6d71ae0a8480c", "calldata": ["0x7a6f98c03379b9513ca84cca1373ff452a7462a3b61598f0af5bb27ad7f76d1", "0x1e8480", "0x0"], "caller_address": "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "class_hash": "0x2760f25d5a4fb2bdde5f561fd0b44a3dee78c28903577d37d669939d97036a0", "entry_point_type": "EXTERNAL", "call_type": "DELEGATE", "result": ["0x1"], "calls": [], "events": [{"keys": ["0x134692b230b9e1ffa39098904722134159652b09c5bc41d88d6698779d228ff"], "data": ["0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "0x7a6f98c03379b9513ca84cca1373ff452a7462a3b61598f0af5bb27ad7f76d1", "0x1e8480", "0x0"]}], "messages": []}], "events": [], "messages": []}, {"contract_address": "0x7a6f98c03379b9513ca84cca1373ff452a7462a3b61598f0af5bb27ad7f76d1", "entry_point_selector": "0x2c0f7bf2d6cf5304c29171bf493feb222fef84bdaf17805a6574b0c2e8bcc87", "calldata": ["0x1e8480", "0x0", "0x0", "0x0", "0x2", "0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "0x648f780a"], "caller_address": "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "class_hash": "0x514718bb56ed2a8607554c7d393c2ffd73cbab971c120b00a2ce27cc58dd1c1", "entry_point_type": "EXTERNAL", "call_type": "CALL", "result": ["0x2", "0x1e8480", "0x0", "0x417c36e4fc16d", "0x0"], "calls": [{"contract_address": "0x23c72abdf49dffc85ae3ede714f2168ad384cc67d08524732acea90df325", "entry_point_selector": "0x3c388f7eb137a89061c6f0b6e78bae453202258b0b3c419f8dd9814a547d406", "calldata": [], "caller_address": "0x7a6f98c03379b9513ca84cca1373ff452a7462a3b61598f0af5bb27ad7f76d1", "class_hash": "0x231adde42526bad434ca2eb983efdd64472638702f87f97e6e3c084f264e06f", "entry_point_type": "EXTERNAL", "call_type": "CALL", "result": ["0x178b60b3a0bcc4aa98", "0xaf07589b7c", "0x648f7422"], "calls": [], "events": [], "messages": []}, {"contract_address": "0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "entry_point_selector": "0x41b033f4a31df8067c24d1e9b550a2ce75fd4a29e1147af9752174f0e6cb20", "calldata": ["0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "0x23c72abdf49dffc85ae3ede714f2168ad384cc67d08524732acea90df325", "0x1e8480", "0x0"], "caller_address": "0x7a6f98c03379b9513ca84cca1373ff452a7462a3b61598f0af5bb27ad7f76d1", "class_hash": "0x52c7ba99c77fc38dd3346beea6c0753c3471f2e3135af5bb837d6c9523fff62", "entry_point_type": "EXTERNAL", "call_type": "CALL", "result": ["0x1"], "calls": [{"contract_address": "0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "entry_point_selector": "0x41b033f4a31df8067c24d1e9b550a2ce75fd4a29e1147af9752174f0e6cb20", "calldata": ["0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "0x23c72abdf49dffc85ae3ede714f2168ad384cc67d08524732acea90df325", "0x1e8480", "0x0"], "caller_address": "0x7a6f98c03379b9513ca84cca1373ff452a7462a3b61598f0af5bb27ad7f76d1", "class_hash": "0x2760f25d5a4fb2bdde5f561fd0b44a3dee78c28903577d37d669939d97036a0", "entry_point_type": "EXTERNAL", "call_type": "DELEGATE", "result": ["0x1"], "calls": [], "events": [{"keys": ["0x99cd8bde557814842a3121e8ddfd433a539b8c9f14bf31ebf108d12e6196e9"], "data": ["0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "0x23c72abdf49dffc85ae3ede714f2168ad384cc67d08524732acea90df325", "0x1e8480", "0x0"]}], "messages": []}], "events": [], "messages": []}, {"contract_address": "0x23c72abdf49dffc85ae3ede714f2168ad384cc67d08524732acea90df325", "entry_point_selector": "0x15543c3708653cda9d418b4ccd3be11368e40636c10c44b18cfe756b6d88b29", "calldata": ["0x417c36e4fc16d", "0x0", "0x0", "0x0", "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f"], "caller_address": "0x7a6f98c03379b9513ca84cca1373ff452a7462a3b61598f0af5bb27ad7f76d1", "class_hash": "0x231adde42526bad434ca2eb983efdd64472638702f87f97e6e3c084f264e06f", "entry_point_type": "EXTERNAL", "call_type": "CALL", "result": [], "calls": [{"contract_address": "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "entry_point_selector": "0x83afd3f4caedc6eebf44246fe54e38c95e3179a5ec9ea81740eca5b482d12e", "calldata": ["0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "0x417c36e4fc16d", "0x0"], "caller_address": "0x23c72abdf49dffc85ae3ede714f2168ad384cc67d08524732acea90df325", "class_hash": "0xd0e183745e9dae3e4e78a8ffedcce0903fc4900beace4e0abf192d4c202da3", "entry_point_type": "EXTERNAL", "call_type": "CALL", "result": ["0x1"], "calls": [{"contract_address": "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "entry_point_selector": "0x83afd3f4caedc6eebf44246fe54e38c95e3179a5ec9ea81740eca5b482d12e", "calldata": ["0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "0x417c36e4fc16d", "0x0"], "caller_address": "0x23c72abdf49dffc85ae3ede714f2168ad384cc67d08524732acea90df325", "class_hash": "0x2760f25d5a4fb2bdde5f561fd0b44a3dee78c28903577d37d669939d97036a0", "entry_point_type": "EXTERNAL", "call_type": "DELEGATE", "result": ["0x1"], "calls": [], "events": [{"keys": ["0x99cd8bde557814842a3121e8ddfd433a539b8c9f14bf31ebf108d12e6196e9"], "data": ["0x23c72abdf49dffc85ae3ede714f2168ad384cc67d08524732acea90df325", "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "0x417c36e4fc16d", "0x0"]}], "messages": []}], "events": [], "messages": []}, {"contract_address": "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "entry_point_selector": "0x2e4263afad30923c891518314c3c95dbe830a16874e8abc5777a9a20b54c76e", "calldata": ["0x23c72abdf49dffc85ae3ede714f2168ad384cc67d08524732acea90df325"], "caller_address": "0x23c72abdf49dffc85ae3ede714f2168ad384cc67d08524732acea90df325", "class_hash": "0xd0e183745e9dae3e4e78a8ffedcce0903fc4900beace4e0abf192d4c202da3", "entry_point_type": "EXTERNAL", "call_type": "CALL", "result": ["0x178b5c9bdd4e74e92b", "0x0"], "calls": [{"contract_address": "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "entry_point_selector": "0x2e4263afad30923c891518314c3c95dbe830a16874e8abc5777a9a20b54c76e", "calldata": ["0x23c72abdf49dffc85ae3ede714f2168ad384cc67d08524732acea90df325"], "caller_address": "0x23c72abdf49dffc85ae3ede714f2168ad384cc67d08524732acea90df325", "class_hash": "0x2760f25d5a4fb2bdde5f561fd0b44a3dee78c28903577d37d669939d97036a0", "entry_point_type": "EXTERNAL", "call_type": "DELEGATE", "result": ["0x178b5c9bdd4e74e92b", "0x0"], "calls": [], "events": [], "messages": []}], "events": [], "messages": []}, {"contract_address": "0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "entry_point_selector": "0x2e4263afad30923c891518314c3c95dbe830a16874e8abc5777a9a20b54c76e", "calldata": ["0x23c72abdf49dffc85ae3ede714f2168ad384cc67d08524732acea90df325"], "caller_address": "0x23c72abdf49dffc85ae3ede714f2168ad384cc67d08524732acea90df325", "class_hash": "0x52c7ba99c77fc38dd3346beea6c0753c3471f2e3135af5bb837d6c9523fff62", "entry_point_type": "EXTERNAL", "call_type": "CALL", "result": ["0xaf07771ffc", "0x0"], "calls": [{"contract_address": "0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "entry_point_selector": "0x2e4263afad30923c891518314c3c95dbe830a16874e8abc5777a9a20b54c76e", "calldata": ["0x23c72abdf49dffc85ae3ede714f2168ad384cc67d08524732acea90df325"], "caller_address": "0x23c72abdf49dffc85ae3ede714f2168ad384cc67d08524732acea90df325", "class_hash": "0x2760f25d5a4fb2bdde5f561fd0b44a3dee78c28903577d37d669939d97036a0", "entry_point_type": "EXTERNAL", "call_type": "DELEGATE", "result": ["0xaf07771ffc", "0x0"], "calls": [], "events": [], "messages": []}], "events": [], "messages": []}], "events": [{"keys": ["0xe14a408baf7f453312eec68e9b7d728ec5337fbdf671f917ee8c80f3255232"], "data": ["0x178b5c9bdd4e74e92b", "0xaf07771ffc"]}, {"keys": ["0xe316f0d9d2a3affa97de1d99bb2aac0538e2666d0d8545545ead241ef0ccab"], "data": ["0x7a6f98c03379b9513ca84cca1373ff452a7462a3b61598f0af5bb27ad7f76d1", "0x0", "0x0", "0x1e8480", "0x0", "0x417c36e4fc16d", "0x0", "0x0", "0x0", "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f"]}], "messages": []}], "events": [], "messages": []}], "events": [], "messages": []}, {"contract_address": "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "entry_point_selector": "0x2e4263afad30923c891518314c3c95dbe830a16874e8abc5777a9a20b54c76e", "calldata": ["0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f"], "caller_address": "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "class_hash": "0xd0e183745e9dae3e4e78a8ffedcce0903fc4900beace4e0abf192d4c202da3", "entry_point_type": "EXTERNAL", "call_type": "CALL", "result": ["0x417c36e4fc16d", "0x0"], "calls": [{"contract_address": "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "entry_point_selector": "0x2e4263afad30923c891518314c3c95dbe830a16874e8abc5777a9a20b54c76e", "calldata": ["0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f"], "caller_address": "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "class_hash": "0x2760f25d5a4fb2bdde5f561fd0b44a3dee78c28903577d37d669939d97036a0", "entry_point_type": "EXTERNAL", "call_type": "DELEGATE", "result": ["0x417c36e4fc16d", "0x0"], "calls": [], "events": [], "messages": []}], "events": [], "messages": []}, {"contract_address": "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "entry_point_selector": "0x83afd3f4caedc6eebf44246fe54e38c95e3179a5ec9ea81740eca5b482d12e", "calldata": ["0xd747220b2744d8d8d48c8a52bd3869fb98aea915665ab2485d5eadb49def6a", "0x417c36e4fc16d", "0x0"], "caller_address": "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "class_hash": "0xd0e183745e9dae3e4e78a8ffedcce0903fc4900beace4e0abf192d4c202da3", "entry_point_type": "EXTERNAL", "call_type": "CALL", "result": ["0x1"], "calls": [{"contract_address": "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "entry_point_selector": "0x83afd3f4caedc6eebf44246fe54e38c95e3179a5ec9ea81740eca5b482d12e", "calldata": ["0xd747220b2744d8d8d48c8a52bd3869fb98aea915665ab2485d5eadb49def6a", "0x417c36e4fc16d", "0x0"], "caller_address": "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "class_hash": "0x2760f25d5a4fb2bdde5f561fd0b44a3dee78c28903577d37d669939d97036a0", "entry_point_type": "EXTERNAL", "call_type": "DELEGATE", "result": ["0x1"], "calls": [], "events": [{"keys": ["0x99cd8bde557814842a3121e8ddfd433a539b8c9f14bf31ebf108d12e6196e9"], "data": ["0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "0xd747220b2744d8d8d48c8a52bd3869fb98aea915665ab2485d5eadb49def6a", "0x417c36e4fc16d", "0x0"]}], "messages": []}], "events": [], "messages": []}], "events": [{"keys": ["0xe316f0d9d2a3affa97de1d99bb2aac0538e2666d0d8545545ead241ef0ccab"], "data": ["0xd747220b2744d8d8d48c8a52bd3869fb98aea915665ab2485d5eadb49def6a", "0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "0x1e8480", "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "0x417c36e4fc16d", "0xd747220b2744d8d8d48c8a52bd3869fb98aea915665ab2485d5eadb49def6a"]}], "messages": []}], "events": [], "messages": []}], "events": [{"keys": ["0x5ad857f66a5b55f1301ff1ed7e098ac6d4433148f0b72ebc4a2945ab85ad53"], "data": ["0x2fc5e96de394697c1311606c96ec14840e408493fd42cf0c54b73b39d312b81", "0x2", "0x1", "0x1"]}], "messages": []}], "events": [], "messages": []}, - "fee_transfer_invocation": {"contract_address": "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "entry_point_selector": "0x83afd3f4caedc6eebf44246fe54e38c95e3179a5ec9ea81740eca5b482d12e", "calldata": ["0x1176a1bd84444c89232ec27754698e5d2e7e1a7f1539f12027f28b23ec9f3d8", "0x2cb6", "0x0"], "caller_address": "0xd747220b2744d8d8d48c8a52bd3869fb98aea915665ab2485d5eadb49def6a", "class_hash": "0xd0e183745e9dae3e4e78a8ffedcce0903fc4900beace4e0abf192d4c202da3", "entry_point_type": "EXTERNAL", "call_type": "CALL", "result": ["0x1"], "calls": [{"contract_address": "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "entry_point_selector": "0x83afd3f4caedc6eebf44246fe54e38c95e3179a5ec9ea81740eca5b482d12e", "calldata": ["0x1176a1bd84444c89232ec27754698e5d2e7e1a7f1539f12027f28b23ec9f3d8", "0x2cb6", "0x0"], "caller_address": "0xd747220b2744d8d8d48c8a52bd3869fb98aea915665ab2485d5eadb49def6a", "class_hash": "0x2760f25d5a4fb2bdde5f561fd0b44a3dee78c28903577d37d669939d97036a0", "entry_point_type": "EXTERNAL", "call_type": "DELEGATE", "result": ["0x1"], "calls": [], "events": [{"keys": ["0x99cd8bde557814842a3121e8ddfd433a539b8c9f14bf31ebf108d12e6196e9"], "data": ["0xd747220b2744d8d8d48c8a52bd3869fb98aea915665ab2485d5eadb49def6a", "0x1176a1bd84444c89232ec27754698e5d2e7e1a7f1539f12027f28b23ec9f3d8", "0x2cb6", "0x0"]}], "messages": []}], "events": [], "messages": []}, - "state_diff": { - "storage_diffs": [], - "nonces": [], - "deployed_contracts": [], - "deprecated_declared_classes": [], - "declared_classes": [], - "replaced_classes": [] - } - }`) - vmTrace := new(vm.TransactionTrace) - stepsUsed := uint64(123) - stepsUsedStr := "123" - require.NoError(t, json.Unmarshal(vmTraceJSON, vmTrace)) - mockVM.EXPECT().Execute([]core.Transaction{tx}, []core.Class{declaredClass.Class}, []*felt.Felt{}, - &vm.BlockInfo{Header: header}, gomock.Any(), &utils.Mainnet, false, false, false, false). - Return(nil, nil, []vm.TransactionTrace{*vmTrace}, stepsUsed, nil) - - trace, httpHeader, err := handler.TraceTransactionV0_6(context.Background(), *hash) - require.Nil(t, err) - assert.Equal(t, httpHeader.Get(rpc.ExecutionStepsHeader), stepsUsedStr) - assert.Equal(t, vmTrace, trace) - }) - t.Run("pending block", func(t *testing.T) { - hash := utils.HexToFelt(t, "0xceb6a374aff2bbb3537cf35f50df8634b2354a21") - tx := &core.DeclareTransaction{ - TransactionHash: hash, - ClassHash: utils.HexToFelt(t, "0x000000000"), - } - - header := &core.Header{ - ParentHash: utils.HexToFelt(t, "0x0"), - SequencerAddress: utils.HexToFelt(t, "0X111"), - ProtocolVersion: "99.12.3", - } - require.Nil(t, header.Hash, "hash must be nil for pending block") - - block := &core.Block{ - Header: header, - Transactions: []core.Transaction{tx}, - } - declaredClass := &core.DeclaredClass{ - At: 3002, - Class: &core.Cairo1Class{}, - } - - mockReader.EXPECT().Receipt(hash).Return(nil, header.Hash, header.Number, nil) - mockReader.EXPECT().Pending().Return(blockchain.Pending{ - Block: block, - }, nil) - - mockReader.EXPECT().StateAtBlockHash(header.ParentHash).Return(nil, nopCloser, nil) - headState := mocks.NewMockStateHistoryReader(mockCtrl) - headState.EXPECT().Class(tx.ClassHash).Return(declaredClass, nil) - mockReader.EXPECT().PendingState().Return(headState, nopCloser, nil) - - vmTraceJSON := json.RawMessage(`{ - "validate_invocation": {"contract_address": "0xd747220b2744d8d8d48c8a52bd3869fb98aea915665ab2485d5eadb49def6a", "entry_point_selector": "0x162da33a4585851fe8d3af3c2a9c60b557814e221e0d4f30ff0b2189d9c7775", "calldata": ["0x2", "0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "0x219209e083275171774dab1df80982e9df2096516f06319c5c6d71ae0a8480c", "0x0", "0x3", "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "0x1171593aa5bdadda4d6b0efde6cc94ee7649c3163d5efeb19da6c16d63a2a63", "0x3", "0x10", "0x13", "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "0x1e8480", "0x0", "0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "0x1e8480", "0x0", "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "0x420eeb770f7a4", "0x0", "0x40139799e37e4", "0x0", "0xd747220b2744d8d8d48c8a52bd3869fb98aea915665ab2485d5eadb49def6a", "0x0", "0x0", "0x1", "0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "0x7a6f98c03379b9513ca84cca1373ff452a7462a3b61598f0af5bb27ad7f76d1", "0x64"], "caller_address": "0x0", "class_hash": "0x25ec026985a3bf9d0cc1fe17326b245dfdc3ff89b8fde106542a3ea56c5a918", "entry_point_type": "EXTERNAL", "call_type": "CALL", "result": [], "calls": [{"contract_address": "0xd747220b2744d8d8d48c8a52bd3869fb98aea915665ab2485d5eadb49def6a", "entry_point_selector": "0x162da33a4585851fe8d3af3c2a9c60b557814e221e0d4f30ff0b2189d9c7775", "calldata": ["0x2", "0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "0x219209e083275171774dab1df80982e9df2096516f06319c5c6d71ae0a8480c", "0x0", "0x3", "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "0x1171593aa5bdadda4d6b0efde6cc94ee7649c3163d5efeb19da6c16d63a2a63", "0x3", "0x10", "0x13", "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "0x1e8480", "0x0", "0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "0x1e8480", "0x0", "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "0x420eeb770f7a4", "0x0", "0x40139799e37e4", "0x0", "0xd747220b2744d8d8d48c8a52bd3869fb98aea915665ab2485d5eadb49def6a", "0x0", "0x0", "0x1", "0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "0x7a6f98c03379b9513ca84cca1373ff452a7462a3b61598f0af5bb27ad7f76d1", "0x64"], "caller_address": "0x0", "class_hash": "0x33434ad846cdd5f23eb73ff09fe6fddd568284a0fb7d1be20ee482f044dabe2", "entry_point_type": "EXTERNAL", "call_type": "DELEGATE", "result": [], "calls": [], "events": [], "messages": []}], "events": [], "messages": []}, - "execute_invocation": {"contract_address": "0xd747220b2744d8d8d48c8a52bd3869fb98aea915665ab2485d5eadb49def6a", "entry_point_selector": "0x15d40a3d6ca2ac30f4031e42be28da9b056fef9bb7357ac5e85627ee876e5ad", "calldata": ["0x2", "0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "0x219209e083275171774dab1df80982e9df2096516f06319c5c6d71ae0a8480c", "0x0", "0x3", "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "0x1171593aa5bdadda4d6b0efde6cc94ee7649c3163d5efeb19da6c16d63a2a63", "0x3", "0x10", "0x13", "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "0x1e8480", "0x0", "0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "0x1e8480", "0x0", "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "0x420eeb770f7a4", "0x0", "0x40139799e37e4", "0x0", "0xd747220b2744d8d8d48c8a52bd3869fb98aea915665ab2485d5eadb49def6a", "0x0", "0x0", "0x1", "0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "0x7a6f98c03379b9513ca84cca1373ff452a7462a3b61598f0af5bb27ad7f76d1", "0x64"], "caller_address": "0x0", "class_hash": "0x25ec026985a3bf9d0cc1fe17326b245dfdc3ff89b8fde106542a3ea56c5a918", "entry_point_type": "EXTERNAL", "call_type": "CALL", "result": ["0x1", "0x1"], "calls": [{"contract_address": "0xd747220b2744d8d8d48c8a52bd3869fb98aea915665ab2485d5eadb49def6a", "entry_point_selector": "0x15d40a3d6ca2ac30f4031e42be28da9b056fef9bb7357ac5e85627ee876e5ad", "calldata": ["0x2", "0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "0x219209e083275171774dab1df80982e9df2096516f06319c5c6d71ae0a8480c", "0x0", "0x3", "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "0x1171593aa5bdadda4d6b0efde6cc94ee7649c3163d5efeb19da6c16d63a2a63", "0x3", "0x10", "0x13", "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "0x1e8480", "0x0", "0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "0x1e8480", "0x0", "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "0x420eeb770f7a4", "0x0", "0x40139799e37e4", "0x0", "0xd747220b2744d8d8d48c8a52bd3869fb98aea915665ab2485d5eadb49def6a", "0x0", "0x0", "0x1", "0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "0x7a6f98c03379b9513ca84cca1373ff452a7462a3b61598f0af5bb27ad7f76d1", "0x64"], "caller_address": "0x0", "class_hash": "0x33434ad846cdd5f23eb73ff09fe6fddd568284a0fb7d1be20ee482f044dabe2", "entry_point_type": "EXTERNAL", "call_type": "DELEGATE", "result": ["0x1", "0x1"], "calls": [{"contract_address": "0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "entry_point_selector": "0x219209e083275171774dab1df80982e9df2096516f06319c5c6d71ae0a8480c", "calldata": ["0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "0x1e8480", "0x0"], "caller_address": "0xd747220b2744d8d8d48c8a52bd3869fb98aea915665ab2485d5eadb49def6a", "class_hash": "0x52c7ba99c77fc38dd3346beea6c0753c3471f2e3135af5bb837d6c9523fff62", "entry_point_type": "EXTERNAL", "call_type": "CALL", "result": ["0x1"], "calls": [{"contract_address": "0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "entry_point_selector": "0x219209e083275171774dab1df80982e9df2096516f06319c5c6d71ae0a8480c", "calldata": ["0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "0x1e8480", "0x0"], "caller_address": "0xd747220b2744d8d8d48c8a52bd3869fb98aea915665ab2485d5eadb49def6a", "class_hash": "0x2760f25d5a4fb2bdde5f561fd0b44a3dee78c28903577d37d669939d97036a0", "entry_point_type": "EXTERNAL", "call_type": "DELEGATE", "result": ["0x1"], "calls": [], "events": [{"keys": ["0x134692b230b9e1ffa39098904722134159652b09c5bc41d88d6698779d228ff"], "data": ["0xd747220b2744d8d8d48c8a52bd3869fb98aea915665ab2485d5eadb49def6a", "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "0x1e8480", "0x0"]}], "messages": []}], "events": [], "messages": []}, {"contract_address": "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "entry_point_selector": "0x1171593aa5bdadda4d6b0efde6cc94ee7649c3163d5efeb19da6c16d63a2a63", "calldata": ["0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "0x1e8480", "0x0", "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "0x420eeb770f7a4", "0x0", "0x40139799e37e4", "0x0", "0xd747220b2744d8d8d48c8a52bd3869fb98aea915665ab2485d5eadb49def6a", "0x0", "0x0", "0x1", "0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "0x7a6f98c03379b9513ca84cca1373ff452a7462a3b61598f0af5bb27ad7f76d1", "0x64"], "caller_address": "0xd747220b2744d8d8d48c8a52bd3869fb98aea915665ab2485d5eadb49def6a", "class_hash": "0x5ee939756c1a60b029c594da00e637bf5923bf04a86ff163e877e899c0840eb", "entry_point_type": "EXTERNAL", "call_type": "CALL", "result": ["0x1"], "calls": [{"contract_address": "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "entry_point_selector": "0x1171593aa5bdadda4d6b0efde6cc94ee7649c3163d5efeb19da6c16d63a2a63", "calldata": ["0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "0x1e8480", "0x0", "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "0x420eeb770f7a4", "0x0", "0x40139799e37e4", "0x0", "0xd747220b2744d8d8d48c8a52bd3869fb98aea915665ab2485d5eadb49def6a", "0x0", "0x0", "0x1", "0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "0x7a6f98c03379b9513ca84cca1373ff452a7462a3b61598f0af5bb27ad7f76d1", "0x64"], "caller_address": "0xd747220b2744d8d8d48c8a52bd3869fb98aea915665ab2485d5eadb49def6a", "class_hash": "0x38627c278c0b3cb3c84ddee2c783fb22c3c3a3f0e667ea2b82be0ea2253bce4", "entry_point_type": "EXTERNAL", "call_type": "DELEGATE", "result": ["0x1"], "calls": [{"contract_address": "0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "entry_point_selector": "0x41b033f4a31df8067c24d1e9b550a2ce75fd4a29e1147af9752174f0e6cb20", "calldata": ["0xd747220b2744d8d8d48c8a52bd3869fb98aea915665ab2485d5eadb49def6a", "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "0x1e8480", "0x0"], "caller_address": "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "class_hash": "0x52c7ba99c77fc38dd3346beea6c0753c3471f2e3135af5bb837d6c9523fff62", "entry_point_type": "EXTERNAL", "call_type": "CALL", "result": ["0x1"], "calls": [{"contract_address": "0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "entry_point_selector": "0x41b033f4a31df8067c24d1e9b550a2ce75fd4a29e1147af9752174f0e6cb20", "calldata": ["0xd747220b2744d8d8d48c8a52bd3869fb98aea915665ab2485d5eadb49def6a", "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "0x1e8480", "0x0"], "caller_address": "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "class_hash": "0x2760f25d5a4fb2bdde5f561fd0b44a3dee78c28903577d37d669939d97036a0", "entry_point_type": "EXTERNAL", "call_type": "DELEGATE", "result": ["0x1"], "calls": [], "events": [{"keys": ["0x99cd8bde557814842a3121e8ddfd433a539b8c9f14bf31ebf108d12e6196e9"], "data": ["0xd747220b2744d8d8d48c8a52bd3869fb98aea915665ab2485d5eadb49def6a", "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "0x1e8480", "0x0"]}], "messages": []}], "events": [], "messages": []}, {"contract_address": "0x1ed6790cdca923073adc728080b06c159d9784cc9bf8fb26181acfdbe4256e6", "entry_point_selector": "0x260bb04cf90403013190e77d7e75f3d40d3d307180364da33c63ff53061d4e8", "calldata": [], "caller_address": "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "class_hash": "0x5ee939756c1a60b029c594da00e637bf5923bf04a86ff163e877e899c0840eb", "entry_point_type": "EXTERNAL", "call_type": "CALL", "result": ["0x0", "0x0", "0x5"], "calls": [{"contract_address": "0x1ed6790cdca923073adc728080b06c159d9784cc9bf8fb26181acfdbe4256e6", "entry_point_selector": "0x260bb04cf90403013190e77d7e75f3d40d3d307180364da33c63ff53061d4e8", "calldata": [], "caller_address": "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "class_hash": "0x46668cd07d83af5d7158e7cd62c710f1a7573501bcd4f4092c6a4e1ecd2bf61", "entry_point_type": "EXTERNAL", "call_type": "DELEGATE", "result": ["0x0", "0x0", "0x5"], "calls": [], "events": [], "messages": []}], "events": [], "messages": []}, {"contract_address": "0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "entry_point_selector": "0x2e4263afad30923c891518314c3c95dbe830a16874e8abc5777a9a20b54c76e", "calldata": ["0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f"], "caller_address": "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "class_hash": "0x52c7ba99c77fc38dd3346beea6c0753c3471f2e3135af5bb837d6c9523fff62", "entry_point_type": "EXTERNAL", "call_type": "CALL", "result": ["0x1e8480", "0x0"], "calls": [{"contract_address": "0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "entry_point_selector": "0x2e4263afad30923c891518314c3c95dbe830a16874e8abc5777a9a20b54c76e", "calldata": ["0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f"], "caller_address": "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "class_hash": "0x2760f25d5a4fb2bdde5f561fd0b44a3dee78c28903577d37d669939d97036a0", "entry_point_type": "EXTERNAL", "call_type": "DELEGATE", "result": ["0x1e8480", "0x0"], "calls": [], "events": [], "messages": []}], "events": [], "messages": []}, {"contract_address": "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "entry_point_selector": "0x15543c3708653cda9d418b4ccd3be11368e40636c10c44b18cfe756b6d88b29", "calldata": ["0x7a6f98c03379b9513ca84cca1373ff452a7462a3b61598f0af5bb27ad7f76d1", "0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "0x1e8480", "0x0", "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "0x0", "0x0", "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f"], "caller_address": "0xd747220b2744d8d8d48c8a52bd3869fb98aea915665ab2485d5eadb49def6a", "class_hash": "0x2ceb6369dba6af865bca639f9f1342dfb1ae4e5d0d0723de98028b812e7cdd2", "entry_point_type": "EXTERNAL", "call_type": "DELEGATE", "result": [], "calls": [{"contract_address": "0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "entry_point_selector": "0x219209e083275171774dab1df80982e9df2096516f06319c5c6d71ae0a8480c", "calldata": ["0x7a6f98c03379b9513ca84cca1373ff452a7462a3b61598f0af5bb27ad7f76d1", "0x1e8480", "0x0"], "caller_address": "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "class_hash": "0x52c7ba99c77fc38dd3346beea6c0753c3471f2e3135af5bb837d6c9523fff62", "entry_point_type": "EXTERNAL", "call_type": "CALL", "result": ["0x1"], "calls": [{"contract_address": "0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "entry_point_selector": "0x219209e083275171774dab1df80982e9df2096516f06319c5c6d71ae0a8480c", "calldata": ["0x7a6f98c03379b9513ca84cca1373ff452a7462a3b61598f0af5bb27ad7f76d1", "0x1e8480", "0x0"], "caller_address": "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "class_hash": "0x2760f25d5a4fb2bdde5f561fd0b44a3dee78c28903577d37d669939d97036a0", "entry_point_type": "EXTERNAL", "call_type": "DELEGATE", "result": ["0x1"], "calls": [], "events": [{"keys": ["0x134692b230b9e1ffa39098904722134159652b09c5bc41d88d6698779d228ff"], "data": ["0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "0x7a6f98c03379b9513ca84cca1373ff452a7462a3b61598f0af5bb27ad7f76d1", "0x1e8480", "0x0"]}], "messages": []}], "events": [], "messages": []}, {"contract_address": "0x7a6f98c03379b9513ca84cca1373ff452a7462a3b61598f0af5bb27ad7f76d1", "entry_point_selector": "0x2c0f7bf2d6cf5304c29171bf493feb222fef84bdaf17805a6574b0c2e8bcc87", "calldata": ["0x1e8480", "0x0", "0x0", "0x0", "0x2", "0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "0x648f780a"], "caller_address": "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "class_hash": "0x514718bb56ed2a8607554c7d393c2ffd73cbab971c120b00a2ce27cc58dd1c1", "entry_point_type": "EXTERNAL", "call_type": "CALL", "result": ["0x2", "0x1e8480", "0x0", "0x417c36e4fc16d", "0x0"], "calls": [{"contract_address": "0x23c72abdf49dffc85ae3ede714f2168ad384cc67d08524732acea90df325", "entry_point_selector": "0x3c388f7eb137a89061c6f0b6e78bae453202258b0b3c419f8dd9814a547d406", "calldata": [], "caller_address": "0x7a6f98c03379b9513ca84cca1373ff452a7462a3b61598f0af5bb27ad7f76d1", "class_hash": "0x231adde42526bad434ca2eb983efdd64472638702f87f97e6e3c084f264e06f", "entry_point_type": "EXTERNAL", "call_type": "CALL", "result": ["0x178b60b3a0bcc4aa98", "0xaf07589b7c", "0x648f7422"], "calls": [], "events": [], "messages": []}, {"contract_address": "0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "entry_point_selector": "0x41b033f4a31df8067c24d1e9b550a2ce75fd4a29e1147af9752174f0e6cb20", "calldata": ["0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "0x23c72abdf49dffc85ae3ede714f2168ad384cc67d08524732acea90df325", "0x1e8480", "0x0"], "caller_address": "0x7a6f98c03379b9513ca84cca1373ff452a7462a3b61598f0af5bb27ad7f76d1", "class_hash": "0x52c7ba99c77fc38dd3346beea6c0753c3471f2e3135af5bb837d6c9523fff62", "entry_point_type": "EXTERNAL", "call_type": "CALL", "result": ["0x1"], "calls": [{"contract_address": "0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "entry_point_selector": "0x41b033f4a31df8067c24d1e9b550a2ce75fd4a29e1147af9752174f0e6cb20", "calldata": ["0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "0x23c72abdf49dffc85ae3ede714f2168ad384cc67d08524732acea90df325", "0x1e8480", "0x0"], "caller_address": "0x7a6f98c03379b9513ca84cca1373ff452a7462a3b61598f0af5bb27ad7f76d1", "class_hash": "0x2760f25d5a4fb2bdde5f561fd0b44a3dee78c28903577d37d669939d97036a0", "entry_point_type": "EXTERNAL", "call_type": "DELEGATE", "result": ["0x1"], "calls": [], "events": [{"keys": ["0x99cd8bde557814842a3121e8ddfd433a539b8c9f14bf31ebf108d12e6196e9"], "data": ["0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "0x23c72abdf49dffc85ae3ede714f2168ad384cc67d08524732acea90df325", "0x1e8480", "0x0"]}], "messages": []}], "events": [], "messages": []}, {"contract_address": "0x23c72abdf49dffc85ae3ede714f2168ad384cc67d08524732acea90df325", "entry_point_selector": "0x15543c3708653cda9d418b4ccd3be11368e40636c10c44b18cfe756b6d88b29", "calldata": ["0x417c36e4fc16d", "0x0", "0x0", "0x0", "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f"], "caller_address": "0x7a6f98c03379b9513ca84cca1373ff452a7462a3b61598f0af5bb27ad7f76d1", "class_hash": "0x231adde42526bad434ca2eb983efdd64472638702f87f97e6e3c084f264e06f", "entry_point_type": "EXTERNAL", "call_type": "CALL", "result": [], "calls": [{"contract_address": "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "entry_point_selector": "0x83afd3f4caedc6eebf44246fe54e38c95e3179a5ec9ea81740eca5b482d12e", "calldata": ["0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "0x417c36e4fc16d", "0x0"], "caller_address": "0x23c72abdf49dffc85ae3ede714f2168ad384cc67d08524732acea90df325", "class_hash": "0xd0e183745e9dae3e4e78a8ffedcce0903fc4900beace4e0abf192d4c202da3", "entry_point_type": "EXTERNAL", "call_type": "CALL", "result": ["0x1"], "calls": [{"contract_address": "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "entry_point_selector": "0x83afd3f4caedc6eebf44246fe54e38c95e3179a5ec9ea81740eca5b482d12e", "calldata": ["0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "0x417c36e4fc16d", "0x0"], "caller_address": "0x23c72abdf49dffc85ae3ede714f2168ad384cc67d08524732acea90df325", "class_hash": "0x2760f25d5a4fb2bdde5f561fd0b44a3dee78c28903577d37d669939d97036a0", "entry_point_type": "EXTERNAL", "call_type": "DELEGATE", "result": ["0x1"], "calls": [], "events": [{"keys": ["0x99cd8bde557814842a3121e8ddfd433a539b8c9f14bf31ebf108d12e6196e9"], "data": ["0x23c72abdf49dffc85ae3ede714f2168ad384cc67d08524732acea90df325", "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "0x417c36e4fc16d", "0x0"]}], "messages": []}], "events": [], "messages": []}, {"contract_address": "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "entry_point_selector": "0x2e4263afad30923c891518314c3c95dbe830a16874e8abc5777a9a20b54c76e", "calldata": ["0x23c72abdf49dffc85ae3ede714f2168ad384cc67d08524732acea90df325"], "caller_address": "0x23c72abdf49dffc85ae3ede714f2168ad384cc67d08524732acea90df325", "class_hash": "0xd0e183745e9dae3e4e78a8ffedcce0903fc4900beace4e0abf192d4c202da3", "entry_point_type": "EXTERNAL", "call_type": "CALL", "result": ["0x178b5c9bdd4e74e92b", "0x0"], "calls": [{"contract_address": "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "entry_point_selector": "0x2e4263afad30923c891518314c3c95dbe830a16874e8abc5777a9a20b54c76e", "calldata": ["0x23c72abdf49dffc85ae3ede714f2168ad384cc67d08524732acea90df325"], "caller_address": "0x23c72abdf49dffc85ae3ede714f2168ad384cc67d08524732acea90df325", "class_hash": "0x2760f25d5a4fb2bdde5f561fd0b44a3dee78c28903577d37d669939d97036a0", "entry_point_type": "EXTERNAL", "call_type": "DELEGATE", "result": ["0x178b5c9bdd4e74e92b", "0x0"], "calls": [], "events": [], "messages": []}], "events": [], "messages": []}, {"contract_address": "0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "entry_point_selector": "0x2e4263afad30923c891518314c3c95dbe830a16874e8abc5777a9a20b54c76e", "calldata": ["0x23c72abdf49dffc85ae3ede714f2168ad384cc67d08524732acea90df325"], "caller_address": "0x23c72abdf49dffc85ae3ede714f2168ad384cc67d08524732acea90df325", "class_hash": "0x52c7ba99c77fc38dd3346beea6c0753c3471f2e3135af5bb837d6c9523fff62", "entry_point_type": "EXTERNAL", "call_type": "CALL", "result": ["0xaf07771ffc", "0x0"], "calls": [{"contract_address": "0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "entry_point_selector": "0x2e4263afad30923c891518314c3c95dbe830a16874e8abc5777a9a20b54c76e", "calldata": ["0x23c72abdf49dffc85ae3ede714f2168ad384cc67d08524732acea90df325"], "caller_address": "0x23c72abdf49dffc85ae3ede714f2168ad384cc67d08524732acea90df325", "class_hash": "0x2760f25d5a4fb2bdde5f561fd0b44a3dee78c28903577d37d669939d97036a0", "entry_point_type": "EXTERNAL", "call_type": "DELEGATE", "result": ["0xaf07771ffc", "0x0"], "calls": [], "events": [], "messages": []}], "events": [], "messages": []}], "events": [{"keys": ["0xe14a408baf7f453312eec68e9b7d728ec5337fbdf671f917ee8c80f3255232"], "data": ["0x178b5c9bdd4e74e92b", "0xaf07771ffc"]}, {"keys": ["0xe316f0d9d2a3affa97de1d99bb2aac0538e2666d0d8545545ead241ef0ccab"], "data": ["0x7a6f98c03379b9513ca84cca1373ff452a7462a3b61598f0af5bb27ad7f76d1", "0x0", "0x0", "0x1e8480", "0x0", "0x417c36e4fc16d", "0x0", "0x0", "0x0", "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f"]}], "messages": []}], "events": [], "messages": []}], "events": [], "messages": []}, {"contract_address": "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "entry_point_selector": "0x2e4263afad30923c891518314c3c95dbe830a16874e8abc5777a9a20b54c76e", "calldata": ["0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f"], "caller_address": "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "class_hash": "0xd0e183745e9dae3e4e78a8ffedcce0903fc4900beace4e0abf192d4c202da3", "entry_point_type": "EXTERNAL", "call_type": "CALL", "result": ["0x417c36e4fc16d", "0x0"], "calls": [{"contract_address": "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "entry_point_selector": "0x2e4263afad30923c891518314c3c95dbe830a16874e8abc5777a9a20b54c76e", "calldata": ["0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f"], "caller_address": "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "class_hash": "0x2760f25d5a4fb2bdde5f561fd0b44a3dee78c28903577d37d669939d97036a0", "entry_point_type": "EXTERNAL", "call_type": "DELEGATE", "result": ["0x417c36e4fc16d", "0x0"], "calls": [], "events": [], "messages": []}], "events": [], "messages": []}, {"contract_address": "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "entry_point_selector": "0x83afd3f4caedc6eebf44246fe54e38c95e3179a5ec9ea81740eca5b482d12e", "calldata": ["0xd747220b2744d8d8d48c8a52bd3869fb98aea915665ab2485d5eadb49def6a", "0x417c36e4fc16d", "0x0"], "caller_address": "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "class_hash": "0xd0e183745e9dae3e4e78a8ffedcce0903fc4900beace4e0abf192d4c202da3", "entry_point_type": "EXTERNAL", "call_type": "CALL", "result": ["0x1"], "calls": [{"contract_address": "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "entry_point_selector": "0x83afd3f4caedc6eebf44246fe54e38c95e3179a5ec9ea81740eca5b482d12e", "calldata": ["0xd747220b2744d8d8d48c8a52bd3869fb98aea915665ab2485d5eadb49def6a", "0x417c36e4fc16d", "0x0"], "caller_address": "0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "class_hash": "0x2760f25d5a4fb2bdde5f561fd0b44a3dee78c28903577d37d669939d97036a0", "entry_point_type": "EXTERNAL", "call_type": "DELEGATE", "result": ["0x1"], "calls": [], "events": [{"keys": ["0x99cd8bde557814842a3121e8ddfd433a539b8c9f14bf31ebf108d12e6196e9"], "data": ["0x4270219d365d6b017231b52e92b3fb5d7c8378b05e9abc97724537a80e93b0f", "0xd747220b2744d8d8d48c8a52bd3869fb98aea915665ab2485d5eadb49def6a", "0x417c36e4fc16d", "0x0"]}], "messages": []}], "events": [], "messages": []}], "events": [{"keys": ["0xe316f0d9d2a3affa97de1d99bb2aac0538e2666d0d8545545ead241ef0ccab"], "data": ["0xd747220b2744d8d8d48c8a52bd3869fb98aea915665ab2485d5eadb49def6a", "0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8", "0x1e8480", "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "0x417c36e4fc16d", "0xd747220b2744d8d8d48c8a52bd3869fb98aea915665ab2485d5eadb49def6a"]}], "messages": []}], "events": [], "messages": []}], "events": [{"keys": ["0x5ad857f66a5b55f1301ff1ed7e098ac6d4433148f0b72ebc4a2945ab85ad53"], "data": ["0x2fc5e96de394697c1311606c96ec14840e408493fd42cf0c54b73b39d312b81", "0x2", "0x1", "0x1"]}], "messages": []}], "events": [], "messages": []}, - "fee_transfer_invocation": {"contract_address": "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "entry_point_selector": "0x83afd3f4caedc6eebf44246fe54e38c95e3179a5ec9ea81740eca5b482d12e", "calldata": ["0x1176a1bd84444c89232ec27754698e5d2e7e1a7f1539f12027f28b23ec9f3d8", "0x2cb6", "0x0"], "caller_address": "0xd747220b2744d8d8d48c8a52bd3869fb98aea915665ab2485d5eadb49def6a", "class_hash": "0xd0e183745e9dae3e4e78a8ffedcce0903fc4900beace4e0abf192d4c202da3", "entry_point_type": "EXTERNAL", "call_type": "CALL", "result": ["0x1"], "calls": [{"contract_address": "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", "entry_point_selector": "0x83afd3f4caedc6eebf44246fe54e38c95e3179a5ec9ea81740eca5b482d12e", "calldata": ["0x1176a1bd84444c89232ec27754698e5d2e7e1a7f1539f12027f28b23ec9f3d8", "0x2cb6", "0x0"], "caller_address": "0xd747220b2744d8d8d48c8a52bd3869fb98aea915665ab2485d5eadb49def6a", "class_hash": "0x2760f25d5a4fb2bdde5f561fd0b44a3dee78c28903577d37d669939d97036a0", "entry_point_type": "EXTERNAL", "call_type": "DELEGATE", "result": ["0x1"], "calls": [], "events": [{"keys": ["0x99cd8bde557814842a3121e8ddfd433a539b8c9f14bf31ebf108d12e6196e9"], "data": ["0xd747220b2744d8d8d48c8a52bd3869fb98aea915665ab2485d5eadb49def6a", "0x1176a1bd84444c89232ec27754698e5d2e7e1a7f1539f12027f28b23ec9f3d8", "0x2cb6", "0x0"]}], "messages": []}], "events": [], "messages": []}, - "state_diff": { - "storage_diffs": [], - "nonces": [], - "deployed_contracts": [], - "deprecated_declared_classes": [], - "declared_classes": [], - "replaced_classes": [] - } - }`) - vmTrace := new(vm.TransactionTrace) - stepsUsed := uint64(123) - stepsUsedStr := "123" - require.NoError(t, json.Unmarshal(vmTraceJSON, vmTrace)) - mockVM.EXPECT().Execute([]core.Transaction{tx}, []core.Class{declaredClass.Class}, []*felt.Felt{}, - &vm.BlockInfo{Header: header}, gomock.Any(), &utils.Mainnet, false, false, false, false). - Return(nil, nil, []vm.TransactionTrace{*vmTrace}, stepsUsed, nil) - - trace, httpHeader, err := handler.TraceTransactionV0_6(context.Background(), *hash) - require.Nil(t, err) - assert.Equal(t, httpHeader.Get(rpc.ExecutionStepsHeader), stepsUsedStr) - assert.Equal(t, vmTrace, trace) - }) -} - -func TestTraceBlockTransactionsV0_6(t *testing.T) { +func TestTraceBlockTransactions(t *testing.T) { errTests := map[string]rpc.BlockID{ "latest": {Latest: true}, "pending": {Pending: true}, @@ -474,9 +338,9 @@ func TestTraceBlockTransactionsV0_6(t *testing.T) { paidL1Fees := []*felt.Felt{(&felt.Felt{}).SetUint64(1)} vmTraceJSON := json.RawMessage(`{ - "validate_invocation": {}, - "execute_invocation": {}, - "fee_transfer_invocation": {}, + "validate_invocation": {"execution_resources":{}}, + "execute_invocation": {"execution_resources":{}}, + "fee_transfer_invocation": {"execution_resources":{}}, "state_diff": { "storage_diffs": [], "nonces": [], @@ -491,16 +355,21 @@ func TestTraceBlockTransactionsV0_6(t *testing.T) { stepsUsedStr := "123" require.NoError(t, json.Unmarshal(vmTraceJSON, &vmTrace)) mockVM.EXPECT().Execute(block.Transactions, []core.Class{declaredClass.Class}, paidL1Fees, &vm.BlockInfo{Header: header}, - gomock.Any(), n, false, false, false, false). - Return(nil, nil, []vm.TransactionTrace{vmTrace, vmTrace}, stepsUsed, nil) + gomock.Any(), n, false, false, false). + Return(nil, []core.GasConsumed{{}, {}}, []vm.TransactionTrace{vmTrace, vmTrace}, stepsUsed, nil) - result, httpHeader, err := handler.TraceBlockTransactionsV0_6(context.Background(), rpc.BlockID{Hash: blockHash}) + result, httpHeader, err := handler.TraceBlockTransactions(context.Background(), rpc.BlockID{Hash: blockHash}) require.Nil(t, err) assert.Equal(t, httpHeader.Get(rpc.ExecutionStepsHeader), stepsUsedStr) assert.Equal(t, &vm.TransactionTrace{ - ValidateInvocation: &vm.FunctionInvocation{}, - ExecuteInvocation: &vm.ExecuteInvocation{}, - FeeTransferInvocation: &vm.FunctionInvocation{}, + ValidateInvocation: &vm.FunctionInvocation{ExecutionResources: &vm.ExecutionResources{}}, + ExecuteInvocation: &vm.ExecuteInvocation{FunctionInvocation: &vm.FunctionInvocation{ + ExecutionResources: &vm.ExecutionResources{}, + }}, + FeeTransferInvocation: &vm.FunctionInvocation{ExecutionResources: &vm.ExecutionResources{}}, + ExecutionResources: &vm.ExecutionResources{ + DataAvailability: &vm.DataAvailability{}, + }, StateDiff: &vm.StateDiff{ StorageDiffs: []vm.StorageDiff{}, Nonces: []vm.Nonce{}, @@ -544,9 +413,10 @@ func TestTraceBlockTransactionsV0_6(t *testing.T) { mockReader.EXPECT().HeadState().Return(headState, nopCloser, nil) vmTraceJSON := json.RawMessage(`{ - "validate_invocation":{"entry_point_selector":"0x36fcbf06cd96843058359e1a75928beacfac10727dab22a3972f0af8aa92895","calldata":["0x25ec026985a3bf9d0cc1fe17326b245dfdc3ff89b8fde106542a3ea56c5a918","0x322258135d04971e96b747a5551061aa046ad5d8be11a35c67029d96b23f98","0x33434ad846cdd5f23eb73ff09fe6fddd568284a0fb7d1be20ee482f044dabe2","0x79dc0da7c54b95f10aa182ad0a46400db63156920adb65eca2654c0945a463","0x2","0x322258135d04971e96b747a5551061aa046ad5d8be11a35c67029d96b23f98","0x0"],"caller_address":"0x0","class_hash":"0x25ec026985a3bf9d0cc1fe17326b245dfdc3ff89b8fde106542a3ea56c5a918","entry_point_type":"EXTERNAL","call_type":"CALL","result":[],"calls":[{"entry_point_selector":"0x36fcbf06cd96843058359e1a75928beacfac10727dab22a3972f0af8aa92895","calldata":["0x25ec026985a3bf9d0cc1fe17326b245dfdc3ff89b8fde106542a3ea56c5a918","0x322258135d04971e96b747a5551061aa046ad5d8be11a35c67029d96b23f98","0x33434ad846cdd5f23eb73ff09fe6fddd568284a0fb7d1be20ee482f044dabe2","0x79dc0da7c54b95f10aa182ad0a46400db63156920adb65eca2654c0945a463","0x2","0x322258135d04971e96b747a5551061aa046ad5d8be11a35c67029d96b23f98","0x0"],"caller_address":"0x0","class_hash":"0x33434ad846cdd5f23eb73ff09fe6fddd568284a0fb7d1be20ee482f044dabe2","entry_point_type":"EXTERNAL","call_type":"DELEGATE","result":[],"calls":[],"events":[],"messages":[]}],"events":[],"messages":[]}, - "execute_invocation":{"entry_point_selector":"0x28ffe4ff0f226a9107253e17a904099aa4f63a02a5621de0576e5aa71bc5194","calldata":["0x33434ad846cdd5f23eb73ff09fe6fddd568284a0fb7d1be20ee482f044dabe2","0x79dc0da7c54b95f10aa182ad0a46400db63156920adb65eca2654c0945a463","0x2","0x322258135d04971e96b747a5551061aa046ad5d8be11a35c67029d96b23f98","0x0"],"caller_address":"0x0","class_hash":"0x25ec026985a3bf9d0cc1fe17326b245dfdc3ff89b8fde106542a3ea56c5a918","entry_point_type":"CONSTRUCTOR","call_type":"CALL","result":[],"calls":[{"entry_point_selector":"0x79dc0da7c54b95f10aa182ad0a46400db63156920adb65eca2654c0945a463","calldata":["0x322258135d04971e96b747a5551061aa046ad5d8be11a35c67029d96b23f98","0x0"],"caller_address":"0x0","class_hash":"0x33434ad846cdd5f23eb73ff09fe6fddd568284a0fb7d1be20ee482f044dabe2","entry_point_type":"EXTERNAL","call_type":"DELEGATE","result":[],"calls":[],"events":[{"keys":["0x10c19bef19acd19b2c9f4caa40fd47c9fbe1d9f91324d44dcd36be2dae96784"],"data":["0xdac9bcffb3d967f19a7fe21002c98c984d5a9458a88e6fc5d1c478a97ed412","0x322258135d04971e96b747a5551061aa046ad5d8be11a35c67029d96b23f98","0x0"]}],"messages":[]}],"events":[],"messages":[]}, - "fee_transfer_invocation":{"entry_point_selector":"0x83afd3f4caedc6eebf44246fe54e38c95e3179a5ec9ea81740eca5b482d12e","calldata":["0x5dcd266a80b8a5f29f04d779c6b166b80150c24f2180a75e82427242dab20a9","0x15be","0x0"],"caller_address":"0xdac9bcffb3d967f19a7fe21002c98c984d5a9458a88e6fc5d1c478a97ed412","class_hash":"0xd0e183745e9dae3e4e78a8ffedcce0903fc4900beace4e0abf192d4c202da3","entry_point_type":"EXTERNAL","call_type":"CALL","result":["0x1"],"calls":[{"entry_point_selector":"0x83afd3f4caedc6eebf44246fe54e38c95e3179a5ec9ea81740eca5b482d12e","calldata":["0x5dcd266a80b8a5f29f04d779c6b166b80150c24f2180a75e82427242dab20a9","0x15be","0x0"],"caller_address":"0xdac9bcffb3d967f19a7fe21002c98c984d5a9458a88e6fc5d1c478a97ed412","class_hash":"0x2760f25d5a4fb2bdde5f561fd0b44a3dee78c28903577d37d669939d97036a0","entry_point_type":"EXTERNAL","call_type":"DELEGATE","result":["0x1"],"calls":[],"events":[{"keys":["0x99cd8bde557814842a3121e8ddfd433a539b8c9f14bf31ebf108d12e6196e9"],"data":["0xdac9bcffb3d967f19a7fe21002c98c984d5a9458a88e6fc5d1c478a97ed412","0x5dcd266a80b8a5f29f04d779c6b166b80150c24f2180a75e82427242dab20a9","0x15be","0x0"]}],"messages":[]}],"events":[],"messages":[]}, + "validate_invocation":{"entry_point_selector":"0x36fcbf06cd96843058359e1a75928beacfac10727dab22a3972f0af8aa92895","calldata":["0x25ec026985a3bf9d0cc1fe17326b245dfdc3ff89b8fde106542a3ea56c5a918","0x322258135d04971e96b747a5551061aa046ad5d8be11a35c67029d96b23f98","0x33434ad846cdd5f23eb73ff09fe6fddd568284a0fb7d1be20ee482f044dabe2","0x79dc0da7c54b95f10aa182ad0a46400db63156920adb65eca2654c0945a463","0x2","0x322258135d04971e96b747a5551061aa046ad5d8be11a35c67029d96b23f98","0x0"],"caller_address":"0x0","class_hash":"0x25ec026985a3bf9d0cc1fe17326b245dfdc3ff89b8fde106542a3ea56c5a918","entry_point_type":"EXTERNAL","call_type":"CALL","result":[],"calls":[{"entry_point_selector":"0x36fcbf06cd96843058359e1a75928beacfac10727dab22a3972f0af8aa92895","calldata":["0x25ec026985a3bf9d0cc1fe17326b245dfdc3ff89b8fde106542a3ea56c5a918","0x322258135d04971e96b747a5551061aa046ad5d8be11a35c67029d96b23f98","0x33434ad846cdd5f23eb73ff09fe6fddd568284a0fb7d1be20ee482f044dabe2","0x79dc0da7c54b95f10aa182ad0a46400db63156920adb65eca2654c0945a463","0x2","0x322258135d04971e96b747a5551061aa046ad5d8be11a35c67029d96b23f98","0x0"],"caller_address":"0x0","class_hash":"0x33434ad846cdd5f23eb73ff09fe6fddd568284a0fb7d1be20ee482f044dabe2","entry_point_type":"EXTERNAL","call_type":"DELEGATE","result":[],"calls":[],"events":[],"messages":[]}],"events":[],"messages":[], "execution_resources":{}}, + "execute_invocation":{"entry_point_selector":"0x28ffe4ff0f226a9107253e17a904099aa4f63a02a5621de0576e5aa71bc5194","calldata":["0x33434ad846cdd5f23eb73ff09fe6fddd568284a0fb7d1be20ee482f044dabe2","0x79dc0da7c54b95f10aa182ad0a46400db63156920adb65eca2654c0945a463","0x2","0x322258135d04971e96b747a5551061aa046ad5d8be11a35c67029d96b23f98","0x0"],"caller_address":"0x0","class_hash":"0x25ec026985a3bf9d0cc1fe17326b245dfdc3ff89b8fde106542a3ea56c5a918","entry_point_type":"CONSTRUCTOR","call_type":"CALL","result":[],"calls":[{"entry_point_selector":"0x79dc0da7c54b95f10aa182ad0a46400db63156920adb65eca2654c0945a463","calldata":["0x322258135d04971e96b747a5551061aa046ad5d8be11a35c67029d96b23f98","0x0"],"caller_address":"0x0","class_hash":"0x33434ad846cdd5f23eb73ff09fe6fddd568284a0fb7d1be20ee482f044dabe2","entry_point_type":"EXTERNAL","call_type":"DELEGATE","result":[],"calls":[],"events":[{"keys":["0x10c19bef19acd19b2c9f4caa40fd47c9fbe1d9f91324d44dcd36be2dae96784"],"data":["0xdac9bcffb3d967f19a7fe21002c98c984d5a9458a88e6fc5d1c478a97ed412","0x322258135d04971e96b747a5551061aa046ad5d8be11a35c67029d96b23f98","0x0"]}],"messages":[]}],"events":[],"messages":[], "execution_resources": {}}, + "fee_transfer_invocation":{"entry_point_selector":"0x83afd3f4caedc6eebf44246fe54e38c95e3179a5ec9ea81740eca5b482d12e","calldata":["0x5dcd266a80b8a5f29f04d779c6b166b80150c24f2180a75e82427242dab20a9","0x15be","0x0"],"caller_address":"0xdac9bcffb3d967f19a7fe21002c98c984d5a9458a88e6fc5d1c478a97ed412","class_hash":"0xd0e183745e9dae3e4e78a8ffedcce0903fc4900beace4e0abf192d4c202da3","entry_point_type":"EXTERNAL","call_type":"CALL","result":["0x1"],"calls":[{"entry_point_selector":"0x83afd3f4caedc6eebf44246fe54e38c95e3179a5ec9ea81740eca5b482d12e","calldata":["0x5dcd266a80b8a5f29f04d779c6b166b80150c24f2180a75e82427242dab20a9","0x15be","0x0"],"caller_address":"0xdac9bcffb3d967f19a7fe21002c98c984d5a9458a88e6fc5d1c478a97ed412","class_hash":"0x2760f25d5a4fb2bdde5f561fd0b44a3dee78c28903577d37d669939d97036a0","entry_point_type":"EXTERNAL","call_type":"DELEGATE","result":["0x1"],"calls":[],"events":[{"keys":["0x99cd8bde557814842a3121e8ddfd433a539b8c9f14bf31ebf108d12e6196e9"],"data":["0xdac9bcffb3d967f19a7fe21002c98c984d5a9458a88e6fc5d1c478a97ed412","0x5dcd266a80b8a5f29f04d779c6b166b80150c24f2180a75e82427242dab20a9","0x15be","0x0"]}],"messages":[]}],"events":[],"messages":[], "execution_resources": {}}, + "execution_resources": {"data_availability": {}}, "state_diff": { "storage_diffs": [], "nonces": [], @@ -557,12 +427,12 @@ func TestTraceBlockTransactionsV0_6(t *testing.T) { } }`) vmTrace := vm.TransactionTrace{} + require.NoError(t, json.Unmarshal(vmTraceJSON, &vmTrace)) stepsUsed := uint64(123) stepsUsedStr := "123" - require.NoError(t, json.Unmarshal(vmTraceJSON, &vmTrace)) mockVM.EXPECT().Execute([]core.Transaction{tx}, []core.Class{declaredClass.Class}, []*felt.Felt{}, &vm.BlockInfo{Header: header}, - gomock.Any(), n, false, false, false, false). - Return(nil, nil, []vm.TransactionTrace{vmTrace}, stepsUsed, nil) + gomock.Any(), n, false, false, false). + Return(nil, []core.GasConsumed{{}, {}}, []vm.TransactionTrace{vmTrace}, stepsUsed, nil) expectedResult := []rpc.TracedBlockTransaction{ { @@ -570,7 +440,7 @@ func TestTraceBlockTransactionsV0_6(t *testing.T) { TraceRoot: &vmTrace, }, } - result, httpHeader, err := handler.TraceBlockTransactionsV0_6(context.Background(), rpc.BlockID{Hash: blockHash}) + result, httpHeader, err := handler.TraceBlockTransactions(context.Background(), rpc.BlockID{Hash: blockHash}) require.Nil(t, err) assert.Equal(t, httpHeader.Get(rpc.ExecutionStepsHeader), stepsUsedStr) assert.Equal(t, expectedResult, result) @@ -650,7 +520,7 @@ func TestCall(t *testing.T) { ClassHash: classHash, Selector: selector, Calldata: calldata, - }, &vm.BlockInfo{Header: headsHeader}, gomock.Any(), &utils.Mainnet, uint64(1337), true).Return(expectedRes, nil) + }, &vm.BlockInfo{Header: headsHeader}, gomock.Any(), &utils.Mainnet, uint64(1337)).Return(expectedRes, nil) res, rpcErr := handler.Call(rpc.FunctionCall{ ContractAddress: *contractAddr, diff --git a/rpc/transaction.go b/rpc/transaction.go index b8269b534..b270e7e86 100644 --- a/rpc/transaction.go +++ b/rpc/transaction.go @@ -471,7 +471,7 @@ func (h *Handler) TransactionByBlockIDAndIndex(id BlockID, txIndex int) (*Transa // // It follows the specification defined here: // https://github.com/starkware-libs/starknet-specs/blob/master/api/starknet_api_openrpc.json#L222 -func (h *Handler) TransactionReceiptByHash(hash felt.Felt) (*TransactionReceipt, *jsonrpc.Error) { //nolint:dupl +func (h *Handler) TransactionReceiptByHash(hash felt.Felt) (*TransactionReceipt, *jsonrpc.Error) { txn, err := h.bcReader.TransactionByHash(&hash) if err != nil { return nil, ErrTxnHashNotFound @@ -495,38 +495,7 @@ func (h *Handler) TransactionReceiptByHash(hash felt.Felt) (*TransactionReceipt, } } - return AdaptReceipt(receipt, txn, status, blockHash, blockNumber, false), nil -} - -// TransactionReceiptByHash returns the receipt of a transaction identified by the given hash. -// -// It follows the specification defined here: -// https://github.com/starkware-libs/starknet-specs/blob/master/api/starknet_api_openrpc.json#L222 -func (h *Handler) TransactionReceiptByHashV0_6(hash felt.Felt) (*TransactionReceipt, *jsonrpc.Error) { //nolint:dupl - txn, err := h.bcReader.TransactionByHash(&hash) - if err != nil { - return nil, ErrTxnHashNotFound - } - - receipt, blockHash, blockNumber, err := h.bcReader.Receipt(&hash) - if err != nil { - return nil, ErrTxnHashNotFound - } - - status := TxnAcceptedOnL2 - - if blockHash != nil { - l1H, jsonErr := h.l1Head() - if jsonErr != nil { - return nil, jsonErr - } - - if isL1Verified(blockNumber, l1H) { - status = TxnAcceptedOnL1 - } - } - - return AdaptReceipt(receipt, txn, status, blockHash, blockNumber, true), nil + return AdaptReceipt(receipt, txn, status, blockHash, blockNumber), nil } // AddTransaction relays a transaction to the gateway. @@ -706,9 +675,8 @@ func AdaptTransaction(t core.Transaction) *Transaction { } // todo(Kirill): try to replace core.Transaction with rpc.Transaction type -func AdaptReceipt(receipt *core.TransactionReceipt, txn core.Transaction, - finalityStatus TxnFinalityStatus, blockHash *felt.Felt, blockNumber uint64, - v0_6Response bool, +func AdaptReceipt(receipt *core.TransactionReceipt, txn core.Transaction, finalityStatus TxnFinalityStatus, + blockHash *felt.Felt, blockNumber uint64, ) *TransactionReceipt { messages := make([]*MsgToL1, len(receipt.L2ToL1Message)) for idx, msg := range receipt.L2ToL1Message { @@ -767,7 +735,7 @@ func AdaptReceipt(receipt *core.TransactionReceipt, txn core.Transaction, Events: events, ContractAddress: contractAddress, RevertReason: receipt.RevertReason, - ExecutionResources: adaptExecutionResources(receipt.ExecutionResources, v0_6Response), + ExecutionResources: adaptExecutionResources(receipt.ExecutionResources), MessageHash: messageHash, } } diff --git a/rpc/transaction_test.go b/rpc/transaction_test.go index 4d3b552ba..8de3400ee 100644 --- a/rpc/transaction_test.go +++ b/rpc/transaction_test.go @@ -488,264 +488,6 @@ func TestTransactionByBlockIdAndIndex(t *testing.T) { }) } -//nolint:dupl -func TestTransactionReceiptByHashV0_6(t *testing.T) { - mockCtrl := gomock.NewController(t) - t.Cleanup(mockCtrl.Finish) - - n := utils.Ptr(utils.Mainnet) - mockReader := mocks.NewMockReader(mockCtrl) - handler := rpc.New(mockReader, nil, nil, "", nil) - - t.Run("transaction not found", func(t *testing.T) { - txHash := new(felt.Felt).SetBytes([]byte("random hash")) - mockReader.EXPECT().TransactionByHash(txHash).Return(nil, errors.New("tx not found")) - - tx, rpcErr := handler.TransactionReceiptByHashV0_6(*txHash) - assert.Nil(t, tx) - assert.Equal(t, rpc.ErrTxnHashNotFound, rpcErr) - }) - - client := feeder.NewTestClient(t, n) - mainnetGw := adaptfeeder.New(client) - - block0, err := mainnetGw.BlockByNumber(context.Background(), 0) - require.NoError(t, err) - - checkTxReceipt := func(t *testing.T, h *felt.Felt, expected string) { - t.Helper() - - expectedMap := make(map[string]any) - require.NoError(t, json.Unmarshal([]byte(expected), &expectedMap)) - - receipt, err := handler.TransactionReceiptByHashV0_6(*h) - require.Nil(t, err) - - receiptJSON, jsonErr := json.Marshal(receipt) - require.NoError(t, jsonErr) - - receiptMap := make(map[string]any) - require.NoError(t, json.Unmarshal(receiptJSON, &receiptMap)) - assert.Equal(t, expectedMap, receiptMap) - } - - tests := map[string]struct { - index int - expected string - }{ - "with contract addr": { - index: 0, - expected: `{ - "type": "DEPLOY", - "transaction_hash": "0xe0a2e45a80bb827967e096bcf58874f6c01c191e0a0530624cba66a508ae75", - "actual_fee": {"amount": "0x0", "unit": "WEI"}, - "finality_status": "ACCEPTED_ON_L2", - "execution_status": "SUCCEEDED", - "block_hash": "0x47c3637b57c2b079b93c61539950c17e868a28f46cdef28f88521067f21e943", - "block_number": 0, - "messages_sent": [], - "events": [], - "contract_address": "0x20cfa74ee3564b4cd5435cdace0f9c4d43b939620e4a0bb5076105df0a626c6", - "execution_resources":{"steps":29} - }`, - }, - "without contract addr": { - index: 2, - expected: `{ - "type": "INVOKE", - "transaction_hash": "0xce54bbc5647e1c1ea4276c01a708523f740db0ff5474c77734f73beec2624", - "actual_fee": {"amount": "0x0", "unit": "WEI"}, - "finality_status": "ACCEPTED_ON_L2", - "execution_status": "SUCCEEDED", - "block_hash": "0x47c3637b57c2b079b93c61539950c17e868a28f46cdef28f88521067f21e943", - "block_number": 0, - "messages_sent": [ - { - "from_address": "0x20cfa74ee3564b4cd5435cdace0f9c4d43b939620e4a0bb5076105df0a626c6", - "to_address": "0xc84dd7fd43a7defb5b7a15c4fbbe11cbba6db1ba", - "payload": [ - "0xc", - "0x22" - ] - } - ], - "events": [], - "execution_resources":{"steps":31} - }`, - }, - } - for name, test := range tests { - t.Run(name, func(t *testing.T) { - txHash := block0.Transactions[test.index].Hash() - mockReader.EXPECT().TransactionByHash(txHash).Return(block0.Transactions[test.index], nil) - mockReader.EXPECT().Receipt(txHash).Return(block0.Receipts[test.index], block0.Hash, block0.Number, nil) - mockReader.EXPECT().L1Head().Return(nil, db.ErrKeyNotFound) - - checkTxReceipt(t, txHash, test.expected) - }) - } - - t.Run("pending receipt", func(t *testing.T) { - i := 2 - expected := `{ - "type": "INVOKE", - "transaction_hash": "0xce54bbc5647e1c1ea4276c01a708523f740db0ff5474c77734f73beec2624", - "actual_fee": {"amount": "0x0", "unit": "WEI"}, - "finality_status": "ACCEPTED_ON_L2", - "execution_status": "SUCCEEDED", - "messages_sent": [ - { - "from_address": "0x20cfa74ee3564b4cd5435cdace0f9c4d43b939620e4a0bb5076105df0a626c6", - "to_address": "0xc84dd7fd43a7defb5b7a15c4fbbe11cbba6db1ba", - "payload": [ - "0xc", - "0x22" - ] - } - ], - "events": [], - "execution_resources":{"steps":31} - }` - - txHash := block0.Transactions[i].Hash() - mockReader.EXPECT().TransactionByHash(txHash).Return(block0.Transactions[i], nil) - mockReader.EXPECT().Receipt(txHash).Return(block0.Receipts[i], nil, uint64(0), nil) - - checkTxReceipt(t, txHash, expected) - }) - - t.Run("accepted on l1 receipt", func(t *testing.T) { - i := 2 - expected := `{ - "type": "INVOKE", - "transaction_hash": "0xce54bbc5647e1c1ea4276c01a708523f740db0ff5474c77734f73beec2624", - "actual_fee": {"amount": "0x0", "unit": "WEI"}, - "finality_status": "ACCEPTED_ON_L1", - "execution_status": "SUCCEEDED", - "block_hash": "0x47c3637b57c2b079b93c61539950c17e868a28f46cdef28f88521067f21e943", - "block_number": 0, - "messages_sent": [ - { - "from_address": "0x20cfa74ee3564b4cd5435cdace0f9c4d43b939620e4a0bb5076105df0a626c6", - "to_address": "0xc84dd7fd43a7defb5b7a15c4fbbe11cbba6db1ba", - "payload": [ - "0xc", - "0x22" - ] - } - ], - "events": [], - "execution_resources":{"steps":31} - }` - - txHash := block0.Transactions[i].Hash() - mockReader.EXPECT().TransactionByHash(txHash).Return(block0.Transactions[i], nil) - mockReader.EXPECT().Receipt(txHash).Return(block0.Receipts[i], block0.Hash, block0.Number, nil) - mockReader.EXPECT().L1Head().Return(&core.L1Head{ - BlockNumber: block0.Number, - BlockHash: block0.Hash, - StateRoot: block0.GlobalStateRoot, - }, nil) - - checkTxReceipt(t, txHash, expected) - }) - t.Run("reverted", func(t *testing.T) { - expected := `{ - "type": "INVOKE", - "transaction_hash": "0x19abec18bbacec23c2eee160c70190a48e4b41dd5ff98ad8f247f9393559998", - "actual_fee": {"amount": "0x247aff6e224", "unit": "WEI"}, - "execution_status": "REVERTED", - "finality_status": "ACCEPTED_ON_L2", - "block_hash": "0x76e0229fd0c36dda2ee7905f7e4c9b3ebb78d98c4bfab550bcb3a03bf859a6", - "block_number": 304740, - "messages_sent": [], - "events": [], - "revert_reason": "Error in the called contract (0x00b1461de04c6a1aa3375bdf9b7723a8779c082ffe21311d683a0b15c078b5dc):\nError at pc=0:25:\nGot an exception while executing a hint.\nCairo traceback (most recent call last):\nUnknown location (pc=0:731)\nUnknown location (pc=0:677)\nUnknown location (pc=0:291)\nUnknown location (pc=0:314)\n\nError in the called contract (0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7):\nError at pc=0:104:\nGot an exception while executing a hint.\nCairo traceback (most recent call last):\nUnknown location (pc=0:1678)\nUnknown location (pc=0:1664)\n\nError in the called contract (0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7):\nError at pc=0:6:\nGot an exception while executing a hint: Assertion failed, 0 % 0x800000000000011000000000000000000000000000000000000000000000001 is equal to 0\nCairo traceback (most recent call last):\nUnknown location (pc=0:1238)\nUnknown location (pc=0:1215)\nUnknown location (pc=0:836)\n", - "execution_resources":{"steps":0} - }` - - integClient := feeder.NewTestClient(t, &utils.Integration) - integGw := adaptfeeder.New(integClient) - - blockWithRevertedTxn, err := integGw.BlockByNumber(context.Background(), 304740) - require.NoError(t, err) - - revertedTxnIdx := 1 - revertedTxnHash := blockWithRevertedTxn.Transactions[revertedTxnIdx].Hash() - - mockReader.EXPECT().TransactionByHash(revertedTxnHash).Return(blockWithRevertedTxn.Transactions[revertedTxnIdx], nil) - mockReader.EXPECT().Receipt(revertedTxnHash).Return(blockWithRevertedTxn.Receipts[revertedTxnIdx], - blockWithRevertedTxn.Hash, blockWithRevertedTxn.Number, nil) - mockReader.EXPECT().L1Head().Return(nil, db.ErrKeyNotFound) - - checkTxReceipt(t, revertedTxnHash, expected) - }) - - t.Run("v3 tx", func(t *testing.T) { - expected := `{ - "block_hash": "0x50e864db6b81ce69fbeb70e6a7284ee2febbb9a2e707415de7adab83525e9cd", - "block_number": 319132, - "execution_status": "SUCCEEDED", - "finality_status": "ACCEPTED_ON_L2", - "transaction_hash": "0x49728601e0bb2f48ce506b0cbd9c0e2a9e50d95858aa41463f46386dca489fd", - "messages_sent": [], - "events": [ - { - "from_address": "0x4718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", - "keys": [ - "0x99cd8bde557814842a3121e8ddfd433a539b8c9f14bf31ebf108d12e6196e9" - ], - "data": [ - "0x3f6f3bc663aedc5285d6013cc3ffcbc4341d86ab488b8b68d297f8258793c41", - "0x1176a1bd84444c89232ec27754698e5d2e7e1a7f1539f12027f28b23ec9f3d8", - "0x16d8b4ad4000", - "0x0" - ] - }, - { - "from_address": "0x4718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", - "keys": [ - "0xa9fa878c35cd3d0191318f89033ca3e5501a3d90e21e3cc9256bdd5cd17fdd" - ], - "data": [ - "0x1176a1bd84444c89232ec27754698e5d2e7e1a7f1539f12027f28b23ec9f3d8", - "0x18ad8494375bc00", - "0x0", - "0x18aef21f822fc00", - "0x0" - ] - } - ], - "execution_resources": { - "steps": 615, - "range_check_builtin_applications": 19, - "memory_holes": 4 - }, - "actual_fee": { - "amount": "0x16d8b4ad4000", - "unit": "FRI" - }, - "type": "INVOKE" - }` - - integClient := feeder.NewTestClient(t, &utils.Integration) - integGw := adaptfeeder.New(integClient) - - block, err := integGw.BlockByNumber(context.Background(), 319132) - require.NoError(t, err) - - index := 0 - txnHash := block.Transactions[index].Hash() - - mockReader.EXPECT().TransactionByHash(txnHash).Return(block.Transactions[index], nil) - mockReader.EXPECT().Receipt(txnHash).Return(block.Receipts[index], - block.Hash, block.Number, nil) - mockReader.EXPECT().L1Head().Return(nil, db.ErrKeyNotFound) - - checkTxReceipt(t, txnHash, expected) - }) -} - //nolint:dupl func TestTransactionReceiptByHash(t *testing.T) { mockCtrl := gomock.NewController(t) diff --git a/vm/vm.go b/vm/vm.go index f4754f635..e3b0bdd90 100644 --- a/vm/vm.go +++ b/vm/vm.go @@ -62,9 +62,9 @@ import ( //go:generate mockgen -destination=../mocks/mock_vm.go -package=mocks github.com/NethermindEth/juno/vm VM type VM interface { Call(callInfo *CallInfo, blockInfo *BlockInfo, state core.StateReader, network *utils.Network, - maxSteps uint64, useBlobData bool) ([]*felt.Felt, error) + maxSteps uint64) ([]*felt.Felt, error) Execute(txns []core.Transaction, declaredClasses []core.Class, paidFeesOnL1 []*felt.Felt, blockInfo *BlockInfo, - state core.StateReader, network *utils.Network, skipChargeFee, skipValidate, errOnRevert, useBlobData bool, + state core.StateReader, network *utils.Network, skipChargeFee, skipValidate, errOnRevert bool, ) ([]*felt.Felt, []core.GasConsumed, []TransactionTrace, uint64, error) } @@ -200,7 +200,7 @@ func makeCCallInfo(callInfo *CallInfo) (C.CallInfo, runtime.Pinner) { return cCallInfo, pinner } -func makeCBlockInfo(blockInfo *BlockInfo, useBlobData bool) C.BlockInfo { +func makeCBlockInfo(blockInfo *BlockInfo) C.BlockInfo { var cBlockInfo C.BlockInfo cBlockInfo.block_number = C.ulonglong(blockInfo.Header.Number) @@ -213,17 +213,13 @@ func makeCBlockInfo(blockInfo *BlockInfo, useBlobData bool) C.BlockInfo { if blockInfo.Header.L1DAMode == core.Blob { copyFeltIntoCArray(blockInfo.Header.L1DataGasPrice.PriceInWei, &cBlockInfo.data_gas_price_wei[0]) copyFeltIntoCArray(blockInfo.Header.L1DataGasPrice.PriceInFri, &cBlockInfo.data_gas_price_fri[0]) - if useBlobData { - cBlockInfo.use_blob_data = 1 - } else { - cBlockInfo.use_blob_data = 0 - } + cBlockInfo.use_blob_data = 1 } return cBlockInfo } func (v *vm) Call(callInfo *CallInfo, blockInfo *BlockInfo, state core.StateReader, - network *utils.Network, maxSteps uint64, useBlobData bool, + network *utils.Network, maxSteps uint64, ) ([]*felt.Felt, error) { context := &callContext{ state: state, @@ -240,7 +236,7 @@ func (v *vm) Call(callInfo *CallInfo, blockInfo *BlockInfo, state core.StateRead C.setVersionedConstants(C.CString("my_json")) cCallInfo, callInfoPinner := makeCCallInfo(callInfo) - cBlockInfo := makeCBlockInfo(blockInfo, useBlobData) + cBlockInfo := makeCBlockInfo(blockInfo) chainID := C.CString(network.L2ChainID) C.cairoVMCall( &cCallInfo, @@ -263,7 +259,7 @@ func (v *vm) Call(callInfo *CallInfo, blockInfo *BlockInfo, state core.StateRead // Execute executes a given transaction set and returns the gas spent per transaction func (v *vm) Execute(txns []core.Transaction, declaredClasses []core.Class, paidFeesOnL1 []*felt.Felt, blockInfo *BlockInfo, state core.StateReader, network *utils.Network, - skipChargeFee, skipValidate, errOnRevert, useBlobData bool, + skipChargeFee, skipValidate, errOnRevert bool, ) ([]*felt.Felt, []core.GasConsumed, []TransactionTrace, uint64, error) { context := &callContext{ state: state, @@ -306,7 +302,7 @@ func (v *vm) Execute(txns []core.Transaction, declaredClasses []core.Class, paid concurrencyModeByte = 1 } - cBlockInfo := makeCBlockInfo(blockInfo, useBlobData) + cBlockInfo := makeCBlockInfo(blockInfo) chainID := C.CString(network.L2ChainID) C.cairoVMExecute(txnsJSONCstr, classesJSONCStr, diff --git a/vm/vm_test.go b/vm/vm_test.go index 86e4cbe35..00832b606 100644 --- a/vm/vm_test.go +++ b/vm/vm_test.go @@ -54,7 +54,7 @@ func TestV0Call(t *testing.T) { ContractAddress: contractAddr, ClassHash: classHash, Selector: entryPoint, - }, &BlockInfo{Header: &core.Header{}}, testState, &utils.Mainnet, 1_000_000, true) + }, &BlockInfo{Header: &core.Header{}}, testState, &utils.Mainnet, 1_000_000) require.NoError(t, err) assert.Equal(t, []*felt.Felt{&felt.Zero}, ret) @@ -74,7 +74,7 @@ func TestV0Call(t *testing.T) { ContractAddress: contractAddr, ClassHash: classHash, Selector: entryPoint, - }, &BlockInfo{Header: &core.Header{Number: 1}}, testState, &utils.Mainnet, 1_000_000, true) + }, &BlockInfo{Header: &core.Header{Number: 1}}, testState, &utils.Mainnet, 1_000_000) require.NoError(t, err) assert.Equal(t, []*felt.Felt{new(felt.Felt).SetUint64(1337)}, ret) } @@ -122,7 +122,7 @@ func TestV1Call(t *testing.T) { Calldata: []felt.Felt{ *storageLocation, }, - }, &BlockInfo{Header: &core.Header{}}, testState, &utils.Goerli, 1_000_000, true) + }, &BlockInfo{Header: &core.Header{}}, testState, &utils.Goerli, 1_000_000) require.NoError(t, err) assert.Equal(t, []*felt.Felt{&felt.Zero}, ret) @@ -144,7 +144,7 @@ func TestV1Call(t *testing.T) { Calldata: []felt.Felt{ *storageLocation, }, - }, &BlockInfo{Header: &core.Header{Number: 1}}, testState, &utils.Goerli, 1_000_000, true) + }, &BlockInfo{Header: &core.Header{Number: 1}}, testState, &utils.Goerli, 1_000_000) require.NoError(t, err) assert.Equal(t, []*felt.Felt{new(felt.Felt).SetUint64(37)}, ret) } @@ -186,7 +186,7 @@ func TestCall_MaxSteps(t *testing.T) { ContractAddress: contractAddr, ClassHash: classHash, Selector: entryPoint, - }, &BlockInfo{Header: &core.Header{}}, testState, &utils.Mainnet, 0, true) + }, &BlockInfo{Header: &core.Header{}}, testState, &utils.Mainnet, 0) assert.ErrorContains(t, err, "RunResources has no remaining steps") } @@ -211,7 +211,7 @@ func TestExecute(t *testing.T) { GasPriceSTRK: &felt.Zero, }, }, state, - &network, false, false, false, false) + &network, false, false, false) require.NoError(t, err) }) t.Run("zero data", func(t *testing.T) { @@ -221,7 +221,7 @@ func TestExecute(t *testing.T) { GasPrice: &felt.Zero, GasPriceSTRK: &felt.Zero, }, - }, state, &network, false, false, false, false) + }, state, &network, false, false, false) require.NoError(t, err) }) }