Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(taiko-client): initialize private mempool transaction sender in InitFromConfig #18005

Merged
merged 2 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions packages/taiko-client/cmd/flags/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ var (
Category: commonCategory,
EnvVars: []string{"L1_WS"},
}
L1PrivateTxEndpoint = &cli.StringFlag{
Name: "l1.privateTx",
Usage: "RPC endpoint of a L1 private tx ethereum node",
L1PrivateEndpoint = &cli.StringFlag{
Name: "l1.private",
Usage: "RPC endpoint of a L1 node with private mempool",
Category: commonCategory,
EnvVars: []string{"L1_PRIVATE_TX"},
EnvVars: []string{"L1_PRIVATE"},
}
L2WSEndpoint = &cli.StringFlag{
Name: "l2.ws",
Expand Down Expand Up @@ -173,7 +173,7 @@ var CommonFlags = []cli.Flag{
BackOffMaxRetries,
BackOffRetryInterval,
RPCTimeout,
L1PrivateTxEndpoint,
L1PrivateEndpoint,
}

// MergeFlags merges the given flag slices.
Expand Down
2 changes: 1 addition & 1 deletion packages/taiko-client/proposer/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) {
c,
),
PrivateTxmgrConfigs: pkgFlags.InitTxmgrConfigsFromCli(
c.String(flags.L1PrivateTxEndpoint.Name),
c.String(flags.L1PrivateEndpoint.Name),
l1ProposerPrivKey,
c,
),
Expand Down
13 changes: 12 additions & 1 deletion packages/taiko-client/proposer/proposer.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ type Proposer struct {
wg sync.WaitGroup
}

// InitFromCli New initializes the given proposer instance based on the command line flags.
// InitFromCli initializes the given proposer instance based on the command line flags.
func (p *Proposer) InitFromCli(ctx context.Context, c *cli.Context) error {
cfg, err := NewConfigFromCliContext(c)
if err != nil {
Expand Down Expand Up @@ -104,6 +104,17 @@ func (p *Proposer) InitFromConfig(
}
}

if privateTxMgr == nil && cfg.PrivateTxmgrConfigs != nil && len(cfg.PrivateTxmgrConfigs.L1RPCURL) > 0 {
if privateTxMgr, err = txmgr.NewSimpleTxManager(
"privateMempoolProposer",
log.Root(),
&metrics.TxMgrMetrics,
*cfg.PrivateTxmgrConfigs,
); err != nil {
return err
}
}

p.txmgrSelector = utils.NewTxMgrSelector(txMgr, privateTxMgr, nil)

chainConfig := config.NewChainConfig(p.protocolConfigs)
Expand Down
2 changes: 1 addition & 1 deletion packages/taiko-client/prover/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) {
c,
),
PrivateTxmgrConfigs: pkgFlags.InitTxmgrConfigsFromCli(
c.String(flags.L1PrivateTxEndpoint.Name),
c.String(flags.L1PrivateEndpoint.Name),
l1ProverPrivKey,
c,
),
Expand Down
2 changes: 1 addition & 1 deletion packages/taiko-client/prover/prover.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ func InitFromConfig(
} else {
if cfg.PrivateTxmgrConfigs != nil && len(cfg.PrivateTxmgrConfigs.L1RPCURL) > 0 {
if p.privateTxmgr, err = txmgr.NewSimpleTxManager(
"privateTxProver",
"privateMempoolProver",
log.Root(),
&metrics.TxMgrMetrics,
*cfg.PrivateTxmgrConfigs,
Expand Down
Loading