diff --git a/node/throttled_vm.go b/node/throttled_vm.go index 4612f3749e..f50c66be1c 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/simulation.go b/rpc/simulation.go index bc065fe2e3..89b9dea890 100644 --- a/rpc/simulation.go +++ b/rpc/simulation.go @@ -103,9 +103,8 @@ func (h *Handler) simulateTransactions(id BlockID, transactions []BroadcastedTra Header: header, BlockHashToBeRevealed: blockHashToBeRevealed, } - useBlobData := true 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)) diff --git a/rpc/trace.go b/rpc/trace.go index 6df386f26e..ceb1a1b420 100644 --- a/rpc/trace.go +++ b/rpc/trace.go @@ -285,9 +285,8 @@ func (h *Handler) traceBlockTransactions(ctx context.Context, block *core.Block) BlockHashToBeRevealed: blockHashToBeRevealed, } - useBlobData := true _, 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)) @@ -379,7 +378,7 @@ func (h *Handler) Call(funcCall FunctionCall, id BlockID) ([]*felt.Felt, *jsonrp }, &vm.BlockInfo{ Header: header, BlockHashToBeRevealed: blockHashToBeRevealed, - }, state, h.bcReader.Network(), h.callMaxSteps, true) + }, state, h.bcReader.Network(), h.callMaxSteps) if err != nil { if errors.Is(err, utils.ErrResourceBusy) { return nil, ErrInternal.CloneWithData(throttledVMErr) diff --git a/vm/vm.go b/vm/vm.go index f4754f635f..e3b0bdd90e 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,