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

Commit

Permalink
add flag for adding tip to assignmenthook
Browse files Browse the repository at this point in the history
  • Loading branch information
RogerLamTd committed Jan 31, 2024
1 parent 9fa5ab6 commit 6acc22a
Show file tree
Hide file tree
Showing 4 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,
})
7 changes: 7 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 @@ -87,6 +88,11 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) {
proposeBlockTxGasTipCap = new(big.Int).SetUint64(c.Uint64(flags.ProposeBlockTxGasTipCap.Name))
}

// var l1BlockBuilderTip *big.Int
// if c.IsSet(flags.L1BlockBuilderTip.Name) {
// l1BlockBuilderTip = new(big.Int).SetUint64(c.Uint64(flags.L1BlockBuilderTip.Name))
// }

var proverEndpoints []*url.URL
for _, e := range strings.Split(c.String(flags.ProverEndpoints.Name), ",") {
endpoint, err := url.Parse(e)
Expand Down Expand Up @@ -126,5 +132,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

0 comments on commit 6acc22a

Please sign in to comment.