From 952a281fe61dd346eecf0d7d9d1a802e61cbf016 Mon Sep 17 00:00:00 2001 From: Pedro Gomes Date: Thu, 21 Dec 2023 10:56:12 +0000 Subject: [PATCH] Gaslimit + gascap flags (#1682) * Hooking up the gaslimit + gascap flags * crazy valued flags * lint * update gas limits to 2.5M * Debug HH contract deployer * remove debugger lines * fix contract step * debug for l2 deployer * adjust limits * restart build * fix log upload * update integration constant * restart build --- .github/workflows/build-pr.yml | 3 +++ .../testnet/layer2/001_whitelist_tokens.ts | 2 +- go/config/enclave_cli_flags.go | 6 +++-- go/config/enclave_config.go | 10 +++++--- go/config/enclave_config_test.go | 6 ++--- go/enclave/components/batch_executor.go | 25 ++++++++++++------- go/enclave/components/interfaces.go | 2 +- go/enclave/components/rollup_compression.go | 1 - go/enclave/crosschain/message_bus_manager.go | 4 +-- go/enclave/enclave.go | 16 ++++-------- go/enclave/evm/evm_facade.go | 19 ++++++++------ go/enclave/l2chain/l2_chain.go | 17 +++++++------ go/enclave/nodetype/sequencer.go | 3 +-- go/enclave/nodetype/validator.go | 2 +- integration/common/constants.go | 4 +-- integration/datagenerator/common.go | 2 +- integration/simulation/devnetwork/node.go | 6 ++--- .../simulation/network/network_utils.go | 9 ++++--- integration/simulation/simulation.go | 2 +- tools/hardhatdeployer/contract_deployer.go | 4 +-- 20 files changed, 78 insertions(+), 65 deletions(-) diff --git a/.github/workflows/build-pr.yml b/.github/workflows/build-pr.yml index cd0d567edc..d0f61124ee 100644 --- a/.github/workflows/build-pr.yml +++ b/.github/workflows/build-pr.yml @@ -41,6 +41,9 @@ jobs: integration/.build/noderunner/noderunner-*.txt integration/.build/wallet_extension/wal-ext-*.txt integration/.build/eth2/* + integration/.build/faucet/* + integration/.build/obscuroscan/* + integration/.build/tengateway/* retention-days: 1 diff --git a/contracts/deployment_scripts/testnet/layer2/001_whitelist_tokens.ts b/contracts/deployment_scripts/testnet/layer2/001_whitelist_tokens.ts index 397e11db8a..2e6bffd29a 100644 --- a/contracts/deployment_scripts/testnet/layer2/001_whitelist_tokens.ts +++ b/contracts/deployment_scripts/testnet/layer2/001_whitelist_tokens.ts @@ -122,7 +122,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { return l2Network.deployments.execute("CrossChainMessenger", { from: l2Accounts.deployer, log: true, - gasLimit: 1024_000_000 + gasLimit: 2_500_000 }, "relayMessage", msg); }; diff --git a/go/config/enclave_cli_flags.go b/go/config/enclave_cli_flags.go index 030ddd1c87..690b43f49b 100644 --- a/go/config/enclave_cli_flags.go +++ b/go/config/enclave_cli_flags.go @@ -31,7 +31,8 @@ const ( MaxRollupSizeFlag = "maxRollupSize" L2BaseFeeFlag = "l2BaseFee" L2CoinbaseFlag = "l2Coinbase" - L2GasLimitFlag = "l2GasLimit" + GasBatchExecutionLimit = "gasBatchExecutionLimit" + GasLocalExecutionCapFlag = "gasLocalExecutionCap" ) // EnclaveFlags are the flags that the enclave can receive @@ -54,13 +55,14 @@ var EnclaveFlags = map[string]*flag.TenFlag{ MaxRollupSizeFlag: flag.NewUint64Flag(MaxRollupSizeFlag, 1024*64, "The maximum size a rollup is allowed to reach"), L2BaseFeeFlag: flag.NewUint64Flag(L2BaseFeeFlag, 1, ""), L2CoinbaseFlag: flag.NewStringFlag(L2CoinbaseFlag, "0xd6C9230053f45F873Cb66D8A02439380a37A4fbF", ""), - L2GasLimitFlag: flag.NewUint64Flag(L2GasLimitFlag, 9e18, ""), + GasBatchExecutionLimit: flag.NewUint64Flag(GasBatchExecutionLimit, 3_000_000, "Max gas that can be executed in a single batch"), ObscuroGenesisFlag: flag.NewStringFlag(ObscuroGenesisFlag, "", "The json string with the obscuro genesis"), L1ChainIDFlag: flag.NewInt64Flag(L1ChainIDFlag, 1337, "An integer representing the unique chain id of the Ethereum chain used as an L1 (default 1337)"), ObscuroChainIDFlag: flag.NewInt64Flag(ObscuroChainIDFlag, 443, "An integer representing the unique chain id of the Obscuro chain (default 443)"), UseInMemoryDBFlag: flag.NewBoolFlag(UseInMemoryDBFlag, true, "Whether the enclave will use an in-memory DB rather than persist data"), ProfilerEnabledFlag: flag.NewBoolFlag(ProfilerEnabledFlag, false, "Runs a profiler instance (Defaults to false)"), DebugNamespaceEnabledFlag: flag.NewBoolFlag(DebugNamespaceEnabledFlag, false, "Whether the debug namespace is enabled"), + GasLocalExecutionCapFlag: flag.NewUint64Flag(GasLocalExecutionCapFlag, 3_000_000, "Max gas usage when executing local transactions"), } // enclaveRestrictedFlags are the flags that the enclave can receive ONLY over the Ego signed enclave.json diff --git a/go/config/enclave_config.go b/go/config/enclave_config.go index 30c7fe6aca..68f92524f0 100644 --- a/go/config/enclave_config.go +++ b/go/config/enclave_config.go @@ -65,9 +65,10 @@ type EnclaveConfig struct { // to include a transaction if it goes above it MaxRollupSize uint64 - GasPaymentAddress gethcommon.Address - BaseFee *big.Int - GasLimit *big.Int + GasPaymentAddress gethcommon.Address + BaseFee *big.Int + GasBatchExecutionLimit uint64 + GasLocalExecutionCapFlag uint64 } func NewConfigFromFlags(cliFlags map[string]*flag.TenFlag) (*EnclaveConfig, error) { @@ -184,7 +185,8 @@ func newConfig(flags map[string]*flag.TenFlag) (*EnclaveConfig, error) { cfg.MaxRollupSize = flags[MaxRollupSizeFlag].Uint64() cfg.BaseFee = big.NewInt(0).SetUint64(flags[L2BaseFeeFlag].Uint64()) cfg.GasPaymentAddress = gethcommon.HexToAddress(flags[L2CoinbaseFlag].String()) - cfg.GasLimit = big.NewInt(0).SetUint64(flags[L2GasLimitFlag].Uint64()) + cfg.GasBatchExecutionLimit = flags[GasBatchExecutionLimit].Uint64() + cfg.GasLocalExecutionCapFlag = flags[GasLocalExecutionCapFlag].Uint64() return cfg, nil } diff --git a/go/config/enclave_config_test.go b/go/config/enclave_config_test.go index 79cd1361d8..c587572e91 100644 --- a/go/config/enclave_config_test.go +++ b/go/config/enclave_config_test.go @@ -41,7 +41,7 @@ func TestCLIFlagTypes(t *testing.T) { err = flag.CommandLine.Set(MinGasPriceFlag, "3333") require.NoError(t, err) - err = flag.CommandLine.Set(L2GasLimitFlag, "222222") + err = flag.CommandLine.Set(GasBatchExecutionLimit, "222222") require.NoError(t, err) flag.Parse() @@ -50,7 +50,7 @@ func TestCLIFlagTypes(t *testing.T) { require.Equal(t, true, flags[WillAttestFlag].Bool()) require.Equal(t, 123, flags[LogLevelFlag].Int()) require.Equal(t, int64(3333), flags[MinGasPriceFlag].Int64()) - require.Equal(t, uint64(222222), flags[L2GasLimitFlag].Uint64()) + require.Equal(t, uint64(222222), flags[GasBatchExecutionLimit].Uint64()) enclaveConfig, err := newConfig(flags) require.NoError(t, err) @@ -59,7 +59,7 @@ func TestCLIFlagTypes(t *testing.T) { require.Equal(t, true, enclaveConfig.WillAttest) require.Equal(t, 123, enclaveConfig.LogLevel) require.Equal(t, big.NewInt(3333), enclaveConfig.MinGasPrice) - require.Equal(t, big.NewInt(222222), enclaveConfig.GasLimit) + require.Equal(t, uint64(222222), enclaveConfig.GasBatchExecutionLimit) } func TestRestrictedMode(t *testing.T) { diff --git a/go/enclave/components/batch_executor.go b/go/enclave/components/batch_executor.go index 065f21132d..da37326c22 100644 --- a/go/enclave/components/batch_executor.go +++ b/go/enclave/components/batch_executor.go @@ -42,6 +42,8 @@ type batchExecutor struct { // stateDBMutex - used to protect calls to stateDB.Commit as it is not safe for async access. stateDBMutex sync.Mutex + + batchGasLimit uint64 // max execution gas allowed in a batch } func NewBatchExecutor( @@ -50,6 +52,7 @@ func NewBatchExecutor( genesis *genesis.Genesis, gasOracle gas.Oracle, chainConfig *params.ChainConfig, + batchGasLimit uint64, logger gethlog.Logger, ) BatchExecutor { return &batchExecutor{ @@ -60,6 +63,7 @@ func NewBatchExecutor( logger: logger, gasOracle: gasOracle, stateDBMutex: sync.Mutex{}, + batchGasLimit: batchGasLimit, } } @@ -301,18 +305,12 @@ func (executor *batchExecutor) CreateGenesisState( timeNow uint64, coinbase gethcommon.Address, baseFee *big.Int, - gasLimit *big.Int, ) (*core.Batch, *types.Transaction, error) { preFundGenesisState, err := executor.genesis.GetGenesisRoot(executor.storage) if err != nil { return nil, nil, err } - limit := params.MaxGasLimit / 6 - if gasLimit != nil { - limit = gasLimit.Uint64() - } - genesisBatch := &core.Batch{ Header: &common.BatchHeader{ ParentHash: common.L2BatchHash{}, @@ -326,7 +324,7 @@ func (executor *batchExecutor) CreateGenesisState( Time: timeNow, Coinbase: coinbase, BaseFee: baseFee, - GasLimit: limit, // todo (@siliev) - does the batch header need uint64? + GasLimit: executor.batchGasLimit, }, Transactions: []*common.L2Tx{}, } @@ -411,8 +409,17 @@ func (executor *batchExecutor) processTransactions( var executedTransactions []*common.L2Tx var excludedTransactions []*common.L2Tx var txReceipts []*types.Receipt - - txResults := evm.ExecuteTransactions(txs, stateDB, batch.Header, executor.storage, cc, tCount, noBaseFee, executor.logger) + txResults := evm.ExecuteTransactions( + txs, + stateDB, + batch.Header, + executor.storage, + cc, + tCount, + noBaseFee, + executor.batchGasLimit, + executor.logger, + ) for _, tx := range txs { result, f := txResults[tx.Hash()] if !f { diff --git a/go/enclave/components/interfaces.go b/go/enclave/components/interfaces.go index 12b696ce97..6ed7e7a750 100644 --- a/go/enclave/components/interfaces.go +++ b/go/enclave/components/interfaces.go @@ -76,7 +76,7 @@ type BatchExecutor interface { // CreateGenesisState - will create and commit the genesis state in the stateDB for the given block hash, // and uint64 timestamp representing the time now. In this genesis state is where one can // find preallocated funds for faucet. TODO - make this an option - CreateGenesisState(common.L1BlockHash, uint64, gethcommon.Address, *big.Int, *big.Int) (*core.Batch, *types.Transaction, error) + CreateGenesisState(common.L1BlockHash, uint64, gethcommon.Address, *big.Int) (*core.Batch, *types.Transaction, error) } type BatchRegistry interface { diff --git a/go/enclave/components/rollup_compression.go b/go/enclave/components/rollup_compression.go index 0034d48cc7..f8801f70f4 100644 --- a/go/enclave/components/rollup_compression.go +++ b/go/enclave/components/rollup_compression.go @@ -436,7 +436,6 @@ func (rc *RollupCompression) executeAndSaveIncompleteBatches(calldataRollupHeade incompleteBatch.time, calldataRollupHeader.Coinbase, calldataRollupHeader.BaseFee, - big.NewInt(0).SetUint64(calldataRollupHeader.GasLimit), ) if err != nil { return err diff --git a/go/enclave/crosschain/message_bus_manager.go b/go/enclave/crosschain/message_bus_manager.go index 1731a10515..94bd0b9be7 100644 --- a/go/enclave/crosschain/message_bus_manager.go +++ b/go/enclave/crosschain/message_bus_manager.go @@ -86,7 +86,7 @@ func (m *MessageBusManager) GenerateMessageBusDeployTx() (*common.L2Tx, error) { tx := &types.LegacyTx{ Nonce: 0, // The first transaction of the owner identity should always be deploying the contract Value: gethcommon.Big0, - Gas: 5_000_000, // It's quite the expensive contract. + Gas: 2_000_000, // It's quite the expensive contract. GasPrice: gethcommon.Big0, // Synthetic transactions are on the house. Or the house. Data: gethcommon.FromHex(MessageBus.MessageBusMetaData.Bin), To: nil, // Geth requires nil instead of gethcommon.Address{} which equates to zero address in order to return receipt. @@ -219,7 +219,7 @@ func (m *MessageBusManager) CreateSyntheticTransactions(messages common.CrossCha tx := &types.LegacyTx{ Nonce: startingNonce + uint64(idx), Value: gethcommon.Big0, - Gas: 5_000_000, + Gas: 2_000_000, GasPrice: gethcommon.Big0, // Synthetic transactions are on the house. Or the house. Data: data, To: m.messageBusAddress, diff --git a/go/enclave/enclave.go b/go/enclave/enclave.go index 88025246f3..5b784c0106 100644 --- a/go/enclave/enclave.go +++ b/go/enclave/enclave.go @@ -81,10 +81,6 @@ type enclaveImpl struct { service nodetype.NodeType registry components.BatchRegistry - // todo (#627) - use the ethconfig.Config instead - GlobalGasCap uint64 // 5_000_000_000, // todo (#627) - make config - BaseFee *big.Int // gethcommon.Big0, - mgmtContractLib mgmtcontractlib.MgmtContractLib attestationProvider components.AttestationProvider // interface for producing attestation reports and verifying them @@ -184,7 +180,7 @@ func NewEnclave( gasOracle := gas.NewGasOracle() blockProcessor := components.NewBlockProcessor(storage, crossChainProcessors, gasOracle, logger) - batchExecutor := components.NewBatchExecutor(storage, crossChainProcessors, genesis, gasOracle, chainConfig, logger) + batchExecutor := components.NewBatchExecutor(storage, crossChainProcessors, genesis, gasOracle, chainConfig, config.GasBatchExecutionLimit, logger) sigVerifier, err := components.NewSignatureValidator(config.SequencerID, storage) registry := components.NewBatchRegistry(storage, logger) rProducer := components.NewRollupProducer(config.SequencerID, storage, registry, logger) @@ -222,7 +218,7 @@ func NewEnclave( MaxBatchSize: config.MaxBatchSize, MaxRollupSize: config.MaxRollupSize, GasPaymentAddress: config.GasPaymentAddress, - BatchGasLimit: config.GasLimit, + BatchGasLimit: config.GasBatchExecutionLimit, BaseFee: config.BaseFee, }, blockchain, @@ -237,6 +233,7 @@ func NewEnclave( genesis, logger, registry, + config.GasLocalExecutionCapFlag, ) // ensure cached chain state data is up-to-date using the persisted batch data @@ -275,9 +272,6 @@ func NewEnclave( registry: registry, service: service, - GlobalGasCap: 5_000_000_000, // todo (#627) - make config - BaseFee: gethcommon.Big0, - mainMutex: sync.Mutex{}, } } @@ -1028,7 +1022,7 @@ func (e *enclaveImpl) EstimateGas(encryptedParams common.EncryptedParamsEstimate return responses.AsEncryptedError(err, vkHandler), nil } - executionGasEstimate, err := e.DoEstimateGas(callMsg, blockNumber, e.GlobalGasCap) + executionGasEstimate, err := e.DoEstimateGas(callMsg, blockNumber, e.config.GasLocalExecutionCapFlag) if err != nil { err = fmt.Errorf("unable to estimate transaction - %w", err) @@ -1155,7 +1149,7 @@ func (e *enclaveImpl) DoEstimateGas(args *gethapi.TransactionArgs, blkNumber *ge } hi = block.GasLimit() */ - hi = e.GlobalGasCap + hi = e.config.GasLocalExecutionCapFlag } // Normalize the max fee per gas the call is willing to spend. var feeCap *big.Int diff --git a/go/enclave/evm/evm_facade.go b/go/enclave/evm/evm_facade.go index cb841a5311..31560d705c 100644 --- a/go/enclave/evm/evm_facade.go +++ b/go/enclave/evm/evm_facade.go @@ -3,7 +3,6 @@ package evm import ( "errors" "fmt" - "math" "math/big" "github.com/ethereum/go-ethereum/accounts/abi" @@ -38,9 +37,11 @@ func ExecuteTransactions( chainConfig *params.ChainConfig, fromTxIndex int, noBaseFee bool, + batchGasLimit uint64, logger gethlog.Logger, ) map[common.TxHash]interface{} { - chain, vmCfg, gp := initParams(storage, noBaseFee, logger) + chain, vmCfg := initParams(storage, noBaseFee, logger) + gp := gethcore.GasPool(batchGasLimit) zero := uint64(0) usedGas := &zero result := map[common.TxHash]interface{}{} @@ -57,7 +58,7 @@ func ExecuteTransactions( s, chainConfig, chain, - gp, + &gp, ethHeader, t, usedGas, @@ -157,6 +158,7 @@ func ExecuteObsCall( header *common.BatchHeader, storage storage.Storage, chainConfig *params.ChainConfig, + gasEstimationCap uint64, logger gethlog.Logger, ) (*gethcore.ExecutionResult, error) { noBaseFee := true @@ -166,7 +168,9 @@ func ExecuteObsCall( defer core.LogMethodDuration(logger, measure.NewStopwatch(), "evm_facade.go:ObsCall()") - chain, vmCfg, gp := initParams(storage, noBaseFee, nil) + gp := gethcore.GasPool(gasEstimationCap) + gp.SetGas(gasEstimationCap) + chain, vmCfg := initParams(storage, noBaseFee, nil) ethHeader, err := gethencoding.CreateEthHeaderForBatch(header, secret(storage)) if err != nil { return nil, err @@ -177,7 +181,7 @@ func ExecuteObsCall( txContext := gethcore.NewEVMTxContext(msg) vmenv := vm.NewEVM(blockContext, txContext, s, chainConfig, vmCfg) - result, err := gethcore.ApplyMessage(vmenv, msg, gp) + result, err := gethcore.ApplyMessage(vmenv, msg, &gp) // Follow the same error check structure as in geth // 1 - vmError / stateDB err check // 2 - evm.Cancelled() todo (#1576) - support the ability to cancel function call if it takes too long @@ -202,12 +206,11 @@ func ExecuteObsCall( return result, nil } -func initParams(storage storage.Storage, noBaseFee bool, l gethlog.Logger) (*ObscuroChainContext, vm.Config, *gethcore.GasPool) { +func initParams(storage storage.Storage, noBaseFee bool, l gethlog.Logger) (*ObscuroChainContext, vm.Config) { vmCfg := vm.Config{ NoBaseFee: noBaseFee, } - gp := gethcore.GasPool(math.MaxUint64) - return NewObscuroChainContext(storage, l), vmCfg, &gp + return NewObscuroChainContext(storage, l), vmCfg } // todo (#1053) - this is currently just returning the shared secret diff --git a/go/enclave/l2chain/l2_chain.go b/go/enclave/l2chain/l2_chain.go index ac35554645..7f56e0fde6 100644 --- a/go/enclave/l2chain/l2_chain.go +++ b/go/enclave/l2chain/l2_chain.go @@ -34,7 +34,8 @@ type obscuroChain struct { logger gethlog.Logger - Registry components.BatchRegistry + Registry components.BatchRegistry + gasEstimationCap uint64 } func NewChain( @@ -43,13 +44,15 @@ func NewChain( genesis *genesis.Genesis, logger gethlog.Logger, registry components.BatchRegistry, + gasEstimationCap uint64, ) ObscuroChain { return &obscuroChain{ - storage: storage, - chainConfig: chainConfig, - logger: logger, - genesis: genesis, - Registry: registry, + storage: storage, + chainConfig: chainConfig, + logger: logger, + genesis: genesis, + Registry: registry, + gasEstimationCap: gasEstimationCap, } } @@ -144,7 +147,7 @@ func (oc *obscuroChain) ObsCallAtBlock(apiArgs *gethapi.TransactionArgs, blockNu batch.Header.Root.Hex()) }}) - result, err := evm.ExecuteObsCall(callMsg, blockState, batch.Header, oc.storage, oc.chainConfig, oc.logger) + result, err := evm.ExecuteObsCall(callMsg, blockState, batch.Header, oc.storage, oc.chainConfig, oc.gasEstimationCap, oc.logger) if err != nil { // also return the result as the result can be evaluated on some errors like ErrIntrinsicGas return result, err diff --git a/go/enclave/nodetype/sequencer.go b/go/enclave/nodetype/sequencer.go index 71fdec925e..318d4adee9 100644 --- a/go/enclave/nodetype/sequencer.go +++ b/go/enclave/nodetype/sequencer.go @@ -35,7 +35,7 @@ type SequencerSettings struct { MaxBatchSize uint64 MaxRollupSize uint64 GasPaymentAddress gethcommon.Address - BatchGasLimit *big.Int + BatchGasLimit uint64 BaseFee *big.Int } @@ -138,7 +138,6 @@ func (s *sequencer) createGenesisBatch(block *common.L1Block) error { uint64(time.Now().Unix()), s.settings.GasPaymentAddress, s.settings.BaseFee, - s.settings.BatchGasLimit, ) if err != nil { return err diff --git a/go/enclave/nodetype/validator.go b/go/enclave/nodetype/validator.go index fae31d6df6..4997fa3297 100644 --- a/go/enclave/nodetype/validator.go +++ b/go/enclave/nodetype/validator.go @@ -133,7 +133,7 @@ func (val *obsValidator) executionPrerequisites(batch *core.Batch) (bool, error) } func (val *obsValidator) handleGenesis(batch *core.Batch) error { - genBatch, _, err := val.batchExecutor.CreateGenesisState(batch.Header.L1Proof, batch.Header.Time, batch.Header.Coinbase, batch.Header.BaseFee, big.NewInt(0).SetUint64(batch.Header.GasLimit)) + genBatch, _, err := val.batchExecutor.CreateGenesisState(batch.Header.L1Proof, batch.Header.Time, batch.Header.Coinbase, batch.Header.BaseFee) if err != nil { return err } diff --git a/integration/common/constants.go b/integration/common/constants.go index 63e4ab993c..b46cbd51d4 100644 --- a/integration/common/constants.go +++ b/integration/common/constants.go @@ -4,7 +4,6 @@ import ( "math/big" "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/params" "github.com/ten-protocol/go-ten/go/common" "github.com/ten-protocol/go-ten/go/common/log" "github.com/ten-protocol/go-ten/go/config" @@ -84,6 +83,7 @@ func DefaultEnclaveConfig() *config.EnclaveConfig { MaxRollupSize: 1024 * 64, GasPaymentAddress: gethcommon.HexToAddress("0xd6C9230053f45F873Cb66D8A02439380a37A4fbF"), BaseFee: new(big.Int).SetUint64(1), - GasLimit: new(big.Int).SetUint64(params.MaxGasLimit / 6), + GasLocalExecutionCapFlag: 3_000_000, + GasBatchExecutionLimit: 3_000_000, } } diff --git a/integration/datagenerator/common.go b/integration/datagenerator/common.go index a0d61e5656..22018e8611 100644 --- a/integration/datagenerator/common.go +++ b/integration/datagenerator/common.go @@ -49,7 +49,7 @@ func CreateL2TxData() *types.LegacyTx { nonce, _ := rand.Int(rand.Reader, big.NewInt(math.MaxInt64)) encodedTxData := make([]byte, 0) return &types.LegacyTx{ - Nonce: nonce.Uint64(), Value: big.NewInt(1), Gas: 1, GasPrice: big.NewInt(1), Data: encodedTxData, + Nonce: nonce.Uint64(), Value: big.NewInt(1), Gas: 1, GasPrice: gethcommon.Big1, Data: encodedTxData, } } diff --git a/integration/simulation/devnetwork/node.go b/integration/simulation/devnetwork/node.go index f2922b6f31..e49a734c21 100644 --- a/integration/simulation/devnetwork/node.go +++ b/integration/simulation/devnetwork/node.go @@ -2,7 +2,6 @@ package devnetwork import ( "fmt" - "math/big" "os" gethcommon "github.com/ethereum/go-ethereum/common" @@ -175,14 +174,15 @@ func (n *InMemNodeOperator) createEnclaveContainer() *enclavecontainer.EnclaveCo GenesisJSON: nil, UseInMemoryDB: false, ManagementContractAddress: n.l1Data.MgmtContractAddress, - MinGasPrice: big.NewInt(1), + MinGasPrice: gethcommon.Big1, MessageBusAddress: n.l1Data.MessageBusAddr, SqliteDBPath: n.enclaveDBFilepath, DebugNamespaceEnabled: true, MaxBatchSize: 1024 * 25, MaxRollupSize: 1024 * 64, BaseFee: defaultCfg.BaseFee, // todo @siliev:: fix test transaction builders so this can be different - GasLimit: defaultCfg.GasLimit, + GasBatchExecutionLimit: defaultCfg.GasBatchExecutionLimit, + GasLocalExecutionCapFlag: defaultCfg.GasLocalExecutionCapFlag, GasPaymentAddress: defaultCfg.GasPaymentAddress, } return enclavecontainer.NewEnclaveContainerWithLogger(enclaveConfig, enclaveLogger) diff --git a/integration/simulation/network/network_utils.go b/integration/simulation/network/network_utils.go index 4633975fea..e640cced8a 100644 --- a/integration/simulation/network/network_utils.go +++ b/integration/simulation/network/network_utils.go @@ -6,9 +6,9 @@ import ( "math/big" "time" - "github.com/ten-protocol/go-ten/go/host/l1" - + "github.com/ethereum/go-ethereum/params" "github.com/ten-protocol/go-ten/go/host" + "github.com/ten-protocol/go-ten/go/host/l1" "github.com/ten-protocol/go-ten/go/common" "github.com/ten-protocol/go-ten/go/common/log" @@ -88,13 +88,14 @@ func createInMemObscuroNode( ValidateL1Blocks: validateBlocks, GenesisJSON: genesisJSON, UseInMemoryDB: true, - MinGasPrice: big.NewInt(1), + MinGasPrice: gethcommon.Big1, MessageBusAddress: l1BusAddress, ManagementContractAddress: *mgtContractAddress, MaxBatchSize: 1024 * 25, MaxRollupSize: 1024 * 64, BaseFee: big.NewInt(1), // todo @siliev:: fix test transaction builders so this can be different - GasLimit: big.NewInt(1_000_000_000_000_000_000), + GasLocalExecutionCapFlag: params.MaxGasLimit / 2, + GasBatchExecutionLimit: params.MaxGasLimit / 2, } enclaveLogger := testlog.Logger().New(log.NodeIDKey, id, log.CmpKey, log.EnclaveCmp) diff --git a/integration/simulation/simulation.go b/integration/simulation/simulation.go index e8c697afd2..5fe8c20068 100644 --- a/integration/simulation/simulation.go +++ b/integration/simulation/simulation.go @@ -227,7 +227,7 @@ func (s *Simulation) deployObscuroERC20s() { deployContractTx := types.DynamicFeeTx{ Nonce: NextNonce(s.ctx, s.RPCHandles, owner), - Gas: 1025_000_000, + Gas: 2_000_000, GasFeeCap: gethcommon.Big1, // This field is used to derive the gas price for dynamic fee transactions. Data: contractBytes, GasTipCap: gethcommon.Big1, diff --git a/tools/hardhatdeployer/contract_deployer.go b/tools/hardhatdeployer/contract_deployer.go index d9a5839e95..4b8febd145 100644 --- a/tools/hardhatdeployer/contract_deployer.go +++ b/tools/hardhatdeployer/contract_deployer.go @@ -91,8 +91,8 @@ func (cd *contractDeployer) run() (string, error) { deployContractTx := types.LegacyTx{ Nonce: cd.wallet.GetNonceAndIncrement(), - GasPrice: big.NewInt(2000000000), - Gas: uint64(1025_000_000), + GasPrice: big.NewInt(1), + Gas: uint64(2_000_000), Data: cd.contractCode, }