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

Add L1 data fee when estimating mining transaction profit #360

Merged
merged 17 commits into from
Feb 11, 2025
Prev Previous commit
Next Next commit
test
syntrust committed Jan 23, 2025
commit cace59d4e9c22ceb3abacff66929e3a59ac18dbc
16 changes: 15 additions & 1 deletion ethstorage/miner/l1_mining_api_test.go
Original file line number Diff line number Diff line change
@@ -206,7 +206,21 @@ func Test_l1MiningAPI_checkGasPrice(t *testing.T) {
reward: new(big.Int).Exp(big.NewInt(10), big.NewInt(17), nil), // 0.1 eth
rewardErr: nil,
wantDropped: false,
wantGasFeeCap: new(big.Int).SetInt64(200000000000),
wantGasFeeCap: new(big.Int).Mul(big.NewInt(200), gwei),
},
{
name: "Sepolia: relax the gas price until minimal profit remains, but cut by tx fee cap",
minProfit: big.NewInt(0),
gasFeeCap: new(big.Int).Mul(big.NewInt(5), gwei),
tip: new(big.Int).Mul(big.NewInt(1), gwei),
useL2: false,
useConfig: false,
l1Fee: nil,
l1FeeErr: nil,
reward: new(big.Int).Mul(big.NewInt(1), ether),
rewardErr: nil,
wantDropped: false,
wantGasFeeCap: new(big.Int).SetInt64(1666666666666),
},
}