diff --git a/cmd/geth/main.go b/cmd/geth/main.go index 2f7d37fdd7e7..a94a49ea7daf 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -146,6 +146,7 @@ var ( configFileFlag, utils.LogDebugFlag, utils.LogBacktraceAtFlag, + utils.ZeroFeeAddressesFlag, }, utils.NetworkFlags, utils.DatabaseFlags) rpcFlags = []cli.Flag{ diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 66102f3092b6..2a74c1fd4de8 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -497,10 +497,9 @@ var ( Category: flags.VMCategory, } - ZeroFeeAddressesFlag = &cli.StringFlag{ - Name: "zeroofeeaddresses", + ZeroFeeAddressesFlag = &cli.StringSliceFlag{ + Name: "zero-fee-addresses", Usage: "Comma separated list of addresses that are allowed to send transactions with zero fees", - Value: "", Category: flags.VMCategory, } // API options. @@ -2128,9 +2127,11 @@ func MakeChain(ctx *cli.Context, stack *node.Node, readonly bool) (*core.BlockCh vmcfg := vm.Config{EnablePreimageRecording: ctx.Bool(VMEnableDebugFlag.Name)} if ctx.IsSet(ZeroFeeAddressesFlag.Name) { - addressStrings := strings.Split(ctx.String(ZeroFeeAddressesFlag.Name), ",") - for _, addr := range addressStrings { - vmcfg.ZeroFeeAddresses = append(vmcfg.ZeroFeeAddresses, common.HexToAddress(strings.TrimSpace(addr))) + for _, addr := range ctx.StringSlice(ZeroFeeAddressesFlag.Name) { + vmcfg.ZeroFeeAddresses = append( + vmcfg.ZeroFeeAddresses, + common.HexToAddress(strings.TrimSpace(addr)), + ) } } // Disable transaction indexing/unindexing by default. diff --git a/geth-poa/entrypoint.sh b/geth-poa/entrypoint.sh index f29a92de6c15..53415f869dd1 100644 --- a/geth-poa/entrypoint.sh +++ b/geth-poa/entrypoint.sh @@ -12,6 +12,7 @@ GETH_DATA_DIR=${GETH_DATA_DIR:-/data} GETH_CHAINDATA_DIR="$GETH_DATA_DIR/geth/chaindata" GETH_KEYSTORE_DIR="$GETH_DATA_DIR/keystore" GETH_KEYSTORE_PASSWORD=${GETH_KEYSTORE_PASSWORD:-"primev"} +GETH_ZERO_FEE_ADDRESSES=${GETH_ZERO_FEE_ADDRESSES:-} CHAIN_ID=$(cat "$GENESIS_L1_PATH" | jq -r .config.chainId) RPC_PORT="${RPC_PORT:-8545}" WS_PORT="${WS_PORT:-8546}" @@ -23,6 +24,12 @@ else LOG_TAGS_OPTION="" fi +if [ -n "$GETH_ZERO_FEE_ADDRESSES" ]; then + ZERO_FEE_ADDRESSES="--zero-fee-addresses=$GETH_ZERO_FEE_ADDRESSES" +else + ZERO_FEE_ADDRESSES="" +fi + # Generate signer key if needed if [ "$GETH_NODE_TYPE" = "signer" ]; then if [ ! -f "$GETH_DATA_DIR/password" ]; then @@ -94,6 +101,7 @@ if [ "$GETH_NODE_TYPE" = "bootnode" ]; then --verbosity="$GETH_VERBOSITY" \ --log.format="$GETH_LOG_FORMAT" \ $LOG_TAGS_OPTION \ + $ZERO_FEE_ADDRESSES \ --datadir="$GETH_DATA_DIR" \ --port 30301 \ --http \ @@ -138,6 +146,7 @@ elif [ "$GETH_NODE_TYPE" = "signer" ]; then --verbosity="$GETH_VERBOSITY" \ --log.format="$GETH_LOG_FORMAT" \ $LOG_TAGS_OPTION \ + $ZERO_FEE_ADDRESSES \ --datadir="$GETH_DATA_DIR" \ --port="$GETH_PORT" \ --syncmode="${GETH_SYNC_MODE}" \ @@ -190,6 +199,7 @@ elif [ "$GETH_NODE_TYPE" = "member" ]; then --verbosity="$GETH_VERBOSITY" \ --log.format="$GETH_LOG_FORMAT" \ $LOG_TAGS_OPTION \ + $ZERO_FEE_ADDRESSES \ --datadir="$GETH_DATA_DIR" \ --port="$GETH_PORT" \ --syncmode="${GETH_SYNC_MODE}" \