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

Commit

Permalink
feat(proposer): add flag for adding tip to assignmenthook (#540)
Browse files Browse the repository at this point in the history
  • Loading branch information
RogerLamTd authored Feb 1, 2024
1 parent 229848d commit 4619778
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 1 deletion.
7 changes: 7 additions & 0 deletions cmd/flags/proposer.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,12 @@ var (
Value: false,
Category: proposerCategory,
}
L1BlockBuilderTip = &cli.Uint64Flag{
Name: "l1BlockBuilderTip",
Usage: "Amount you wish to tip the L1 block builder",
Value: 0,
Category: proposerCategory,
}
)

// ProposerFlags All proposer flags.
Expand All @@ -147,4 +153,5 @@ var ProposerFlags = MergeFlags(CommonFlags, []cli.Flag{
MaxTierFeePriceBumps,
ProposeBlockIncludeParentMetaHash,
ProposerAssignmentHookAddress,
L1BlockBuilderTip,
})
1 change: 1 addition & 0 deletions driver/chain_syncer/calldata/syncer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ func (s *CalldataSyncerTestSuite) SetupTest() {
SgxAndPseZkevmTierFee: common.Big256,
MaxTierFeePriceBumps: 3,
TierFeePriceBump: common.Big2,
L1BlockBuilderTip: common.Big0,
}))

s.p = prop
Expand Down
1 change: 1 addition & 0 deletions driver/chain_syncer/chain_syncer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ func (s *ChainSyncerTestSuite) SetupTest() {
MaxTierFeePriceBumps: 3,
TierFeePriceBump: common.Big2,
ExtraData: "test",
L1BlockBuilderTip: common.Big0,
}))

s.p = prop
Expand Down
1 change: 1 addition & 0 deletions driver/driver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ func (s *DriverTestSuite) SetupTest() {
SgxAndPseZkevmTierFee: common.Big256,
MaxTierFeePriceBumps: 3,
TierFeePriceBump: common.Big2,
L1BlockBuilderTip: common.Big0,
}))
s.p = p
}
Expand Down
2 changes: 2 additions & 0 deletions proposer/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ type Config struct {
TierFeePriceBump *big.Int
MaxTierFeePriceBumps uint64
IncludeParentMetaHash bool
L1BlockBuilderTip *big.Int
}

// NewConfigFromCliContext initializes a Config instance from
Expand Down Expand Up @@ -126,5 +127,6 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) {
TierFeePriceBump: new(big.Int).SetUint64(c.Uint64(flags.TierFeePriceBump.Name)),
MaxTierFeePriceBumps: c.Uint64(flags.MaxTierFeePriceBumps.Name),
IncludeParentMetaHash: c.Bool(flags.ProposeBlockIncludeParentMetaHash.Name),
L1BlockBuilderTip: new(big.Int).SetUint64(c.Uint64(flags.L1BlockBuilderTip.Name)),
}, nil
}
2 changes: 1 addition & 1 deletion proposer/proposer.go
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ func (p *Proposer) sendProposeBlockTx(
// TODO: flag for additional hook addresses and data.
hookInputData, err := encoding.EncodeAssignmentHookInput(&encoding.AssignmentHookInput{
Assignment: assignment,
Tip: common.Big0, // TODO: flag for tip
Tip: p.L1BlockBuilderTip,
})
if err != nil {
return nil, err
Expand Down
1 change: 1 addition & 0 deletions proposer/proposer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ func (s *ProposerTestSuite) SetupTest() {
TierFeePriceBump: common.Big2,
MaxTierFeePriceBumps: 3,
ExtraData: "test",
L1BlockBuilderTip: common.Big0,
}))

s.p = p
Expand Down
1 change: 1 addition & 0 deletions prover/proof_submitter/proof_submitter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ func (s *ProofSubmitterTestSuite) SetupTest() {
SgxAndPseZkevmTierFee: common.Big256,
MaxTierFeePriceBumps: 3,
TierFeePriceBump: common.Big2,
L1BlockBuilderTip: common.Big0,
}))

s.proposer = prop
Expand Down
1 change: 1 addition & 0 deletions prover/prover_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ func (s *ProverTestSuite) SetupTest() {
SgxAndPseZkevmTierFee: common.Big256,
MaxTierFeePriceBumps: 3,
TierFeePriceBump: common.Big2,
L1BlockBuilderTip: common.Big0,
}))

s.proposer = prop
Expand Down

0 comments on commit 4619778

Please sign in to comment.