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

all: sync with upstream v1.11.0 #1355

Closed
wants to merge 9 commits into from
4 changes: 3 additions & 1 deletion accounts/abi/bind/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ import (
"github.com/ethereum/go-ethereum/event"
)

const basefeeWiggleMultiplier = 2

// SignerFn is a signer function callback when a contract requires a method to
// sign the transaction before submission.
type SignerFn func(common.Address, *types.Transaction) (*types.Transaction, error)
Expand Down Expand Up @@ -251,7 +253,7 @@ func (c *BoundContract) createDynamicTx(opts *TransactOpts, contract *common.Add
if gasFeeCap == nil {
gasFeeCap = new(big.Int).Add(
gasTipCap,
new(big.Int).Mul(head.BaseFee, big.NewInt(2)),
new(big.Int).Mul(head.BaseFee, big.NewInt(basefeeWiggleMultiplier)),
)
}
if gasFeeCap.Cmp(gasTipCap) < 0 {
Expand Down
5 changes: 4 additions & 1 deletion build/ci.go
Original file line number Diff line number Diff line change
Expand Up @@ -973,7 +973,10 @@ func doWindowsInstaller(cmdline []string) {
if env.Commit != "" {
version[2] += "-" + env.Commit[:8]
}
installer, _ := filepath.Abs("geth-" + archiveBasename(*arch, params.ArchiveVersion(env.Commit)) + ".exe")
installer, err := filepath.Abs("geth-" + archiveBasename(*arch, params.ArchiveVersion(env.Commit)) + ".exe")
if err != nil {
log.Fatalf("Failed to convert installer file path: %v", err)
}
build.MustRunCommand("makensis.exe",
"/DOUTPUTFILE="+installer,
"/DMAJORVERSION="+version[0],
Expand Down
5 changes: 4 additions & 1 deletion build/update-license.go
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,10 @@ func isGenerated(file string) bool {
}
defer fd.Close()
buf := make([]byte, 2048)
n, _ := fd.Read(buf)
n, err := fd.Read(buf)
if err != nil {
return false
}
buf = buf[:n]
for _, l := range bytes.Split(buf, []byte("\n")) {
if bytes.HasPrefix(l, []byte("// Code generated")) {
Expand Down
2 changes: 1 addition & 1 deletion cmd/devp2p/nodesetcmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ func parseFilterLimit(args []string) (int, error) {
return limit, nil
}

// andFilter parses node filters in args and and returns a single filter that requires all
// andFilter parses node filters in args and returns a single filter that requires all
// of them to match.
func andFilter(args []string) (nodeFilter, error) {
checks, err := parseFilters(args)
Expand Down
4 changes: 2 additions & 2 deletions consensus/parlia/parlia.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ type Parlia struct {

lock sync.RWMutex // Protects the signer fields

ethAPI *ethapi.PublicBlockChainAPI
ethAPI *ethapi.BlockChainAPI
validatorSetABI abi.ABI
slashABI abi.ABI

Expand All @@ -221,7 +221,7 @@ type Parlia struct {
func New(
chainConfig *params.ChainConfig,
db ethdb.Database,
ethAPI *ethapi.PublicBlockChainAPI,
ethAPI *ethapi.BlockChainAPI,
genesisHash common.Hash,
) *Parlia {
// get parlia config
Expand Down
6 changes: 3 additions & 3 deletions consensus/parlia/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import (
// Snapshot is the state of the validatorSet at a given point.
type Snapshot struct {
config *params.ParliaConfig // Consensus engine parameters to fine tune behavior
ethAPI *ethapi.PublicBlockChainAPI
ethAPI *ethapi.BlockChainAPI
sigCache *lru.ARCCache // Cache of recent block signatures to speed up ecrecover

Number uint64 `json:"number"` // Block number where the snapshot was created
Expand All @@ -55,7 +55,7 @@ func newSnapshot(
number uint64,
hash common.Hash,
validators []common.Address,
ethAPI *ethapi.PublicBlockChainAPI,
ethAPI *ethapi.BlockChainAPI,
) *Snapshot {
snap := &Snapshot{
config: config,
Expand All @@ -81,7 +81,7 @@ func (s validatorsAscending) Less(i, j int) bool { return bytes.Compare(s[i][:],
func (s validatorsAscending) Swap(i, j int) { s[i], s[j] = s[j], s[i] }

// loadSnapshot loads an existing snapshot from the database.
func loadSnapshot(config *params.ParliaConfig, sigCache *lru.ARCCache, db ethdb.Database, hash common.Hash, ethAPI *ethapi.PublicBlockChainAPI) (*Snapshot, error) {
func loadSnapshot(config *params.ParliaConfig, sigCache *lru.ARCCache, db ethdb.Database, hash common.Hash, ethAPI *ethapi.BlockChainAPI) (*Snapshot, error) {
blob, err := db.Get(append([]byte("parlia-"), hash[:]...))
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion core/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ var (
ErrFeeCapVeryHigh = errors.New("max fee per gas higher than 2^256-1")

// ErrFeeCapTooLow is returned if the transaction fee cap is less than the
// the base fee of the block.
// base fee of the block.
ErrFeeCapTooLow = errors.New("max fee per gas less than block base fee")

// ErrSenderNoEOA is returned if the sender of a transaction is a contract.
Expand Down
2 changes: 1 addition & 1 deletion core/state/snapshot/difflayer.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ var (
bloomFuncs = math.Round((bloomSize / float64(aggregatorItemLimit)) * math.Log(2))

// the bloom offsets are runtime constants which determines which part of the
// the account/storage hash the hasher functions looks at, to determine the
// account/storage hash the hasher functions looks at, to determine the
// bloom key for an account/slot. This is randomized at init(), so that the
// global population of nodes do not all display the exact same behaviour with
// regards to bloom content
Expand Down
3 changes: 3 additions & 0 deletions core/state/trie_prefetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,9 @@ func (p *triePrefetcher) copy() *triePrefetcher {
// if the triePrefetcher is active, fetches will not be used in mainLoop
// otherwise, inactive triePrefetcher is readonly, it won't modify fetches
for root, fetch := range p.fetches {
if fetch == nil {
continue
}
fetcherCopied.fetches[root] = p.db.CopyTrie(fetch)
}
return fetcherCopied
Expand Down
2 changes: 1 addition & 1 deletion core/tx_noncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (txn *txNoncer) set(addr common.Address, nonce uint64) {
}

// setIfLower updates a new virtual nonce into the virtual state database if the
// the new one is lower.
// new one is lower.
func (txn *txNoncer) setIfLower(addr common.Address, nonce uint64) {
txn.lock.Lock()
defer txn.lock.Unlock()
Expand Down
Loading