Skip to content

Commit c09fdfa

Browse files
roberto-bayardogballetjtragliarjl493456442ucwong
authored
Merge in latest (v1.10.25) geth changes (#19)
* cmd. core: save preimages on genesis creation (ethereum#25538) force preimage dump for genesis * rlp/rlpgen: fix error handling when target type not found (ethereum#25547) typ will be nil when lookupStructType returns an error. cfg.Type should be used instead. * trie: improve node rlp decoding performance (ethereum#25357) This avoids copying the input []byte while decoding trie nodes. In most cases, particularly when the input slice is provided by the underlying database, this optimization is safe to use. For cases where the origin of the input slice is unclear, the copying version is retained. The new code performs better even when the input must be copied, because it is now only copied once in decodeNode. * all: fix some typos (ethereum#25551) * Fix some typos * Fix some mistakes * Revert 4byte.json * Fix an incorrect fix * Change files to fails * internal/ethapi: fix comment typo (ethereum#25548) * accounts/abi/bind/backends: typo fix (ethereum#25549) * eth, les: unlock downloader peerSet if there's an error (ethereum#25546) Unlock peerSet if there's an error in the downloader * cmd/geth: parse uint64 value with ParseUint instead of Atoi (ethereum#25545) Parse uint64 value with ParseUint instead of Atoi * consensus/beacon: check ttd reached on pos blocks (ethereum#25552) * consensus/beacon: check ttd reached on pos blocks * consensus/beacon: check ttd reached on pos blocks * consensus/beacon: check ttd reached on pos blocks * eth/filters: add global block logs cache (ethereum#25459) This adds a cache for block logs which is shared by all filters. The cache size of is configurable using the `--cache.blocklogs` flag. Co-authored-by: Felix Lange <fjl@twurst.com> * accounts/abi: fix set function (ethereum#25477) * accounts/abi: fix set function * don't break things * update test * internal/ethapi: fix build regression (ethereum#25555) * eth/fetcher: don't spend too much time on transaction inclusion (ethereum#25524) * eth/fetcher: introduce some lag in tx fetching * eth/fetcher: change conditions a bit * eth/fetcher: use per-batch quota check * eth/fetcher: fix some comments * eth/fetcher: address review concerns * eth/fetcher: fix panic + add warn log * eth/fetcher: fix log * eth/fetcher: fix log * cmd/devp2p/internal/ethtest: fix ignorign tx announcements from prev. tests * cmd/devp2p/internal/ethtest: fix TestLargeTxRequest This increases the number of tx relay messages the test waits for. Since go-ethereum now processes incoming txs in smaller batches, the announcement messages it sends are also smaller. Co-authored-by: Felix Lange <fjl@twurst.com> * Revert "eth/fetcher: don't spend too much time on transaction inclusion" (ethereum#25567) Revert "eth/fetcher: don't spend too much time on transaction inclusion (ethereum#25524)" This reverts commit 0ce494b. * eth/catalyst: warn less frequently if no beacon client is available (ethereum#25569) * eth/catalyst: warn less frequently if no beacon client is available * eth/catalyst: tweak warning frequency a bit * eth/catalyst: some more tweaks * Update api.go Co-authored-by: Felix Lange <fjl@twurst.com> * params: release go-ethereum v1.10.22 * params: begin v1.10.23 release cycle * core, eth/downloader: handle spurious junk bodies from racey rollbacks (ethereum#25578) * eth/downloader: handle junkbodies/receipts in the beacon sync * core: check for header presence when checking for blocks * core/state, trie: fix trie flush order for proper pruning * consensus/beacon: don't ignore errors * params: release Geth v1.10.23 * graphql: return correct logs for tx (ethereum#25612) * graphql: fix tx logs * minor * Use optimized search for selecting tx logs * graphql: fixes missing tx logs (ethereum#25745) * graphql: fix tx logs * graphql: refactor test service setup * graphql: add test for tx logs * Release Geth v1.10.24 * params: set TerminalTotalDifficultyPassed to true (ethereum#25769) * params: set TerminalTotalDifficultyPassed to true * Update params/config.go Co-authored-by: Martin Holst Swende <martin@swende.se> * params: release Geth v1.10.25 Co-authored-by: Guillaume Ballet <3272758+gballet@users.noreply.github.com> Co-authored-by: Justin Traglia <95511699+jtraglia@users.noreply.github.com> Co-authored-by: rjl493456442 <garyrong0905@gmail.com> Co-authored-by: ucwong <ucwong@126.com> Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de> Co-authored-by: Sina Mahmoodi <1591639+s1na@users.noreply.github.com> Co-authored-by: Felix Lange <fjl@twurst.com> Co-authored-by: zhiqiangxu <652732310@qq.com> Co-authored-by: Martin Holst Swende <martin@swende.se> Co-authored-by: Péter Szilágyi <peterke@gmail.com>
1 parent d8e92d1 commit c09fdfa

File tree

129 files changed

+947
-576
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

129 files changed

+947
-576
lines changed

accounts/abi/bind/backends/simulated.go

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ type SimulatedBackend struct {
6868
pendingState *state.StateDB // Currently pending state that will be the active on request
6969
pendingReceipts types.Receipts // Currently receipts for the pending block
7070

71-
events *filters.EventSystem // Event system for filtering log events live
71+
events *filters.EventSystem // for filtering log events live
72+
filterSystem *filters.FilterSystem // for filtering database logs
7273

7374
config *params.ChainConfig
7475
}
@@ -86,7 +87,11 @@ func NewSimulatedBackendWithDatabase(database ethdb.Database, alloc core.Genesis
8687
blockchain: blockchain,
8788
config: genesis.Config,
8889
}
89-
backend.events = filters.NewEventSystem(&filterBackend{database, blockchain, backend}, false)
90+
91+
filterBackend := &filterBackend{database, blockchain, backend}
92+
backend.filterSystem = filters.NewFilterSystem(filterBackend, filters.Config{})
93+
backend.events = filters.NewEventSystem(backend.filterSystem, false)
94+
9095
backend.rollback(blockchain.CurrentBlock())
9196
return backend
9297
}
@@ -609,7 +614,7 @@ func (b *SimulatedBackend) callContract(ctx context.Context, call ethereum.CallM
609614
// User specified the legacy gas field, convert to 1559 gas typing
610615
call.GasFeeCap, call.GasTipCap = call.GasPrice, call.GasPrice
611616
} else {
612-
// User specified 1559 gas feilds (or none), use those
617+
// User specified 1559 gas fields (or none), use those
613618
if call.GasFeeCap == nil {
614619
call.GasFeeCap = new(big.Int)
615620
}
@@ -689,7 +694,7 @@ func (b *SimulatedBackend) FilterLogs(ctx context.Context, query ethereum.Filter
689694
var filter *filters.Filter
690695
if query.BlockHash != nil {
691696
// Block filter requested, construct a single-shot filter
692-
filter = filters.NewBlockFilter(&filterBackend{b.database, b.blockchain, b}, *query.BlockHash, query.Addresses, query.Topics)
697+
filter = b.filterSystem.NewBlockFilter(*query.BlockHash, query.Addresses, query.Topics)
693698
} else {
694699
// Initialize unset filter boundaries to run from genesis to chain head
695700
from := int64(0)
@@ -701,7 +706,7 @@ func (b *SimulatedBackend) FilterLogs(ctx context.Context, query ethereum.Filter
701706
to = query.ToBlock.Int64()
702707
}
703708
// Construct the range filter
704-
filter = filters.NewRangeFilter(&filterBackend{b.database, b.blockchain, b}, from, to, query.Addresses, query.Topics)
709+
filter = b.filterSystem.NewRangeFilter(from, to, query.Addresses, query.Topics)
705710
}
706711
// Run the filter and return all the logs
707712
logs, err := filter.Logs(ctx)
@@ -828,7 +833,8 @@ type filterBackend struct {
828833
backend *SimulatedBackend
829834
}
830835

831-
func (fb *filterBackend) ChainDb() ethdb.Database { return fb.db }
836+
func (fb *filterBackend) ChainDb() ethdb.Database { return fb.db }
837+
832838
func (fb *filterBackend) EventMux() *event.TypeMux { panic("not supported") }
833839

834840
func (fb *filterBackend) HeaderByNumber(ctx context.Context, block rpc.BlockNumber) (*types.Header, error) {
@@ -854,19 +860,8 @@ func (fb *filterBackend) GetReceipts(ctx context.Context, hash common.Hash) (typ
854860
return rawdb.ReadReceipts(fb.db, hash, *number, fb.bc.Config()), nil
855861
}
856862

857-
func (fb *filterBackend) GetLogs(ctx context.Context, hash common.Hash) ([][]*types.Log, error) {
858-
number := rawdb.ReadHeaderNumber(fb.db, hash)
859-
if number == nil {
860-
return nil, nil
861-
}
862-
receipts := rawdb.ReadReceipts(fb.db, hash, *number, fb.bc.Config())
863-
if receipts == nil {
864-
return nil, nil
865-
}
866-
logs := make([][]*types.Log, len(receipts))
867-
for i, receipt := range receipts {
868-
logs[i] = receipt.Logs
869-
}
863+
func (fb *filterBackend) GetLogs(ctx context.Context, hash common.Hash, number uint64) ([][]*types.Log, error) {
864+
logs := rawdb.ReadLogs(fb.db, hash, number, fb.bc.Config())
870865
return logs, nil
871866
}
872867

accounts/abi/reflect.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ func mustArrayToByteSlice(value reflect.Value) reflect.Value {
9999
func set(dst, src reflect.Value) error {
100100
dstType, srcType := dst.Type(), src.Type()
101101
switch {
102-
case dstType.Kind() == reflect.Interface && dst.Elem().IsValid():
102+
case dstType.Kind() == reflect.Interface && dst.Elem().IsValid() && (dst.Elem().Type().Kind() == reflect.Ptr || dst.Elem().CanSet()):
103103
return set(dst.Elem(), src)
104104
case dstType.Kind() == reflect.Ptr && dstType.Elem() != reflect.TypeOf(big.Int{}):
105105
return set(dst.Elem(), src)

accounts/abi/reflect_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ type reflectTest struct {
3232

3333
var reflectTests = []reflectTest{
3434
{
35-
name: "OneToOneCorrespondance",
35+
name: "OneToOneCorrespondence",
3636
args: []string{"fieldA"},
3737
struc: struct {
3838
FieldA int `abi:"fieldA"`

accounts/abi/unpack_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,11 @@ func TestMethodMultiReturn(t *testing.T) {
352352
&[]interface{}{&expected.Int, &expected.String},
353353
"",
354354
"Can unpack into a slice",
355+
}, {
356+
&[]interface{}{&bigint, ""},
357+
&[]interface{}{&expected.Int, expected.String},
358+
"",
359+
"Can unpack into a slice without indirection",
355360
}, {
356361
&[2]interface{}{&bigint, new(string)},
357362
&[2]interface{}{&expected.Int, &expected.String},

accounts/keystore/account_cache_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ func waitForAccounts(wantAccounts []accounts.Account, ks *KeyStore) error {
318318
func TestUpdatedKeyfileContents(t *testing.T) {
319319
t.Parallel()
320320

321-
// Create a temporary kesytore to test with
321+
// Create a temporary keystore to test with
322322
rand.Seed(time.Now().UnixNano())
323323
dir := filepath.Join(os.TempDir(), fmt.Sprintf("eth-keystore-updatedkeyfilecontents-test-%d-%d", os.Getpid(), rand.Int()))
324324
ks := NewKeyStore(dir, LightScryptN, LightScryptP)

accounts/keystore/file_cache.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ type fileCache struct {
3939
func (fc *fileCache) scan(keyDir string) (mapset.Set, mapset.Set, mapset.Set, error) {
4040
t0 := time.Now()
4141

42-
// List all the failes from the keystore folder
42+
// List all the files from the keystore folder
4343
files, err := os.ReadDir(keyDir)
4444
if err != nil {
4545
return nil, nil, nil, err
@@ -61,7 +61,7 @@ func (fc *fileCache) scan(keyDir string) (mapset.Set, mapset.Set, mapset.Set, er
6161
log.Trace("Ignoring file on account scan", "path", path)
6262
continue
6363
}
64-
// Gather the set of all and fresly modified files
64+
// Gather the set of all and freshly modified files
6565
all.Add(path)
6666

6767
info, err := fi.Info()

accounts/keystore/keystore_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ func TestSignRace(t *testing.T) {
214214
// Tests that the wallet notifier loop starts and stops correctly based on the
215215
// addition and removal of wallet event subscriptions.
216216
func TestWalletNotifierLifecycle(t *testing.T) {
217-
// Create a temporary kesytore to test with
217+
// Create a temporary keystore to test with
218218
_, ks := tmpKeyStore(t, false)
219219

220220
// Ensure that the notification updater is not running yet

accounts/usbwallet/trezor.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,10 @@ func (w *trezorDriver) trezorDerive(derivationPath []uint32) (common.Address, er
196196
if _, err := w.trezorExchange(&trezor.EthereumGetAddress{AddressN: derivationPath}, address); err != nil {
197197
return common.Address{}, err
198198
}
199-
if addr := address.GetAddressBin(); len(addr) > 0 { // Older firmwares use binary fomats
199+
if addr := address.GetAddressBin(); len(addr) > 0 { // Older firmwares use binary formats
200200
return common.BytesToAddress(addr), nil
201201
}
202-
if addr := address.GetAddressHex(); len(addr) > 0 { // Newer firmwares use hexadecimal fomats
202+
if addr := address.GetAddressHex(); len(addr) > 0 { // Newer firmwares use hexadecimal formats
203203
return common.HexToAddress(addr), nil
204204
}
205205
return common.Address{}, errors.New("missing derived address")

accounts/usbwallet/wallet.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ func (w *wallet) selfDerive() {
380380
// of legacy-ledger, the first account on the legacy-path will
381381
// be shown to the user, even if we don't actively track it
382382
if i < len(nextAddrs)-1 {
383-
w.log.Info("Skipping trakcking first account on legacy path, use personal.deriveAccount(<url>,<path>, false) to track",
383+
w.log.Info("Skipping tracking first account on legacy path, use personal.deriveAccount(<url>,<path>, false) to track",
384384
"path", path, "address", nextAddrs[i])
385385
break
386386
}

build/ci.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ func doDocker(cmdline []string) {
608608
}
609609
if mismatch {
610610
// Build numbers mismatching, retry in a short time to
611-
// avoid concurrent failes in both publisher images. If
611+
// avoid concurrent fails in both publisher images. If
612612
// however the retry failed too, it means the concurrent
613613
// builder is still crunching, let that do the publish.
614614
if i == 0 {

0 commit comments

Comments
 (0)