Skip to content

Commit

Permalink
feat(repo): geth/v1.14.11 upstream merge
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtaikocha committed Oct 2, 2024
1 parent 1c93b0c commit 72bf432
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cmd/geth/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ var (
utils.GpoPercentileFlag,
utils.GpoMaxGasPriceFlag,
utils.GpoIgnoreGasPriceFlag,
// CHANGE(taiko): use default gas price flag
// CHANGE(taiko): add `--gpo.defaultprice` flag
utils.GpoDefaultGasPriceFlag,
configFileFlag,
utils.LogDebugFlag,
Expand Down
4 changes: 2 additions & 2 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,7 @@ var (
Value: ethconfig.Defaults.GPO.IgnorePrice.Int64(),
Category: flags.GasPriceCategory,
}
// CHANGE(taiko): use default gas price flag
// CHANGE(taiko): add `--gpo.defaultprice` flag.
GpoDefaultGasPriceFlag = &cli.Int64Flag{
Name: "gpo.defaultprice",
Usage: "Default gas price",
Expand Down Expand Up @@ -1794,7 +1794,7 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
}
// Override any default configs for hard coded networks.
switch {
// CHANGE(taiko): when --taiko flag is set, use the Taiko genesis.
// CHANGE(taiko): when `--taiko` flag is set, use the Taiko genesis.
case ctx.IsSet(TaikoFlag.Name):
cfg.Genesis = core.TaikoGenesisBlock(cfg.NetworkId)
case ctx.Bool(MainnetFlag.Name):
Expand Down
2 changes: 2 additions & 0 deletions core/state_transition.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ func (st *StateTransition) buyGas() error {
if overflow {
return fmt.Errorf("%w: address %v required balance exceeds 256 bits", ErrInsufficientFunds, st.msg.From.Hex())
}
// CHANGE(taiko): if the transaction is an anchor transaction, the balance check is skipped.
if st.msg.IsAnchor {
balanceCheckU256 = common.U2560
mgval = common.Big0
Expand Down Expand Up @@ -524,6 +525,7 @@ func (st *StateTransition) refundGas(refundQuotient uint64) uint64 {
}

st.gasRemaining += refund
// CHANGE(taiko): do not change the balance in anchor transactions.
if !st.msg.IsAnchor {
// Return ETH for remaining gas, exchanged at the original rate.
remaining := uint256.NewInt(st.gasRemaining)
Expand Down
10 changes: 8 additions & 2 deletions core/txpool/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ var (
// blobTxMinBlobGasPrice is the big.Int version of the configured protocol
// parameter to avoid constructing a new big integer for every transaction.
blobTxMinBlobGasPrice = big.NewInt(params.BlobTxMinBlobGasprice)
// CHANGE(taiko): the miniumum baseFee defined in TaikoL2 (0.008847185 GWei).
minL2BaseFee = new(big.Int).SetUint64(8847185)
)

// ValidationOptions define certain differences between transaction validation
Expand Down Expand Up @@ -99,8 +101,12 @@ func ValidateTransaction(tx *types.Transaction, head *types.Header, signer types
return core.ErrTipAboveFeeCap
}
// CHANGE(taiko): check gasFeeCap.
if os.Getenv("TAIKO_TEST") == "" && tx.GasFeeCap().Cmp(common.Big0) == 0 {
return errors.New("max fee per gas is 0")
if os.Getenv("TAIKO_TEST") == "" {
if opts.Config.IsOntake(head.Number) && tx.GasFeeCap().Cmp(minL2BaseFee) < 0 {
return errors.New("max fee per gas is less than the minimum base fee (0.008847185 GWei)")
} else if tx.GasFeeCap().Cmp(common.Big0) == 0 {
return errors.New("max fee per gas is zero")
}
}
// Make sure the transaction is signed properly
if _, err := types.Sender(signer, tx); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion eth/catalyst/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ func (api *ConsensusAPI) forkchoiceUpdated(update engine.ForkchoiceStateV1, payl
}
}

// CHANGE(taiko): check whether --taiko flag is set.
// CHANGE(taiko): check whether `--taiko` flag is set.
isTaiko := api.eth.BlockChain().Config().Taiko

if rawdb.ReadCanonicalHash(api.eth.ChainDb(), block.NumberU64()) != update.HeadBlockHash {
Expand Down

0 comments on commit 72bf432

Please sign in to comment.