Skip to content
This repository has been archived by the owner on May 11, 2024. It is now read-only.

Commit

Permalink
feat(proposer): remove --l2.suggestedFeeRecipient flag (#442)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtaikocha committed Nov 2, 2023
1 parent 02c981d commit 405b9ed
Show file tree
Hide file tree
Showing 9 changed files with 0 additions and 43 deletions.
7 changes: 0 additions & 7 deletions cmd/flags/proposer.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@ var (
Required: true,
Category: proposerCategory,
}
L2SuggestedFeeRecipient = &cli.StringFlag{
Name: "l2.suggestedFeeRecipient",
Usage: "Address of the proposed block's suggested fee recipient",
Required: true,
Category: proposerCategory,
}
ProverEndpoints = &cli.StringFlag{
Name: "proverEndpoints",
Usage: "Comma-delineated list of prover endpoints proposer should query when attempting to propose a block",
Expand Down Expand Up @@ -122,7 +116,6 @@ var ProposerFlags = MergeFlags(CommonFlags, []cli.Flag{
L2HTTPEndpoint,
TaikoTokenAddress,
L1ProposerPrivKey,
L2SuggestedFeeRecipient,
ProposeInterval,
TxPoolLocals,
TxPoolLocalsOnly,
Expand Down
1 change: 0 additions & 1 deletion driver/chain_syncer/calldata/syncer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ func (s *CalldataSyncerTestSuite) SetupTest() {
TaikoL2Address: common.HexToAddress(os.Getenv("TAIKO_L2_ADDRESS")),
TaikoTokenAddress: common.HexToAddress(os.Getenv("TAIKO_TOKEN_ADDRESS")),
L1ProposerPrivKey: l1ProposerPrivKey,
L2SuggestedFeeRecipient: common.HexToAddress(os.Getenv("L2_SUGGESTED_FEE_RECIPIENT")),
ProposeInterval: &proposeInterval,
MaxProposedTxListsPerEpoch: 1,
WaitReceiptTimeout: 12 * time.Second,
Expand Down
1 change: 0 additions & 1 deletion driver/chain_syncer/chain_syncer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ func (s *ChainSyncerTestSuite) SetupTest() {
TaikoL2Address: common.HexToAddress(os.Getenv("TAIKO_L2_ADDRESS")),
TaikoTokenAddress: common.HexToAddress(os.Getenv("TAIKO_TOKEN_ADDRESS")),
L1ProposerPrivKey: l1ProposerPrivKey,
L2SuggestedFeeRecipient: common.HexToAddress(os.Getenv("L2_SUGGESTED_FEE_RECIPIENT")),
ProposeInterval: &proposeInterval,
MaxProposedTxListsPerEpoch: 1,
WaitReceiptTimeout: 12 * time.Second,
Expand Down
1 change: 0 additions & 1 deletion driver/driver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ func (s *DriverTestSuite) SetupTest() {
TaikoL2Address: common.HexToAddress(os.Getenv("TAIKO_L2_ADDRESS")),
TaikoTokenAddress: common.HexToAddress(os.Getenv("TAIKO_TOKEN_ADDRESS")),
L1ProposerPrivKey: l1ProposerPrivKey,
L2SuggestedFeeRecipient: common.HexToAddress(os.Getenv("L2_SUGGESTED_FEE_RECIPIENT")),
ProposeInterval: &proposeInterval,
MaxProposedTxListsPerEpoch: 1,
WaitReceiptTimeout: 12 * time.Second,
Expand Down
7 changes: 0 additions & 7 deletions proposer/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ type Config struct {
TaikoL2Address common.Address
TaikoTokenAddress common.Address
L1ProposerPrivKey *ecdsa.PrivateKey
L2SuggestedFeeRecipient common.Address
ExtraData string
ProposeInterval *time.Duration
LocalAddresses []common.Address
Expand Down Expand Up @@ -67,11 +66,6 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) {
proposeEmptyBlocksInterval = &interval
}

l2SuggestedFeeRecipient := c.String(flags.L2SuggestedFeeRecipient.Name)
if !common.IsHexAddress(l2SuggestedFeeRecipient) {
return nil, fmt.Errorf("invalid L2 suggested fee recipient address: %s", l2SuggestedFeeRecipient)
}

localAddresses := []common.Address{}
if c.IsSet(flags.TxPoolLocals.Name) {
for _, account := range strings.Split(c.String(flags.TxPoolLocals.Name), ",") {
Expand Down Expand Up @@ -124,7 +118,6 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) {
TaikoL2Address: common.HexToAddress(c.String(flags.TaikoL2Address.Name)),
TaikoTokenAddress: common.HexToAddress(c.String(flags.TaikoTokenAddress.Name)),
L1ProposerPrivKey: l1ProposerPrivKey,
L2SuggestedFeeRecipient: common.HexToAddress(l2SuggestedFeeRecipient),
ExtraData: c.String(flags.ExtraData.Name),
ProposeInterval: proposingInterval,
LocalAddresses: localAddresses,
Expand Down
23 changes: 0 additions & 23 deletions proposer/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ func (s *ProposerTestSuite) TestNewConfigFromCliContext() {
s.Equal(taikoL2, c.TaikoL2Address.String())
s.Equal(taikoToken, c.TaikoTokenAddress.String())
s.Equal(goldenTouchAddress, crypto.PubkeyToAddress(c.L1ProposerPrivKey.PublicKey))
s.Equal(goldenTouchAddress, c.L2SuggestedFeeRecipient)
s.Equal(float64(10), c.ProposeInterval.Seconds())
s.Equal(1, len(c.LocalAddresses))
s.Equal(goldenTouchAddress, c.LocalAddresses[0])
Expand Down Expand Up @@ -72,7 +71,6 @@ func (s *ProposerTestSuite) TestNewConfigFromCliContext() {
"--" + flags.TaikoL2Address.Name, taikoL2,
"--" + flags.TaikoTokenAddress.Name, taikoToken,
"--" + flags.L1ProposerPrivKey.Name, common.Bytes2Hex(goldenTouchPrivKey.Bytes()),
"--" + flags.L2SuggestedFeeRecipient.Name, goldenTouchAddress.Hex(),
"--" + flags.ProposeInterval.Name, proposeInterval,
"--" + flags.TxPoolLocals.Name, goldenTouchAddress.Hex(),
"--" + flags.ProposeBlockTxReplacementMultiplier.Name, "5",
Expand All @@ -98,25 +96,7 @@ func (s *ProposerTestSuite) TestNewConfigFromCliContextPrivKeyErr() {
}), "invalid L1 proposer private key")
}

func (s *ProposerTestSuite) TestNewConfigFromCliContextL2RecipErr() {
goldenTouchPrivKey, err := s.RpcClient.TaikoL2.GOLDENTOUCHPRIVATEKEY(nil)
s.Nil(err)

app := s.SetupApp()

s.ErrorContains(app.Run([]string{
"TestNewConfigFromCliContextL2RecipErr",
"--" + flags.L1ProposerPrivKey.Name, common.Bytes2Hex(goldenTouchPrivKey.Bytes()),
"--" + flags.ProposeInterval.Name, proposeInterval,
"--" + flags.ProposeEmptyBlocksInterval.Name, proposeInterval,
"--" + flags.L2SuggestedFeeRecipient.Name, "notAnAddress",
}), "invalid L2 suggested fee recipient address")
}

func (s *ProposerTestSuite) TestNewConfigFromCliContextTxPoolLocalsErr() {
goldenTouchAddress, err := s.RpcClient.TaikoL2.GOLDENTOUCHADDRESS(nil)
s.Nil(err)

goldenTouchPrivKey, err := s.RpcClient.TaikoL2.GOLDENTOUCHPRIVATEKEY(nil)
s.Nil(err)

Expand All @@ -127,7 +107,6 @@ func (s *ProposerTestSuite) TestNewConfigFromCliContextTxPoolLocalsErr() {
"--" + flags.L1ProposerPrivKey.Name, common.Bytes2Hex(goldenTouchPrivKey.Bytes()),
"--" + flags.ProposeInterval.Name, proposeInterval,
"--" + flags.ProposeEmptyBlocksInterval.Name, proposeInterval,
"--" + flags.L2SuggestedFeeRecipient.Name, goldenTouchAddress.Hex(),
"--" + flags.TxPoolLocals.Name, "notAnAddress",
}), "invalid account in --txpool.locals")
}
Expand All @@ -146,7 +125,6 @@ func (s *ProposerTestSuite) TestNewConfigFromCliContextReplMultErr() {
"--" + flags.L1ProposerPrivKey.Name, common.Bytes2Hex(goldenTouchPrivKey.Bytes()),
"--" + flags.ProposeInterval.Name, proposeInterval,
"--" + flags.ProposeEmptyBlocksInterval.Name, proposeInterval,
"--" + flags.L2SuggestedFeeRecipient.Name, goldenTouchAddress.Hex(),
"--" + flags.TxPoolLocals.Name, goldenTouchAddress.Hex(),
"--" + flags.ProposeBlockTxReplacementMultiplier.Name, "0",
}), "invalid --proposeBlockTxReplacementMultiplier value")
Expand All @@ -161,7 +139,6 @@ func (s *ProposerTestSuite) SetupApp() *cli.App {
&cli.StringFlag{Name: flags.TaikoL2Address.Name},
&cli.StringFlag{Name: flags.TaikoTokenAddress.Name},
&cli.StringFlag{Name: flags.L1ProposerPrivKey.Name},
&cli.StringFlag{Name: flags.L2SuggestedFeeRecipient.Name},
&cli.DurationFlag{Name: flags.ProposeEmptyBlocksInterval.Name},
&cli.DurationFlag{Name: flags.ProposeInterval.Name},
&cli.StringFlag{Name: flags.TxPoolLocals.Name},
Expand Down
1 change: 0 additions & 1 deletion proposer/proposer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ func (s *ProposerTestSuite) SetupTest() {
TaikoL2Address: common.HexToAddress(os.Getenv("TAIKO_L2_ADDRESS")),
TaikoTokenAddress: common.HexToAddress(os.Getenv("TAIKO_TOKEN_ADDRESS")),
L1ProposerPrivKey: l1ProposerPrivKey,
L2SuggestedFeeRecipient: common.HexToAddress(os.Getenv("L2_SUGGESTED_FEE_RECIPIENT")),
ProposeInterval: &proposeInterval,
MaxProposedTxListsPerEpoch: 1,
ProposeBlockTxReplacementMultiplier: 2,
Expand Down
1 change: 0 additions & 1 deletion prover/proof_submitter/proof_submitter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ func (s *ProofSubmitterTestSuite) SetupTest() {
TaikoL2Address: common.HexToAddress(os.Getenv("TAIKO_L2_ADDRESS")),
TaikoTokenAddress: common.HexToAddress(os.Getenv("TAIKO_TOKEN_ADDRESS")),
L1ProposerPrivKey: l1ProposerPrivKey,
L2SuggestedFeeRecipient: common.HexToAddress(os.Getenv("L2_SUGGESTED_FEE_RECIPIENT")),
ProposeInterval: &proposeInterval,
MaxProposedTxListsPerEpoch: 1,
WaitReceiptTimeout: 12 * time.Second,
Expand Down
1 change: 0 additions & 1 deletion prover/prover_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ func (s *ProverTestSuite) SetupTest() {
TaikoL1Address: common.HexToAddress(os.Getenv("TAIKO_L1_ADDRESS")),
TaikoL2Address: common.HexToAddress(os.Getenv("TAIKO_L2_ADDRESS")),
TaikoTokenAddress: common.HexToAddress(os.Getenv("TAIKO_TOKEN_ADDRESS")),
L2SuggestedFeeRecipient: common.HexToAddress(os.Getenv("L2_SUGGESTED_FEE_RECIPIENT")),
L1ProposerPrivKey: l1ProposerPrivKey,
ProposeInterval: &proposeInterval,
MaxProposedTxListsPerEpoch: 1,
Expand Down

0 comments on commit 405b9ed

Please sign in to comment.