Preston Van Loon
2fd6bd8150
Add golang.org/x/tools modernize static analyzer and fix violations ( #15946 )
...
* Ran gopls modernize to fix everything
go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest -fix -test ./...
* Override rules_go provided dependency for golang.org/x/tools to v0.38.0.
To update this, checked out rules_go, then ran `bazel run //go/tools/releaser -- upgrade-dep -mirror=false org_golang_x_tools` and copied the patches.
* Fix buildtag violations and ignore buildtag violations in external
* Introduce modernize analyzer package.
* Add modernize "any" analyzer.
* Fix violations of any analyzer
* Add modernize "appendclipped" analyzer.
* Fix violations of appendclipped
* Add modernize "bloop" analyzer.
* Add modernize "fmtappendf" analyzer.
* Add modernize "forvar" analyzer.
* Add modernize "mapsloop" analyzer.
* Add modernize "minmax" analyzer.
* Fix violations of minmax analyzer
* Add modernize "omitzero" analyzer.
* Add modernize "rangeint" analyzer.
* Fix violations of rangeint.
* Add modernize "reflecttypefor" analyzer.
* Fix violations of reflecttypefor analyzer.
* Add modernize "slicescontains" analyzer.
* Add modernize "slicessort" analyzer.
* Add modernize "slicesdelete" analyzer. This is disabled by default for now. See https://go.dev/issue/73686 .
* Add modernize "stringscutprefix" analyzer.
* Add modernize "stringsbuilder" analyzer.
* Fix violations of stringsbuilder analyzer.
* Add modernize "stringsseq" analyzer.
* Add modernize "testingcontext" analyzer.
* Add modernize "waitgroup" analyzer.
* Changelog fragment
* gofmt
* gazelle
* Add modernize "newexpr" analyzer.
* Disable newexpr until go1.26
* Add more details in WORKSPACE on how to update the override
* @nalepae feedback on min()
* gofmt
* Fix violations of forvar
2025-11-14 01:27:22 +00:00
Bastin
92bd211e4d
upgrade v6 to v7 ( #15989 )
...
* upgrade v6 to v7
* changelog
* update-go-ssz
2025-11-06 16:16:23 +00:00
terence
d0f5253b8d
Update go-bitfield from prysmaticlabs to OffchainLabs ( #15968 )
2025-11-03 23:59:03 +00:00
Sahil Sojitra
9805e90d73
chore: refactor to use builtin max/min ( #15817 )
...
* passed the tests with inbuilt max func
* tested min changes
* fix bazel files
* added changelog
2025-10-07 19:02:47 +00:00
Radosław Kapka
f035da6fc5
Aggregate and pack sync committee messages ( #15608 )
...
* Aggregate and pack sync committee messages
* test
* simplify error check
* changelog <3
* fix assert import
* remove parallelization
* use sync committee cache
* ignore bits already set in pool messages
* fuzz fix
* cleanup
* test panic fix
* clear cache in tests
2025-09-08 15:17:19 +00:00
terence
16b567f6af
Add log capitalization analyzer and apply changes ( #15452 )
...
* Add log capitalization analyzer and apply fixes across codebase
Implements a new nogo analyzer to enforce proper log message capitalization and applies the fixes to all affected log statements throughout the beacon chain, validator, and supporting components.
Co-Authored-By: Claude <noreply@anthropic.com >
* Radek's feedback
---------
Co-authored-by: Claude <noreply@anthropic.com >
2025-07-10 13:43:38 +00:00
Preston Van Loon
62fec4d1f3
Replace context.Background with testing.TB.Context where possible ( #15416 )
...
* Replace context.Background with testing.TB.Context where possible
* Fix failing tests
2025-06-16 22:09:18 +00:00
Preston Van Loon
eea53eb6dc
tracing: Add spans to various methods related to GetDuties ( #15271 )
...
* Adding spans for troubleshooting GetDuties latency
* Changelog fragment
2025-05-13 21:50:12 +00:00
terence
774b9a7159
Migrate Prysm repo to Offchain Labs organization ahead of Pectra V6 ( #15140 )
...
* Migrate Prysm repo to Offchain Labs organization ahead of Pectra upgrade v6
* Replace prysmaticlabs with OffchainLabs on general markdowns
* Update mock
* Gazelle and add mock.go to excluded generated mock file
2025-04-10 15:40:39 +00:00
Manu NALEPA
c73473b59d
Tracked validator cache: Make sure no to loose the reference. ( #15077 )
2025-03-20 10:00:40 +00:00
Manu NALEPA
93c27340e4
Tracked validator TTL ( #14957 )
...
* `TrackedValidatorsCache`: Implement a 1-hour TTL by uding `go-cache`.
* `TrackedValidatorsCache`: Add the `ItemCount` method.
* `TrackedValidatorsCache`: Add the `Indices` method.
* Add changelog.
* `TrackedValidatorsCache`: Add prometheus metrics.
* Update beacon-chain/cache/tracked_validators.go
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com >
---------
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com >
2025-02-19 18:04:13 +00:00
Jun Song
557c5be433
Prune pending deposits from the deposit cache post-Electra ( #14829 )
...
* Add metrics for pruned proofs & pending deposits
* Add PruneAllProofs & PruneAllPendingDeposits
* Add simple unit tests
* Add DepositPruner interface
* Add pruning logic at post finalization task
* Move pruner logic into new file(deposit_pruner.go)
Rationale:
As deposit_fetcher.go contains all pruning logics, it would be better to separate its interest into fetcher/inserter/pruner.
* Gofmt
* Add reference link for deprecating eth1 polling
* Add changelog
* Apply reviews from nisdas and james
* add pre and post deposit request tests
* nishant's comment
---------
Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com >
Co-authored-by: james-prysm <james@prysmaticlabs.com >
2025-02-07 04:31:01 +00:00
Nishant Das
5d6a406829
Update to Go 1.23 ( #14818 )
...
* Update to Go 1.23
* Update bazel version
* Update rules_go
* Use toolchains_protoc
* Update go_honnef_go_tools
* Update golang.org/x/tools
* Fix violations of SA3000
* Update errcheck by re-exporting the upstream repo
* Remove problematic ginkgo and gomega test helpers. Rewrote tests without these test libraries.
* Update go to 1.23.5
* gofmt with go1.23.5
* Revert Patch
* Unclog
* Update for go 1.23 support
* Fix Lint Issues
* Gazelle
* Fix Build
* Fix Lint
* no lint
* Fix lint
* Fix lint
* Disable intrange
* Preston's review
---------
Co-authored-by: Preston Van Loon <preston@pvl.dev >
2025-01-24 04:53:23 +00:00
Preston Van Loon
1f720bdbf4
Fix all typos ( #14769 )
2025-01-03 09:40:13 +00:00
Radosław Kapka
d04b361cc3
Redesign of the attestation pool ( #14324 )
...
* Rename existing AttestationCache
* Cache with simple Add
* fix import cycle
* logic for unaggregated, aggregated and block attestations
* some small fixes
* remove Seen
* finishing touches
* feature flag
* extract forkchoice atts to separate type
* gate new functionality behind feature flag
* revert test files
* preparing for review
* change Id to [32]byte
* Potuz's review
* Potuz's review pt 2
* Nishant's review
* keep flat list of atts
* fix ForkchoiceAttestations() function
* Tests for Add, GetAll, Count
* Tests for remaining functions
* use DeepEqual
* fix tests
* documentation
* changelog <3
* v2 handlers
* nil check for forkchoice atts
* guard against 0 bits set
* fix failing test
* Preston's review
* better godocs
2024-12-23 09:59:32 +00:00
Sammy Rosso
170a864239
Otel migration ( #14424 )
...
* remove opencensus
* gaz
* update dependencies
* add missing dependencies
* fix test?
* Fix note relevance
* add otel http transport middleware
* gaz
* tidy up
* gaz
* changelog
* feedback
* gaz
* fix merge issues
2024-09-12 23:00:20 +00:00
hopinheimer
28181710b0
version bump on k8s io client-go and apimachinery ( #14444 )
...
* version bump on k8s io client-go and apimachinery
* bazel file served
* fixing build issues
* some changes in noops functions
* Update CHANGELOG.md
---------
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com >
Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com >
2024-09-12 14:59:43 +00:00
Preston Van Loon
3233e64ace
beacon-chain/cache: Convert tests to cache_test blackbox testing ( #13920 )
...
* beacon-chain/cache: convert to blackbox tests (package cache_test)
* Move balanceCacheKey to its own file to satisify go fuzz build
2024-04-26 02:50:58 +00:00
Sammy Rosso
c8d6f47749
Remove EnableEIP4881 flag ( #13826 )
...
* Remove EnableEIP4881 flag
* Gaz
* Fix missing error handler
* Remove old tree and fix tests
* Gaz
* Fix build import
* Replace depositcache
* Add pendingDeposit tests
* Nishant's fix
* Fix unsafe uint64 to int
* Fix other unsafe uint64 to int
* Remove: RemovePendingDeposit
* Deprecate and remove DisableEIP4881 flag
* Check: index not greater than deposit count
* Move index check
2024-04-24 13:24:51 +00:00
Sammy Rosso
2b4bb5d890
Fixed spelling mistakes in comments ( #13833 )
2024-04-01 11:12:20 +00:00
Nishant Das
58b8c31c93
mark in progress ( #13750 )
2024-03-15 16:46:26 +00:00
Potuz
02cbcf8545
only update head at 10 seconds when validating ( #13570 )
...
* only update head at 10 seconds when validating
* fix tests
2024-03-12 15:11:40 +00:00
terence
9d3af41acb
Remove unused deneb code ( #13712 )
...
* Remove unused deneb code
* Gazelle
2024-03-09 00:12:26 +00:00
Nishant Das
f1615c4c88
Employ Dynamic Cache Sizes ( #13640 )
...
* dynamic cache sizes
* tests
* gosimple
* fix it
* add tests
* comments
* skip test
* Update beacon-chain/blockchain/receive_block_test.go
Co-authored-by: terence <terence@prysmaticlabs.com >
---------
Co-authored-by: terence <terence@prysmaticlabs.com >
2024-02-28 10:46:52 +00:00
Radosław Kapka
0b261cba5e
Unify log fields ( #13654 )
...
* unify fields
* fix tests
2024-02-22 22:40:36 +00:00
terence
5a66807989
Update to V5 ( #13622 )
...
* First take at updating everything to v5
* Patch gRPC gateway to use prysm v5
Fix patch
* Update go ssz
---------
Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com >
2024-02-15 05:46:47 +00:00
KeienWang
74f5452a64
Fix typo in [beacon-chain/cache/depositsnapshot/deposit_cache_test.go]: Corrected a spelling error. ( #13532 )
...
Co-authored-by: Nishant Das <nishdas93@gmail.com >
2024-02-03 05:14:32 +00:00
Potuz
9c13d47f4c
fix off by one ( #13529 )
2024-01-26 00:05:56 +00:00
Potuz
cff5e2b5fe
Remove unsafe proposer indices cache ( #13385 )
2023-12-30 12:20:02 +00:00
Potuz
b7e0819f00
refactor Payload Id caches ( #12987 )
...
* init
- getLocalPayload does not use the proposer ID from the cache but takes
it from the block
- Fixed tests in blockchain package
- Fixed tests in the RPC package
- Fixed spectests
EpochProposers takes 256 bytes that can be avoided to be copied, but
this optimization is not clear to be worth it.
assginmentStatus can be optimized to use the cached version from the
TrackedValidatorsCache
We shouldn't cache the proposer duties when calling getDuties but when
we update the epoch boundary instead
* track validators on prepare proposers
* more rpc tests
* more rpc tests
* initialize grpc caches
* Add back fcu log
Also fix two existing bugs wrong parent hash on pre Capella and wrong
blockhashes on altair
* use beacon default fee recipient if there is none in the vc
* fix validator test
* radek's review
* push always proposer settings even if no flag is specified in the VC
* Only register with the builder if the VC flag is set
Great find by @terencechain
* add regression test
* Radek's review
* change signature of registration builder
2023-12-22 18:47:51 +00:00
Potuz
9efaa832cd
use different keys for the proposer indices cache ( #13272 )
...
* use different keys for the proposer indices cache
* Add a way to get the proposer indices from a checkpoint
* fix fuzzing tests
* use htr instead of body root
* move comment
2023-12-19 13:14:55 +00:00
terence
0eff83cb9d
Use a cache of one entry to build attestation ( #13300 )
...
* Use a cache of one entry to build attestation
* Gazelle
* Enforce on RPC side
* Rm unused var
* Potuz feedback, dont use pointer
* Fix tests
* Init fetcher
* Add in-progress
* Add back missing lock
* Potuz feedback
* Update beacon-chain/rpc/prysm/v1alpha1/validator/attester_test.go
Co-authored-by: Potuz <potuz@prysmaticlabs.com >
---------
Co-authored-by: Potuz <potuz@prysmaticlabs.com >
2023-12-18 16:12:43 +00:00
Preston Van Loon
db096488b0
fixing sa4006 ( #13350 )
2023-12-15 16:49:27 +00:00
Preston Van Loon
ff99616833
Fix staticcheck violations ( #13301 )
...
* Fix violations of sa2002
* Fix violations of sa4005
* Fix violations of sa4010
* Fix violations for sa4023
* Comment on commented static checks
2023-12-08 13:07:52 +00:00
Nishant Das
590317553c
Support New Subnet Backbone ( #13179 )
...
* add in changes
* fix it up
* fix test
* gaz
* lint
* add back
* fix tests
* fix it
* fix tests
* add lib
* fix it
2023-12-08 04:07:48 +00:00
terencechain
76fec1799e
Replace Empty Slice Literals with Nil Slices ( #13093 )
...
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2023-10-23 16:36:11 +00:00
terencechain
9387a36b66
Refactor Exported Names to Follow Golang Best Practices ( #13075 )
...
* Fix exported names that start with a package name
* A few more renames
* Fix exported names that start with a package name
* A few more renames
* Radek's feedback
* Fix conflict
* fix keymanager test
* Fix comments
---------
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2023-10-20 16:45:33 +00:00
Sammy Rosso
d55757500f
Integrate EIP-4881 Deposit Tree Into Prysm via a Feature Flag ( #11942 )
...
* Initial spec rewrite
* Finish adding merkle tree implementation
* Last bits
* Move reverse function
* Add comments
* Add deposit tree snapshot
* Add deposit tree
* Add comments + cleanup
* Fixes
* Add missing errors
* Small fixes
* Add unhandled error
* Cleanup
* Fix unsafe file.Close
* Add missing comments
* Small fixes
* Address some of deepSource' compaints
* Add depositCount check
* Add finalizedDeposit check
* Replace pointer magic with copy()
* Add test for slice reversal
* add back bytes method
* Add package level description
* Remove zerohash gen and add additional checks
* Add additional comments
* Small lint fixes
* Forgot an error
* Small fixes
* Move Uint64ToBytesLittleEndian32 + test
* Fix uint subtraction issue
* Move mixInLength below error handling
* Fix
* Fix deposit root
* integrate 4881
* edits
* added in deposit tree fetcher
* add file
* Add remaining fetcher functions
* Add new file for inserter functions
* Fixes and additional funcs
* Cleanup
* Add
* Graph
* pushed up edits
* fix up
* Updates
* Add EIP4881 toggle flag
* Add interfaces
* Fix tests
* More changes
* Fix
* Remove generated graph
* Fix spacing
* Changes
* Fixes
* Changes
* Test Fix
* gaz
* Fix a couple tests
* Fix last tests
* define protos
* proto methods
* pushed
* regen
* Add proto funcs
* builds
* pushin up
* Fix and cleanup
* Fix spectest
* General cleanup
* add 4881 to e2e
* Remove debug statements + remove test skip
* Implement first set of missing methods
* Replace Zerohashes + cleanup
* gazelle
* fmt
* Put back defensive check
* Add error logs
* InsertFinalizedDeposits: return an error
* Remove logging
* Radek' Review
* Lint fixes
* build
* Remove cancel
* Update beacon-chain/deterministic-genesis/service.go
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com >
* Update beacon-chain/cache/depositsnapshot/deposit_inserter.go
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com >
* Cleanup
* Fix panic when DepositSnapshot is nil on init
* Gofmt
* Fix RootEquivalence test
* Gofmt
* Add missing comments
* Nishant' review
* Add Insert benchmarks
* fix up copy method
* Fix deep copy
* Fix conflicts
* Return error
* Fix linter issues
* add in migration logic
* Cleanup + tests
* fix
* Fix incorrect index in test
* Fix linter
* Gofmt
* fix it
* fixes for off by 1
* gaz
* fix cast
* fix it
* remove ErrZeroIndex
* Fix merkle_tree_test
* add fallback
* add fix for insertion bug
* add many fixes
* fix empty snapshot
* clean up
* use feature
* remove check
* fix failing tests
* skip it
* fix test
* fix test again
* fix for the last time
* Apply suggestions from code review
Co-authored-by: Radosław Kapka <rkapka@wp.pl >
* fix it
* remove cancel
* fix for voting
* addressing more comments
* fix err
* potuz's review
* one more test
* fix bad test
* make 4881 part of dev mode
* add workaround for new trie
* comment
* preston's review
* james's review
* add comment
* james review
* preston's review
* remove skipped test
* gaz
---------
Co-authored-by: rauljordan <raul@prysmaticlabs.com >
Co-authored-by: nisdas <nishdas93@gmail.com >
Co-authored-by: Radosław Kapka <rkapka@wp.pl >
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2023-09-07 03:19:32 +00:00
Radosław Kapka
8aa688729d
Cleanup of ProposerPayloadIDsCache ( #12474 )
...
* Cleanup of `ProposerPayloadIDsCache`
* one more comment
* Update beacon-chain/cache/payload_id.go
Co-authored-by: terencechain <terence@prysmaticlabs.com >
* Update beacon-chain/cache/payload_id.go
Co-authored-by: terencechain <terence@prysmaticlabs.com >
---------
Co-authored-by: terencechain <terence@prysmaticlabs.com >
2023-05-29 16:10:28 +00:00
james-prysm
8dfb92c605
reverting expiration logic on validator while using --enable-registration-cache ( #12436 )
...
* reverting expiration logic
* gaz
2023-05-22 14:54:09 +00:00
Nick Sullivan
5c00fcb84f
Fix numerous spelling error and typos in the log messages, comments, and documentation. ( #12385 )
...
* Minor typos and spelling fixes (comments, logs, & docs only, no code changes)
* Fix seplling in log message
* Additional spelling tweaks based on review from @prestonvanloon
2023-05-11 20:45:43 +00:00
james-prysm
83416f31a5
Unregister validator - fix behind feature flag ( #12316 )
...
* adding changes to blocks
* trying out expiration
* adding implementation, have WIP for tests
* adding unit tests for cache
* fixing bazel complaints
* fix linting
* adding safe check for unint type
* changing approach to safety check
* adding cache to bazel to test fixing build
* reverting bazel change and adding flag to usage
* implementing interface on mock to fix build error
* fixing unit tests
* fixing unit test
* fixing unit tests
* fixing linting
* fixing more unit tests
* fixing produce blinded block tests
* Update beacon-chain/cache/registration.go
Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com >
* resolving review comments
* fixing cache
* Update beacon-chain/cache/registration.go
Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com >
* Update beacon-chain/cache/registration.go
Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com >
* fixing time logic
* adding context to trace
* fix bazel lint
* fixing context dependency
* fix linting
* Update cmd/beacon-chain/flags/base.go
Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com >
* addressing review comments
* fixing deepsource issues
* improving the default settings
* fixing bazel
* removing irrelevant unit test
* updating name
---------
Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com >
2023-04-28 21:27:47 +00:00
Sammy Rosso
d382abe198
InsertFinalizedDeposits: return an error ( #12342 )
...
* InsertFinalizedDeposits: return an error
* Remove logging
* Radek' Review
---------
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com >
2023-04-28 20:59:09 +00:00
kasey
f962d13407
Fix committee test race ( #12338 )
...
* fix races in committee cache tests
* lint
* gratuitous defer ClearCache if ClearCache
* log warning to avoid failed block processing
* gaz
* add Clear to cache stubs
* fix Clear mistakes
* last fake cache fix
---------
Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com >
2023-04-27 00:50:04 +00:00
terencechain
d17996f8b0
Update to V4 🚀 ( #12134 )
...
* Update V3 from V4
* Fix build v3 -> v4
* Update ssz
* Update beacon_chain.pb.go
* Fix formatter import
* Update update-mockgen.sh comment to v4
* Fix conflicts. Pass build and tests
* Fix test
2023-03-17 18:52:56 +00:00
Sammy Rosso
8aec170f9b
Eip4881: Tests ( #11754 )
2023-03-14 08:29:48 -07:00
Sammy Rosso
9529c73ff1
EIP-4881: Spec implementation ( #11720 )
...
* Initial spec rewrite
* Finish adding merkle tree implementation
* Last bits
* Move reverse function
* Add comments
* Add deposit tree snapshot
* Add deposit tree
* Add comments + cleanup
* Fixes
* Add missing errors
* Small fixes
* Add unhandled error
* Cleanup
* Fix unsafe file.Close
* Add missing comments
* Small fixes
* Address some of deepSource' compaints
* Add depositCount check
* Add finalizedDeposit check
* Replace pointer magic with copy()
* Add test for slice reversal
* add back bytes method
* Add package level description
* Remove zerohash gen and add additional checks
* Add additional comments
* Small lint fixes
* Forgot an error
* Small fixes
* Move Uint64ToBytesLittleEndian32 + test
* Fix uint subtraction issue
* Move mixInLength below error handling
* Fix
* Fix deposit root
---------
Co-authored-by: rauljordan <raul@prysmaticlabs.com >
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2023-01-27 17:35:25 +00:00
Radosław Kapka
77d3ccb9ad
Clean up state types ( #11916 )
...
* Clean up state types
* rename package
2023-01-26 14:40:12 +00:00
terencechain
0a4b0a68d3
Clean up unused code ( #11900 )
...
* Clean up unused code
* More unused
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2023-01-25 10:09:14 +00:00
Raul Jordan
0b0373f2fd
Remove Lock from Checkpoint Cache as LRU is Already Thread-Safe ( #11846 )
...
* lru cache in prysm is already thread safe
* rem import
2023-01-05 16:00:11 +00:00