From 4b2da3eaa17b012b2f104dea8a151ee037e51794 Mon Sep 17 00:00:00 2001 From: sergerad Date: Tue, 1 Apr 2025 14:23:14 +1300 Subject: [PATCH] Update snap sync script to work with testnet --- .github/scripts/bootstrap_snap_sync.sh | 12 +++- .github/scripts/{dev.toml => devnet.toml} | 0 .github/scripts/testnet.toml | 87 +++++++++++++++++++++++ cmd/geth/immutable/node/node.go | 6 +- 4 files changed, 99 insertions(+), 6 deletions(-) rename .github/scripts/{dev.toml => devnet.toml} (100%) create mode 100644 .github/scripts/testnet.toml diff --git a/.github/scripts/bootstrap_snap_sync.sh b/.github/scripts/bootstrap_snap_sync.sh index 8cb7c4ef7..b8c2bfb25 100755 --- a/.github/scripts/bootstrap_snap_sync.sh +++ b/.github/scripts/bootstrap_snap_sync.sh @@ -15,14 +15,20 @@ _exit() { } trap _exit EXIT +env="$1" +if [ -z "$env" ]; then + echo "env name (devnet, testnet, mainnet) must be specified as argument" + exit 1 +fi + # Set the env var to enable long range sync export GETH_FLAG_IMMUTABLE_LONG_RANGE_SYNC="1" ./build/bin/geth immutable bootstrap local \ ---env devnet \ +--env "$env" \ --syncmode snap \ ---gcmode full \ ---config ./.github/scripts/dev.toml \ +--gcmode archive \ +--config "./.github/scripts/$env.toml" \ --boots "0" \ --rpcs "1" \ --validators "0" diff --git a/.github/scripts/dev.toml b/.github/scripts/devnet.toml similarity index 100% rename from .github/scripts/dev.toml rename to .github/scripts/devnet.toml diff --git a/.github/scripts/testnet.toml b/.github/scripts/testnet.toml new file mode 100644 index 000000000..25fdc275d --- /dev/null +++ b/.github/scripts/testnet.toml @@ -0,0 +1,87 @@ +[Eth] +NetworkId = 13473 +SyncMode = "snap" +EthDiscoveryURLs = [] +SnapDiscoveryURLs = [] +NoPruning = true +NoPrefetch = false +TxLookupLimit = 2350000 +TransactionHistory = 2350000 +StateScheme = "hash" +DatabaseCache = 512 +DatabaseFreezer = "" +TrieCleanCache = 256 +TrieDirtyCache = 256 +TrieTimeout = 3600000000000 +SnapshotCache = 64 +Preimages = false +FilterLogCacheSize = 32 +EnablePreimageRecording = false +RPCGasCap = 50000000 +RPCEVMTimeout = 5000000000 +RPCTxFeeCap = 0e+00 + +[Eth.Miner] +GasFloor = 0 +GasCeil = 30000000 +GasPrice = 10000000000 +Recommit = 999999999000000000 +NewPayloadTimeout = 2000000000 + +[Eth.TxPool] +Locals = [] +NoLocals = true +Journal = "transactions.rlp" +Rejournal = 3600000000000 +PriceLimit = 10000000000 +PriceBump = 10 +AccountSlots = 16 +GlobalSlots = 5120 +AccountQueue = 64 +GlobalQueue = 1024 +Lifetime = 3600000000000 + +[Eth.BlobPool] +Datadir = "blobpool" +Datacap = 1 +PriceBump = 100 + +[Eth.GPO] +Blocks = 120 +Percentile = 60 +MaxHeaderHistory = 1024 +MaxBlockHistory = 1024 +MaxPrice = 500000000000 +IgnorePrice = 2 + +[Node] +DataDir = "" +IPCPath = "geth.ipc" +HTTPHost = "" +HTTPModules = [] +WSHost = "" +WSModules = [] +AllowUnprotectedTxs = true + +[Node.P2P] +MaxPeers = 100 +NoDiscovery = true +StaticNodes = [ + "enode://92d767213118c6c5986eff443f82b8d6b2db284b2cadadd309c96d3b49cc8ded5f2ca05712f5301f392e937dbdfff50812c09875fb54d066e7a2f7b8bbd0c3fb@partner-public-0.p2p.testnet.immutable.com:30300", + "enode://7abec29f54c9e6bbf3c2cc124734d154e1cbf08c5890446a6438108581e89cef3932603e2412c299bb33892f5d08e87264f293e55703df2aace9e8e9c9958b06@partner-public-1.p2p.testnet.immutable.com:30300", + "enode://eca30e8fddb285c5a388279bad8f5a52975ee16f198b527db9de7763994cdb150801d5ca3391cfd3716fdc8f55f18d12122178c7fecf03868bfdcf481311ccd7@partner-public-2.p2p.testnet.immutable.com:30300", +] +TrustedNodes = [ + "enode://92d767213118c6c5986eff443f82b8d6b2db284b2cadadd309c96d3b49cc8ded5f2ca05712f5301f392e937dbdfff50812c09875fb54d066e7a2f7b8bbd0c3fb@partner-public-0.p2p.testnet.immutable.com:30300", + "enode://7abec29f54c9e6bbf3c2cc124734d154e1cbf08c5890446a6438108581e89cef3932603e2412c299bb33892f5d08e87264f293e55703df2aace9e8e9c9958b06@partner-public-1.p2p.testnet.immutable.com:30300", + "enode://eca30e8fddb285c5a388279bad8f5a52975ee16f198b527db9de7763994cdb150801d5ca3391cfd3716fdc8f55f18d12122178c7fecf03868bfdcf481311ccd7@partner-public-2.p2p.testnet.immutable.com:30300", +] +ListenAddr = "" +DiscAddr = "" +EnableMsgEvents = false + +[Node.HTTPTimeouts] +ReadTimeout = 0 +ReadHeaderTimeout = 0 +WriteTimeout = 0 +IdleTimeout = 0 diff --git a/cmd/geth/immutable/node/node.go b/cmd/geth/immutable/node/node.go index c8949d59f..e80ccc54c 100644 --- a/cmd/geth/immutable/node/node.go +++ b/cmd/geth/immutable/node/node.go @@ -49,9 +49,9 @@ type Options struct { // Config contains the configuration relevant for all nodes type Config struct { - Network settings.Network - ConfigFilepath string - BlockListFilepath string + Network settings.Network + ConfigFilepath string + BlockListFilepath string } // Node is a runnable geth node that is produced by the LocalBootstrapper.