Skip to content

Commit

Permalink
proposer: fix da rpc, estimate gas
Browse files Browse the repository at this point in the history
  • Loading branch information
tuxcanfly committed Apr 28, 2023
1 parent 82d4fee commit 884fd58
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
7 changes: 7 additions & 0 deletions op-proposer/flags/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ var (
"creating a new batch",
EnvVar: opservice.PrefixEnvVar(envVarPrefix, "POLL_INTERVAL"),
}
DaRpcFlag = cli.StringFlag{
Name: "da-rpc",
Usage: "HTTP provider URL for DA node",
Required: true,
EnvVar: opservice.PrefixEnvVar(envVarPrefix, "DA_RPC"),
}
// Optional flags
AllowNonFinalizedFlag = cli.BoolFlag{
Name: "allow-non-finalized",
Expand All @@ -53,6 +59,7 @@ var requiredFlags = []cli.Flag{
RollupRpcFlag,
L2OOAddressFlag,
PollIntervalFlag,
DaRpcFlag,
}

var optionalFlags = []cli.Flag{
Expand Down
8 changes: 5 additions & 3 deletions op-proposer/proposer/l2_output_submitter.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,9 +328,11 @@ func (l *L2OutputSubmitter) sendTransaction(ctx context.Context, output *eth.Out
return err
}
receipt, err := l.txMgr.Send(ctx, txmgr.TxCandidate{
TxData: data,
To: &l.l2ooContractAddr,
GasLimit: 0,
TxData: data,
To: &l.l2ooContractAddr,
// Use manual limit as proposer tx data may be to small
// t=2023-04-28T00:59:37+0000 lvl=warn msg="estimating gas" service=proposer gas=87698
GasLimit: 100000,
})
if err != nil {
return err
Expand Down
1 change: 1 addition & 0 deletions op-service/txmgr/txmgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ func (m *SimpleTxManager) craftTx(ctx context.Context, candidate TxCandidate) (*
GasTipCap: gasTipCap,
Data: rawTx.Data,
})
m.l.Warn("estimating gas", "candidate", candidate, "gasFeeCap", gasFeeCap, "gasTipCap", gasTipCap, "err", err)
if err != nil {
return nil, fmt.Errorf("failed to estimate gas: %w", err)
}
Expand Down
1 change: 1 addition & 0 deletions ops-bedrock/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ services:
OP_PROPOSER_METRICS_ENABLED: "true"
OP_PROPOSER_ALLOW_NON_FINALIZED: "true"
OP_PROPOSER_NAMESPACE_ID: "e8e5f679bf7116cb"
OP_PROPOSER_DA_RPC: http://da:26659

op-batcher:
depends_on:
Expand Down

0 comments on commit 884fd58

Please sign in to comment.