Skip to content

Commit b9b021f

Browse files
feat: add minimum-gas-tip-cap flag
1 parent ab07500 commit b9b021f

12 files changed

Lines changed: 27 additions & 10 deletions

File tree

cmd/bee/cmd/cmd.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ const (
8181
optionMinimumStorageRadius = "minimum-storage-radius"
8282
optionReserveCapacityDoubling = "reserve-capacity-doubling"
8383
optionSkipPostageSnapshot = "skip-postage-snapshot"
84+
optionNameMinimumGasTipCap = "minimum-gas-tip-cap"
8485
)
8586

8687
// nolint:gochecknoinits
@@ -290,6 +291,7 @@ func (c *command) setAllFlags(cmd *cobra.Command) {
290291
cmd.Flags().Uint(optionMinimumStorageRadius, 0, "minimum radius storage threshold")
291292
cmd.Flags().Int(optionReserveCapacityDoubling, 0, "reserve capacity doubling")
292293
cmd.Flags().Bool(optionSkipPostageSnapshot, false, "skip postage snapshot")
294+
cmd.Flags().Uint64(optionNameMinimumGasTipCap, 0, "minimum gas tip cap in wei for transactions, 0 means use suggested gas tip cap")
293295
}
294296

295297
func newLogger(cmd *cobra.Command, verbosity string) (log.Logger, error) {

cmd/bee/cmd/deploy.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ func (c *command) initDeployCmd() error {
5959
signer,
6060
blocktime,
6161
true,
62+
c.config.GetUint64(optionNameMinimumGasTipCap),
6263
)
6364
if err != nil {
6465
return err

cmd/bee/cmd/start.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,7 @@ func buildBeeNode(ctx context.Context, c *command, cmd *cobra.Command, logger lo
299299
EnableWS: c.config.GetBool(optionNameP2PWSEnable),
300300
FullNodeMode: fullNode,
301301
Logger: logger,
302+
MinimumGasTipCap: c.config.GetUint64(optionNameMinimumGasTipCap),
302303
MinimumStorageRadius: c.config.GetUint(optionMinimumStorageRadius),
303304
MutexProfile: c.config.GetBool(optionNamePProfMutex),
304305
NATAddr: c.config.GetString(optionNameNATAddr),

packaging/bee.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ data-dir: "/var/lib/bee"
3838
# help: false
3939
## triggers connect to main net bootnodes.
4040
# mainnet: true
41+
## minimum gas tip cap in wei for transactions, 0 means use suggested gas tip cap
42+
# minimum-gas-tip-cap: 0
4143
## minimum radius storage threshold
4244
# minimum-storage-radius: "0"
4345
## NAT exposed address

packaging/homebrew-amd64/bee.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ data-dir: "/usr/local/var/lib/swarm-bee"
3838
# help: false
3939
## triggers connect to main net bootnodes.
4040
# mainnet: true
41+
## minimum gas tip cap in wei for transactions, 0 means use suggested gas tip cap
42+
# minimum-gas-tip-cap: 0
4143
## minimum radius storage threshold
4244
# minimum-storage-radius: "0"
4345
## NAT exposed address

packaging/homebrew-arm64/bee.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ data-dir: "/opt/homebrew/var/lib/swarm-bee"
3838
# help: false
3939
## triggers connect to main net bootnodes.
4040
# mainnet: true
41+
## minimum gas tip cap in wei for transactions, 0 means use suggested gas tip cap
42+
# minimum-gas-tip-cap: 0
4143
## minimum radius storage threshold
4244
# minimum-storage-radius: "0"
4345
## NAT exposed address

packaging/scoop/bee.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ data-dir: "./data"
3838
# help: false
3939
## triggers connect to main net bootnodes.
4040
# mainnet: true
41+
## minimum gas tip cap in wei for transactions, 0 means use suggested gas tip cap
42+
# minimum-gas-tip-cap: 0
4143
## minimum radius storage threshold
4244
# minimum-storage-radius: "0"
4345
## NAT exposed address

pkg/node/chain.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ func InitChain(
5353
signer crypto.Signer,
5454
pollingInterval time.Duration,
5555
chainEnabled bool,
56+
minimumGasTipCap uint64,
5657
) (transaction.Backend, common.Address, int64, transaction.Monitor, transaction.Service, error) {
5758
var backend transaction.Backend = &noOpChainBackend{
5859
chainID: oChainID,
@@ -74,7 +75,7 @@ func InitChain(
7475

7576
logger.Info("connected to blockchain backend", "version", versionString)
7677

77-
backend = wrapped.NewBackend(ethclient.NewClient(rpcClient))
78+
backend = wrapped.NewBackend(ethclient.NewClient(rpcClient), minimumGasTipCap)
7879
}
7980

8081
chainID, err := backend.ChainID(ctx)

pkg/node/node.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ type Options struct {
145145
EnableWS bool
146146
FullNodeMode bool
147147
Logger log.Logger
148+
MinimumGasTipCap uint64
148149
MinimumStorageRadius uint
149150
MutexProfile bool
150151
NATAddr string
@@ -390,7 +391,9 @@ func NewBee(
390391
o.ChainID,
391392
signer,
392393
o.BlockTime,
393-
chainEnabled)
394+
chainEnabled,
395+
o.MinimumGasTipCap,
396+
)
394397
if err != nil {
395398
return nil, fmt.Errorf("init chain: %w", err)
396399
}

pkg/transaction/transaction.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ var (
4444
)
4545

4646
const (
47-
MinimumGasTipCap = 1_500_000_000 // 1.5 Gwei
4847
DefaultGasLimit = 1_000_000
4948
DefaultTipBoostPercent = 25
5049
)

0 commit comments

Comments
 (0)