Skip to content

Commit dee8244

Browse files
committed
Add MaxTxSize check to ValidateExpressLaneTx()
1 parent 1420803 commit dee8244

File tree

8 files changed

+158
-135
lines changed

8 files changed

+158
-135
lines changed

cmd/el-proxy/config.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313

1414
"github.com/offchainlabs/nitro/cmd/conf"
1515
"github.com/offchainlabs/nitro/cmd/genericconf"
16+
"github.com/offchainlabs/nitro/execution/gethexec"
1617
"github.com/offchainlabs/nitro/util/colors"
1718
)
1819

@@ -31,6 +32,7 @@ type ExpressLaneProxyConfig struct {
3132
HTTP genericconf.HTTPConfig `koanf:"http"`
3233
WS genericconf.WSConfig `koanf:"ws"`
3334
IPC genericconf.IPCConfig `koanf:"ipc"`
35+
MaxTxDataSize uint64 `koanf:"max-tx-data-size" reload:"hot"`
3436
Metrics bool `koanf:"metrics"`
3537
MetricsServer genericconf.MetricsServerConfig `koanf:"metrics-server"`
3638
PProf bool `koanf:"pprof"`
@@ -72,6 +74,7 @@ var ExpressLaneProxyConfigDefault = ExpressLaneProxyConfig{
7274
HTTP: HTTPConfigDefault,
7375
WS: WSConfigDefault,
7476
IPC: IPCConfigDefault,
77+
MaxTxDataSize: uint64(gethexec.DefaultSequencerConfig.MaxTxDataSize),
7578
Metrics: false,
7679
MetricsServer: genericconf.MetricsServerConfigDefault,
7780
PProf: false,
@@ -94,6 +97,7 @@ func ExpressLaneProxyConfigAddOptions(f *pflag.FlagSet) {
9497
genericconf.HTTPConfigAddOptions("http", f)
9598
genericconf.WSConfigAddOptions("ws", f)
9699
genericconf.IPCConfigAddOptions("ipc", f)
100+
f.Uint64("max-tx-data-size", ExpressLaneProxyConfigDefault.MaxTxDataSize, "maximum transaction size the sequencer will accept")
97101
f.Bool("metrics", ExpressLaneProxyConfigDefault.Metrics, "enable metrics")
98102
genericconf.MetricsServerAddOptions("metrics-server", f)
99103
f.Bool("pprof", ExpressLaneProxyConfigDefault.PProf, "enable pprof")
@@ -143,6 +147,9 @@ func (c *ExpressLaneProxyConfig) GetReloadInterval() time.Duration {
143147
}
144148

145149
func (c *ExpressLaneProxyConfig) Validate() error {
150+
if err := gethexec.ValidateMaxTxDataSize(c.MaxTxDataSize); err != nil {
151+
return err
152+
}
146153
return nil
147154
}
148155

cmd/el-proxy/main.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,15 +121,19 @@ func NewExpressLaneProxy(
121121
return nil, err
122122
}
123123

124-
expressLaneTracker := gethexec.NewExpressLaneTracker(
124+
expressLaneTracker, err := gethexec.NewExpressLaneTracker(
125125
*roundTimingInfo,
126126
time.Millisecond*250,
127127
&HeaderProviderAdapter{arbClient},
128128
auctionContract,
129129
auctionContractAddr,
130130
&params.ChainConfig{ChainID: big.NewInt(config.ChainId)},
131+
config.MaxTxDataSize,
131132
0,
132133
)
134+
if err != nil {
135+
return nil, fmt.Errorf("error creating express lane tracker: %w", err)
136+
}
133137

134138
_, dataSignerFunc, err := util.OpenWallet("el-proxy", &config.Wallet, big.NewInt(config.ChainId))
135139
if err != nil {

0 commit comments

Comments
 (0)