-
Notifications
You must be signed in to change notification settings - Fork 491
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
Fix panic on nil block in ethstats #1360
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pratikspatil024
approved these changes
Oct 25, 2024
ssandeep
approved these changes
Oct 25, 2024
Raneet10
approved these changes
Oct 25, 2024
ShibWizard
added a commit
to shibaone/bor
that referenced
this pull request
Jan 15, 2025
* core/state, eth/tracers: fix typos (#29932) * core/rawdb: remove unused deriveLogFields (#29913) Co-authored-by: Gary Rong <[email protected]> Co-authored-by: Martin HS <[email protected]> * p2p: use netip.Addr where possible (#29891) enode.Node was recently changed to store a cache of endpoint information. The IP address in the cache is a netip.Addr. I chose that type over net.IP because it is just better. netip.Addr is meant to be used as a value type. Copying it does not allocate, it can be compared with ==, and can be used as a map key. This PR changes most uses of Node.IP() into Node.IPAddr(), which returns the cached value directly without allocating. While there are still some public APIs left where net.IP is used, I have converted all code used internally by p2p/discover to the new types. So this does change some public Go API, but hopefully not APIs any external code actually uses. There weren't supposed to be any semantic differences resulting from this refactoring, however it does introduce one: In package p2p/netutil we treated the 0.0.0.0/8 network (addresses 0.x.y.z) as LAN, but netip.Addr.IsPrivate() doesn't. The treatment of this particular IP address range is controversial, with some software supporting it and others not. IANA lists it as special-purpose and invalid as a destination for a long time, so I don't know why I put it into the LAN list. It has now been marked as special in p2p/netutil as well. * build: upgrade -dlgo version to Go 1.22.4 (#29938) * rlp: no need to repeat called len method (#29936) rlp: no need to repeat calling len * p2p/netutil: fix comments (#29942) * p2p/discover: unwrap 4-in-6 UDP source addresses (#29944) Fixes an issue where discovery responses were not recognized. * params: release Geth v1.14.5 * params: begin v1.14.6 release cycle * cmd/evm/internal/t8ntool: remove unused parameter (#29930) * go.mod : tidy * cmd/clef, cmd/evm: fix markdown issues in README (#29954) * cmd/geth: remove unused param (#29952) * p2p/discover: add missing lock when calling tab.handleAddNode (#29960) * p2p: use package slices to sort in PeersInfo (#29957) * core: initialize developer genesis beacon root contract with 0 balance (#29963) * core, rlp: remove duplicated words (#29964) * cmd, core: prefetch reads too from tries if requested (#29807) * cmd/utils, consensus/beacon, core/state: when configured via stub flag: prefetch all reads from account/storage tries, terminate prefetcher synchronously. * cmd, core/state: fix nil panic, fix error handling, prefetch nosnap too * core/state: expand prefetcher metrics for reads and writes separately * cmd/utils, eth: fix noop collect witness flag --------- Co-authored-by: Péter Szilágyi <[email protected]> * core/state: rename all the AccessList receivers to 'al' (#29921) rename all the receivers to 'al' * ethconfig: regenerate config (#29970) * cmd/devp2p: fix log output (#29972) * .github: disable cache in actions run (#29926) * p2p/simulations: update doc of HTTP endpoints (#29894) * all: fix inconsistent receiver name and add lint rule for it (#29974) * .golangci.yml: enable check for consistent receiver name * beacon/light/sync: fix receiver name * core/txpool/blobpool: fix receiver name * core/types: fix receiver name * internal/ethapi: use consistent receiver name 'api' for handler object * signer/core/apitypes: fix receiver name * signer/core: use consistent receiver name 'api' for handler object * log: fix receiver name * accounts: avoid duplicate regex compilation (#29943) * fix: Optimize regular initialization * modify var name * variable change to private types * core/state, eth/protocols, trie, triedb/pathdb: remove unused error from trie Commit (#29869) * core/state, eth/protocols, trie, triedb/pathdb: remove unused error return from trie Commit * move set back to account-trie-update block scoping for easier readability * address review * undo tests submodule change * trie: panic if BatchSerialize returns an error in Verkle trie Commit * trie: verkle comment nitpicks --------- Co-authored-by: Péter Szilágyi <[email protected]> * beacon/light: fix shutdown issues (#29946) * beacon/light/request: add server test for event after unsubscribe * beacon/light/api: fixed double stream.Close() * beacon/light/request: add checks for nil event callback function * beacon/light/request: unlock server mutex while unsubscribing from parent * trie/triedb: add Reader to backend interface (#29988) * core/state/snapshot: add a missing lock (#30001) * upgrade lock usage * revert unnecessary change * go.mod: update Pebble to sort out a deleted upstream dependency (#30010) * log: fix some functions comments (#29907) updates some docstrings --------- Co-authored-by: rjl493456442 <[email protected]> * trie, triedb/pathdb: prealloc capacity for map and slice (#29986) * triedb/pathdb: use maps.Clone and maps.Keys (#29985) * common/math: fix out of bounds access in json unmarshalling (#30014) Co-authored-by: Martin Holst Swende <[email protected]> * core/state/snapshot: acquire the lock on Release (#30011) * core/state/snapshot: acquire the lock on release * core/state/snapshot: only acquire read-lock when iterating * cmd/geth, ethdb/pebble: improve database statistic (#29948) * cmd/geth, ethdb/pebble: polish method naming and code comment * implement db stat for pebble * cmd, core, ethdb, internal, trie: remove db property selector * cmd, core, ethdb: fix function description --------- Co-authored-by: prpeh <[email protected]> Co-authored-by: Gary Rong <[email protected]> * trie: don't reset tracer at the end of Commit (#30024) * trie: don't reset tracer at the end of Commit * Update trie.go --------- Co-authored-by: rjl493456442 <[email protected]> * common: using `ParseUint` instead of `ParseInt` (#30020) Since Decimal is defined as unsiged `uint64`, we should use `strconv.ParseUint` instead of `strconv.ParseInt` during unmarshalling. --------- Co-authored-by: Martin Holst Swende <[email protected]> * core/txpool/blobpool: change rw-lock to r-lock (#29989) * trie/trienode: avoid unnecessary copy (#30019) * avoid unnecessary copy * delete the never used function ProofList * eth/protocols/snap, trie/trienode: polish the code --------- Co-authored-by: Gary Rong <[email protected]> * p2p/rlpx: 2KB maximum size for handshake messages (#30029) Co-authored-by: Felix Lange <[email protected]> * core/state/snapshot: tiny fixes (#29995) * Revert "core/state/snapshot: tiny fixes" (#30039) Revert "core/state/snapshot: tiny fixes (#29995)" This reverts commit e0e45db. * add api calls to bor grpc * p2p/discover: improve flaky revalidation tests (#30023) * cmd/blsync: use debug.Setup for logging configuration (#30065) * .github: add lightclient as codeowner to relevant packages (#30062) * accounts/keystore: use t.TempDir in test (#30052) * internal/debug: remove unnecessary log level assignment (#30044) Log level is specified in L259 so it's unnecessary to specify it for handlers (L234, L236). * all: stateless witness builder and (self-)cross validator (#29719) * all: add stateless verifications * all: simplify witness and integrate it into live geth --------- Co-authored-by: Péter Szilágyi <[email protected]> * core/txpool/blobpool: avoid use *map as parameter. (#30048) * trie/trienode: remove unnecessary check in Summary (#30047) * eth/tracers,trie: remove unnecessary check (#30071) * trie: relocate state execution logic into pathdb package (#29861) * triedb/pathdb: fix flaky test in pathdb (#29901) * core/txpool/blobpool: improve newPriceHeap function (#30050) Co-authored-by: Felix Lange <[email protected]> * cmd/evm/internal/t8ntool: log writeTraceResult error message (#30038) * all: replace division with right shift if possible (#29911) * rpc: truncate call error data logs (#30028) Co-authored-by: Felix Lange <[email protected]> * save * save * accounts/usbwallet/trezor: upgrade to generate with protoc 27.1 (#30058) * build: add check for stale generated files (#30037) Co-authored-by: Felix Lange <[email protected]> * core/state: fix inconsistent verkle test error messages (#29753) * params: release Geth v1.14.6 * add block fetcher back, fix handler and blockchain errors * fix: testcases * fix: testcases * fix: testcases * Fix getStateObject in statedb when MVHashmap is enabled getDeletedStateObject is renamed to getStateObject after a recent upstream merge. We should wrap the entire function call with MVRead. * regenerate mocks to fix tests * fix: testcases * PIP-30: increased max code size limit to 32KB (maticnetwork#1310) * PIP-30: increased max code size limit to 32KB * fixed tests * Fix TestFilterTxConditional Explicitly call state.Finalize in order to flush the writes to storage trie. Root cause was because finalise called within state object were removed by this commit: ethereum/go-ethereum@be32843 * fix: testcases * Adding refactored packager, adding pbss configs, removal of mumbai ( it is now sunset by amoy ) * Fixing naming convention for pbss_config.toml's and reverting config.toml to add not add pbss * fix: traceTx function * Bumping go version * fix: tracers, add bor fee log in results * fix: testcases * README, .github: update discord links (maticnetwork#1318) * fix: testcases, add: block broadcasting mechanism * fix: Eth2NewBlock, add: tip check in commit txn * eth/protocols/snap: skip test * internal/cli: skip tests due to dev mode not working * fix: commit logic * fix:testcases * fix: TestRPCGetTransactionReceiptsByBlock * internal/ethapi/testdata: revert genesis hash * internal/ethapi/testdata: add note * fix: testcases * fix: few linting errors * fix: testcases * skip: testcase * fix: avoid capping warnings for gas set by internal system transactions * fix: add back ethApi and mining login in handler * fix: set ethapi in handler * fix: parallelise tests in core * fix: lint, add: milestone related tests in downloader * fix: integration syntax * consensus/bor: use CallWithState to fetch last state id (maticnetwork#1323) * consensus/bor: use CallWithState to fetch last state id * fix * added Ahmedabad HF related configs and block number for amoy (maticnetwork#1324) * v1.4.0-beta version bump * Add test for concurrent revert in MVHashmap (maticnetwork#1326) * Add test for concurrent revert in MVHashmap * Address CR comment * Log info about mismatched valset (maticnetwork#1325) * bumping releaser and checkout versions to address future end of life support for node versions used * Updating to add quotes to the pbss portions for db.engine and state.scheme, included details regarding pbss not supporting archive * Updating to comment out trie, bad copy over from test profile * upgrade polyproto version * chg: skip snap synced tests * chg: test * chg: fix tests * chg: fix assertions in test * Fix fee conversion * fix: lint * add: eth67 protocol * update version of action artifact * Address goroutine leak * Remove duplicated tx fetcher call * added Ahmedabad HF related configs and block number for mainnet * .github/workflows: update actions/upload-artifact to v4 * Update artifacts upload/download actions version (maticnetwork#1331) * chg: update artifacts actions versions * chg: update artifacts actions versions for govuln * v1.4.0 version bump * AMOY SPECIFIC (updated WMATIC code) * v1.4.0-beta2 version bump * Add pending logs back * Remove file added accidentally * Quit early when read conflict is detected * Fix mvhashmap test * Bump version to v1.4.1 * Fix tests and increase timeout * Fix test-integration * Adding rpm packagers * Updating proper path for main pr * Fix txIndexer * Bump action versions * Remove unused workflow file * Reduce test-integration time * Adding amoy static-nodes and bootnodes for amoy * Adding mainnet bootnodes and static-nodes * Updated amoy static-nodes and bootnodes for amoy * Remove debug logs * Bump version to v1.5.0-beta * Fix panic in eth_getLogs * Bump up version to v1.5.0-beta2 * internal/cli: add: prometheus sever timeouts * fix: lint * Updating to use master instead of main per default bor branch * Updated default branch to use to master per bor default branch * Fix panic on getting safe block Since bor doesn't have "safe" block, the api should always return null when requested safe block. * Fix tx index limit not being used correctly * Fix bor tx missing * Bump version to v1.5.0-beta3 * Adding dns entries for the enrtree for pos mesh backbone nodes * chore: fix function name * check block number and timestamp options when filtering conditional transactions * Fix eth_getTransactionReceipt * Add flag discovery.dns * Changing names of pbss profiles for consistency in deb and rpm * Bump version to v1.5.0-beta5 * Updating uploader * Bump version to v1.5.0-beta6 * Bump version to v1.5.0 * Fix bor logs missing (maticnetwork#1361) * Fix panic on nil block in ethstats (maticnetwork#1360) * Bump version to v1.5.1 (maticnetwork#1362) * Fix getBlockTransactionCountByNumber/Hash (maticnetwork#1365) * Bump version to v1.5.2 (maticnetwork#1366) * chg: some sec fixes * add: logs * chg: add logs * chg: register reflection for grpc server * chg: fix functions' names * chg: logs * chg: remove redundant logs * chg: sort imports * add: deps * fix: build * fix: lint * fix: lint * chg: handle edge cases with string blockNumber * chg: switch blockNumber * cgh: fix rpc blockNumber and bash warnings * cgh: fix possible out of range on blockNumber * cgh: use geth for maxInt * chg: try blocks hex ecnoding * chg: bump polyproto * build(deps): bump github.com/golang-jwt/jwt/v4 from 4.5.0 to 4.5.1 (maticnetwork#1371) Bumps [github.com/golang-jwt/jwt/v4](https://github.com/golang-jwt/jwt) from 4.5.0 to 4.5.1. - [Release notes](https://github.com/golang-jwt/jwt/releases) - [Changelog](https://github.com/golang-jwt/jwt/blob/main/VERSION_HISTORY.md) - [Commits](golang-jwt/jwt@v4.5.0...v4.5.1) --- updated-dependencies: - dependency-name: github.com/golang-jwt/jwt/v4 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * core: validate chain before writing block (maticnetwork#1319) * Wrong architecture binary ended up in arm64 * Updating verbage * typos intapi_changelog.md * typos server.md * typos server.md * typos server.md * typos README.md * chg: update version * Fix incorrect balance when CreateContract is used in block-stm (maticnetwork#1382) * Fix incorrect balance when CreateContract is used in block-stm * address CR comments * consensus/bor: fetch validator set using parent hash * chg: bump stable version * Fix incorrect balance when CreateContract is used in block-stm (maticnetwork#1382) * Fix incorrect balance when CreateContract is used in block-stm * address CR comments * Removing control files and updating the updateVersion.sh * build(deps): bump golang.org/x/crypto from 0.24.0 to 0.31.0 Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.24.0 to 0.31.0. - [Commits](golang/crypto@v0.24.0...v0.31.0) --- updated-dependencies: - dependency-name: golang.org/x/crypto dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]> * Adding systemd copy, missed in copy over * Fallback to serial execution if parallel execution fails (maticnetwork#1392) * core/state: fix SetStorage override behavior (#30185) (maticnetwork#1393) This pull request fixes the broken feature where the entire storage set is overridden. Originally, the storage set override was achieved by marking the associated account as deleted, preventing access to the storage slot on disk. However, since #29520, this flag is also checked when accessing the account, rendering the account unreachable. A fix has been applied in this pull request, which re-creates a new state object with all account metadata inherited. Co-authored-by: rjl493456442 <[email protected]> * Fix hasher (maticnetwork#1394) This will fix a hasher bug that was introduced in maticnetwork@a23701f * Bump version to v1.5.4-beta * Additional GRPC API checks * Bump default value of txpool global slots Increase the default value in order to reduce the time spent in txpool reorg. When txpool is saturated, txpool reorg can take more than a few seconds to run. This impacts block producer because the producer would need to get the pending txns from txpool, which is blocked by reorg. * Bump version to v1.5.4 --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Hteev Oli <[email protected]> Co-authored-by: Marquis Shanahan <[email protected]> Co-authored-by: Gary Rong <[email protected]> Co-authored-by: Martin HS <[email protected]> Co-authored-by: Felix Lange <[email protected]> Co-authored-by: Marius Kjærstad <[email protected]> Co-authored-by: Gealber Morales <[email protected]> Co-authored-by: ucwong <[email protected]> Co-authored-by: kukuru909 <[email protected]> Co-authored-by: Ha DANG <[email protected]> Co-authored-by: jwasinger <[email protected]> Co-authored-by: TinyFoxy <[email protected]> Co-authored-by: Péter Szilágyi <[email protected]> Co-authored-by: maskpp <[email protected]> Co-authored-by: bugmaker9371 <[email protected]> Co-authored-by: Guillaume Ballet <[email protected]> Co-authored-by: jackyin <[email protected]> Co-authored-by: Felföldi Zsolt <[email protected]> Co-authored-by: Darioush Jalali <[email protected]> Co-authored-by: Zoro <[email protected]> Co-authored-by: Dean Eigenmann <[email protected]> Co-authored-by: Marius van der Wijden <[email protected]> Co-authored-by: prpeh <[email protected]> Co-authored-by: Halimao <[email protected]> Co-authored-by: psogv0308 <[email protected]> Co-authored-by: David Theodore <[email protected]> Co-authored-by: Anshal Shukla <[email protected]> Co-authored-by: lightclient <[email protected]> Co-authored-by: AMIR <[email protected]> Co-authored-by: lilasxie <[email protected]> Co-authored-by: gitglorythegreat <[email protected]> Co-authored-by: Ceyhun Onur <[email protected]> Co-authored-by: Jerry <[email protected]> Co-authored-by: Manav Darji <[email protected]> Co-authored-by: Marcello Ardizzone <[email protected]> Co-authored-by: Pratik Patil <[email protected]> Co-authored-by: Daniel Jones <[email protected]> Co-authored-by: luozexuan <[email protected]> Co-authored-by: Daniel Jones <[email protected]> Co-authored-by: jj1980a <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Dmytrol <[email protected]> Co-authored-by: Raneet Debnath <[email protected]> Co-authored-by: Angel Valkov <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This change addresses the panic issue when the block is nil in ethstats. Also added test that will catch this case in CI.
Changes
Breaking changes
Please complete this section if any breaking changes have been made, otherwise delete it
Nodes audience
In case this PR includes changes that must be applied only to a subset of nodes, please specify how you handled it (e.g. by adding a flag with a default value...)
Checklist
Cross repository changes
Testing
Manual tests
Please complete this section with the steps you performed if you ran manual tests for this functionality, otherwise delete it
Additional comments
Please post additional comments in this section if you have them, otherwise delete it