From 6c8770e80d0339e037407cd59e3c41464f1ad385 Mon Sep 17 00:00:00 2001 From: Michael Sproul Date: Tue, 29 Apr 2025 11:43:25 +1000 Subject: [PATCH 01/10] Change default state cache size back to 128 (#7364) Closes: - https://github.com/sigp/lighthouse/issues/7363 - Change default state cache size back to 128. - Make state pruning properly LRU rather than MSU after skipping the cull-exempt states. --- beacon_node/src/cli.rs | 2 +- beacon_node/store/src/state_cache.rs | 4 +- book/src/help_bn.md | 2 +- lighthouse/tests/beacon_node.rs | 2 +- scripts/tests/doppelganger_protection.sh | 66 +++++++++++++++--------- 5 files changed, 48 insertions(+), 28 deletions(-) diff --git a/beacon_node/src/cli.rs b/beacon_node/src/cli.rs index 5de096b25f..271c6d3b68 100644 --- a/beacon_node/src/cli.rs +++ b/beacon_node/src/cli.rs @@ -821,7 +821,7 @@ pub fn cli_app() -> Command { .long("state-cache-size") .value_name("STATE_CACHE_SIZE") .help("Specifies the size of the state cache") - .default_value("32") + .default_value("128") .action(ArgAction::Set) .display_order(0) ) diff --git a/beacon_node/store/src/state_cache.rs b/beacon_node/store/src/state_cache.rs index 281ecab152..bc062a4e0c 100644 --- a/beacon_node/store/src/state_cache.rs +++ b/beacon_node/store/src/state_cache.rs @@ -245,7 +245,9 @@ impl StateCache { let mut old_boundary_state_roots = vec![]; let mut good_boundary_state_roots = vec![]; - for (&state_root, (_, state)) in self.states.iter().skip(cull_exempt) { + // Skip the `cull_exempt` most-recently used, then reverse the iterator to start at + // least-recently used states. + for (&state_root, (_, state)) in self.states.iter().skip(cull_exempt).rev() { let is_advanced = state.slot() > state.latest_block_header().slot; let is_boundary = state.slot() % E::slots_per_epoch() == 0; let could_finalize = diff --git a/book/src/help_bn.md b/book/src/help_bn.md index 1942f737df..04b40f224e 100644 --- a/book/src/help_bn.md +++ b/book/src/help_bn.md @@ -389,7 +389,7 @@ Options: Minimum number of states to cull from the state cache when it gets full [default: 1] --state-cache-size - Specifies the size of the state cache [default: 32] + Specifies the size of the state cache [default: 128] --suggested-fee-recipient Emergency fallback fee recipient for use in case the validator client does not have one configured. You should set this flag on the diff --git a/lighthouse/tests/beacon_node.rs b/lighthouse/tests/beacon_node.rs index 86104ce050..ac94da3552 100644 --- a/lighthouse/tests/beacon_node.rs +++ b/lighthouse/tests/beacon_node.rs @@ -1873,7 +1873,7 @@ fn block_cache_size_flag() { fn state_cache_size_default() { CommandLineTest::new() .run_with_zero_port() - .with_config(|config| assert_eq!(config.store.state_cache_size, new_non_zero_usize(32))); + .with_config(|config| assert_eq!(config.store.state_cache_size, new_non_zero_usize(128))); } #[test] fn state_cache_size_flag() { diff --git a/scripts/tests/doppelganger_protection.sh b/scripts/tests/doppelganger_protection.sh index 5be5c13dee..288f9d72d0 100755 --- a/scripts/tests/doppelganger_protection.sh +++ b/scripts/tests/doppelganger_protection.sh @@ -74,18 +74,27 @@ if [[ "$BEHAVIOR" == "failure" ]]; then vc_1_keys_artifact_id="1-lighthouse-geth-$vc_1_range_start-$vc_1_range_end" service_name=vc-1-doppelganger - kurtosis service add \ - --files /validator_keys:$vc_1_keys_artifact_id,/testnet:el_cl_genesis_data \ - $ENCLAVE_NAME $service_name $LH_IMAGE_NAME -- lighthouse \ - vc \ - --debug-level debug \ - --testnet-dir=/testnet \ - --validators-dir=/validator_keys/keys \ - --secrets-dir=/validator_keys/secrets \ - --init-slashing-protection \ - --beacon-nodes=http://$bn_2_url:$bn_2_port \ - --enable-doppelganger-protection \ - --suggested-fee-recipient 0x690B9A9E9aa1C9dB991C7721a92d351Db4FaC990 + kurtosis service add $ENCLAVE_NAME $service_name --json-service-config - << EOF + { + "image": "$LH_IMAGE_NAME", + "files": { + "/validator_keys": ["$vc_1_keys_artifact_id"], + "/testnet": ["el_cl_genesis_data"] + }, + "cmd": [ + "lighthouse", + "vc", + "--debug-level", "info", + "--testnet-dir=/testnet", + "--validators-dir=/validator_keys/keys", + "--secrets-dir=/validator_keys/secrets", + "--init-slashing-protection", + "--beacon-nodes=http://$bn_2_url:$bn_2_port", + "--enable-doppelganger-protection", + "--suggested-fee-recipient", "0x690B9A9E9aa1C9dB991C7721a92d351Db4FaC990" + ] + } +EOF # Check if doppelganger VC has stopped and exited. Exit code 1 means the check timed out and VC is still running. check_exit_cmd="until [ \$(get_service_status $service_name) != 'RUNNING' ]; do sleep 1; done" @@ -110,18 +119,27 @@ if [[ "$BEHAVIOR" == "success" ]]; then vc_4_keys_artifact_id="4-lighthouse-geth-$vc_4_range_start-$vc_4_range_end" service_name=vc-4 - kurtosis service add \ - --files /validator_keys:$vc_4_keys_artifact_id,/testnet:el_cl_genesis_data \ - $ENCLAVE_NAME $service_name $LH_IMAGE_NAME -- lighthouse \ - vc \ - --debug-level debug \ - --testnet-dir=/testnet \ - --validators-dir=/validator_keys/keys \ - --secrets-dir=/validator_keys/secrets \ - --init-slashing-protection \ - --beacon-nodes=http://$bn_2_url:$bn_2_port \ - --enable-doppelganger-protection \ - --suggested-fee-recipient 0x690B9A9E9aa1C9dB991C7721a92d351Db4FaC990 + kurtosis service add $ENCLAVE_NAME $service_name --json-service-config - << EOF + { + "image": "$LH_IMAGE_NAME", + "files": { + "/validator_keys": ["$vc_4_keys_artifact_id"], + "/testnet": ["el_cl_genesis_data"] + }, + "cmd": [ + "lighthouse", + "vc", + "--debug-level", "info", + "--testnet-dir=/testnet", + "--validators-dir=/validator_keys/keys", + "--secrets-dir=/validator_keys/secrets", + "--init-slashing-protection", + "--beacon-nodes=http://$bn_2_url:$bn_2_port", + "--enable-doppelganger-protection", + "--suggested-fee-recipient", "0x690B9A9E9aa1C9dB991C7721a92d351Db4FaC990" + ] + } +EOF doppelganger_failure=0 From e42406d7b79a85ad4622f3a7440ff6468ac4c9e1 Mon Sep 17 00:00:00 2001 From: Mac L Date: Tue, 29 Apr 2025 22:29:42 +1000 Subject: [PATCH 02/10] Release v7.0.1 (#7374) Bump all required version numbers to `v7.0.1` to prepare for the next release. --- Cargo.lock | 8 ++++---- beacon_node/Cargo.toml | 2 +- boot_node/Cargo.toml | 2 +- common/lighthouse_version/src/lib.rs | 6 +++--- lcli/Cargo.toml | 2 +- lighthouse/Cargo.toml | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9e15ce9a58..2fbe9addb9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -860,7 +860,7 @@ dependencies = [ [[package]] name = "beacon_node" -version = "7.0.0" +version = "7.0.1" dependencies = [ "account_utils", "beacon_chain", @@ -1108,7 +1108,7 @@ dependencies = [ [[package]] name = "boot_node" -version = "7.0.0" +version = "7.0.1" dependencies = [ "beacon_node", "bytes", @@ -4813,7 +4813,7 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "lcli" -version = "7.0.0" +version = "7.0.1" dependencies = [ "account_utils", "beacon_chain", @@ -5368,7 +5368,7 @@ dependencies = [ [[package]] name = "lighthouse" -version = "7.0.0" +version = "7.0.1" dependencies = [ "account_manager", "account_utils", diff --git a/beacon_node/Cargo.toml b/beacon_node/Cargo.toml index 79dad05886..1d4ae3aa27 100644 --- a/beacon_node/Cargo.toml +++ b/beacon_node/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "beacon_node" -version = "7.0.0" +version = "7.0.1" authors = [ "Paul Hauner ", "Age Manning "] edition = { workspace = true } diff --git a/common/lighthouse_version/src/lib.rs b/common/lighthouse_version/src/lib.rs index 919e3976e7..16023a1d8b 100644 --- a/common/lighthouse_version/src/lib.rs +++ b/common/lighthouse_version/src/lib.rs @@ -17,8 +17,8 @@ pub const VERSION: &str = git_version!( // NOTE: using --match instead of --exclude for compatibility with old Git "--match=thiswillnevermatchlol" ], - prefix = "Lighthouse/v7.0.0-", - fallback = "Lighthouse/v7.0.0" + prefix = "Lighthouse/v7.0.1-", + fallback = "Lighthouse/v7.0.1" ); /// Returns the first eight characters of the latest commit hash for this build. @@ -54,7 +54,7 @@ pub fn version_with_platform() -> String { /// /// `1.5.1` pub fn version() -> &'static str { - "7.0.0" + "7.0.1" } /// Returns the name of the current client running. diff --git a/lcli/Cargo.toml b/lcli/Cargo.toml index 639f2130a4..a543719d25 100644 --- a/lcli/Cargo.toml +++ b/lcli/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "lcli" description = "Lighthouse CLI (modeled after zcli)" -version = "7.0.0" +version = "7.0.1" authors = ["Paul Hauner "] edition = { workspace = true } diff --git a/lighthouse/Cargo.toml b/lighthouse/Cargo.toml index 50a80cbbe3..c423ba0722 100644 --- a/lighthouse/Cargo.toml +++ b/lighthouse/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lighthouse" -version = "7.0.0" +version = "7.0.1" authors = ["Sigma Prime "] edition = { workspace = true } autotests = false From b1138c28fb940b49f52bb627c37b891adaab2fd8 Mon Sep 17 00:00:00 2001 From: Jimmy Chen Date: Thu, 15 May 2025 15:54:24 +1000 Subject: [PATCH 03/10] Add additional mergify rules to automate triaging (#7451) * Add additional mergify rules to automate triaging. * Update mergify config. --- .github/mergify.yml | 52 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/.github/mergify.yml b/.github/mergify.yml index 73267904b8..a314ec3e98 100644 --- a/.github/mergify.yml +++ b/.github/mergify.yml @@ -12,6 +12,58 @@ pull_request_rules: comment: message: This pull request has merge conflicts. Could you please resolve them @{{author}}? 🙏 + label: + add: + - waiting-on-author + remove: + - ready-for-review + + - name: Ask to resolve CI failures + conditions: + - or: + - check-failure=test-suite-success + - check-skipped=test-suite-success + - check-failure=local-testnet-success + - check-skipped=local-testnet-success + actions: + comment: + message: Some required checks have failed. Could you please take a look @{{author}}? 🙏 + label: + add: + - waiting-on-author + remove: + - ready-for-review + + - name: Update labels when PR is unblocked + conditions: + - label=waiting-on-author + - -conflict + - check-failure!=test-suite-success + - check-failure!=local-testnet-success + - "#review-requested > 0" + actions: + label: + remove: + - waiting-on-author + add: + - ready-for-review + comment: + message: > + All required checks have passed and there are no merge conflicts. + This pull request may now be ready for another review. + + - name: Close stale pull request after 30 days of inactivity + conditions: + - label=waiting-on-author + - updated-at<=30 days ago + actions: + close: + message: > + Hi @{{author}}, this pull request has been closed automatically due to 30 days of inactivity. + If you’d like to continue working on it, feel free to reopen at any time. + label: + add: + - stale - name: Approve trivial maintainer PRs conditions: From cc6ae9d3f09c412a97e887a87a00a9877282f294 Mon Sep 17 00:00:00 2001 From: Jimmy Chen Date: Thu, 15 May 2025 16:54:56 +1000 Subject: [PATCH 04/10] Fix mergify infinite loop. (#7463) * Fix mergify infinite loop. * Update rule for `ready-for-review` label. * More fix to prevent infinite loop --- .github/mergify.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/mergify.yml b/.github/mergify.yml index a314ec3e98..718c8ba3fe 100644 --- a/.github/mergify.yml +++ b/.github/mergify.yml @@ -1,6 +1,7 @@ pull_request_rules: - name: Ask to resolve conflict conditions: + - -closed - conflict - -author=dependabot[bot] - or: @@ -20,6 +21,7 @@ pull_request_rules: - name: Ask to resolve CI failures conditions: + - -closed - or: - check-failure=test-suite-success - check-skipped=test-suite-success @@ -36,10 +38,15 @@ pull_request_rules: - name: Update labels when PR is unblocked conditions: + - -closed + - -draft - label=waiting-on-author - -conflict + # Need to be the logical opposite of the above rule `Ask to resolve CI failures`, otherwise mergify will run into an infinite loop. - check-failure!=test-suite-success + - check-skipped!=test-suite-success - check-failure!=local-testnet-success + - check-skipped!=local-testnet-success - "#review-requested > 0" actions: label: @@ -54,6 +61,7 @@ pull_request_rules: - name: Close stale pull request after 30 days of inactivity conditions: + - -closed - label=waiting-on-author - updated-at<=30 days ago actions: From e0ee148d6acac639d2b847f86018ae1d482837ab Mon Sep 17 00:00:00 2001 From: Jimmy Chen Date: Fri, 16 May 2025 11:46:21 +1000 Subject: [PATCH 05/10] Prevent mergify from updating labels while CI is still running. (#7470) --- .github/mergify.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/mergify.yml b/.github/mergify.yml index 718c8ba3fe..7b8a138f57 100644 --- a/.github/mergify.yml +++ b/.github/mergify.yml @@ -23,10 +23,10 @@ pull_request_rules: conditions: - -closed - or: - - check-failure=test-suite-success - check-skipped=test-suite-success - - check-failure=local-testnet-success - check-skipped=local-testnet-success + - check-failure=test-suite-success + - check-failure=local-testnet-success actions: comment: message: Some required checks have failed. Could you please take a look @{{author}}? 🙏 @@ -42,11 +42,10 @@ pull_request_rules: - -draft - label=waiting-on-author - -conflict - # Need to be the logical opposite of the above rule `Ask to resolve CI failures`, otherwise mergify will run into an infinite loop. - - check-failure!=test-suite-success - - check-skipped!=test-suite-success - - check-failure!=local-testnet-success - - check-skipped!=local-testnet-success + # Unfortunately, it doesn't look like there's an easy way to check for PRs pending + # CI workflows approvals. + - check-success=local-testnet-success + - check-success=local-testnet-success - "#review-requested > 0" actions: label: From e21198c08baaa796ad0fa57b589be7632116c1af Mon Sep 17 00:00:00 2001 From: Jimmy Chen Date: Fri, 16 May 2025 13:55:06 +1000 Subject: [PATCH 06/10] One more attempt to fix mergify condition. (#7472) --- .github/mergify.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/mergify.yml b/.github/mergify.yml index 7b8a138f57..48d76219e3 100644 --- a/.github/mergify.yml +++ b/.github/mergify.yml @@ -44,7 +44,7 @@ pull_request_rules: - -conflict # Unfortunately, it doesn't look like there's an easy way to check for PRs pending # CI workflows approvals. - - check-success=local-testnet-success + - check-success=test-suite-success - check-success=local-testnet-success - "#review-requested > 0" actions: From 7759cb8f91c01a7d335469d317b5787368656064 Mon Sep 17 00:00:00 2001 From: Jimmy Chen Date: Wed, 21 May 2025 18:18:48 +1000 Subject: [PATCH 07/10] Update mergify rule to not evaluate PRs that are not ready for review - to reduce noise and avoid updating stale PRs. (#7494) --- .github/mergify.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/mergify.yml b/.github/mergify.yml index 48d76219e3..f4d1520826 100644 --- a/.github/mergify.yml +++ b/.github/mergify.yml @@ -4,6 +4,7 @@ pull_request_rules: - -closed - conflict - -author=dependabot[bot] + - label=ready-for-review - or: - -draft # Don't report conflicts on regular draft. - and: # Do report conflicts on draft that are scheduled for the next major release. @@ -22,6 +23,7 @@ pull_request_rules: - name: Ask to resolve CI failures conditions: - -closed + - label=ready-for-review - or: - check-skipped=test-suite-success - check-skipped=local-testnet-success From 8dde5bdb4413f5f1faf3203bf405a563f5449600 Mon Sep 17 00:00:00 2001 From: Jimmy Chen Date: Tue, 27 May 2025 23:03:22 +1000 Subject: [PATCH 08/10] Update mergify rules so that I can add `waiting-on-author` on a PR that's passing CI. Remove noisy comments. --- .github/mergify.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/mergify.yml b/.github/mergify.yml index f4d1520826..a84b51b32e 100644 --- a/.github/mergify.yml +++ b/.github/mergify.yml @@ -48,17 +48,17 @@ pull_request_rules: # CI workflows approvals. - check-success=test-suite-success - check-success=local-testnet-success - - "#review-requested > 0" + # Update the label only if there are no more change requests from any reviewers and no unresolved threads. + # This rule ensures that a PR with passing CI can be marked as `waiting-on-author`. + - or: + - "#changes-requested-reviews-by = 0" + - "#review-threads-unresolved = 0" actions: label: remove: - waiting-on-author add: - ready-for-review - comment: - message: > - All required checks have passed and there are no merge conflicts. - This pull request may now be ready for another review. - name: Close stale pull request after 30 days of inactivity conditions: From b7fc03437bbab2fe6455c0065d2fbc0467b437d1 Mon Sep 17 00:00:00 2001 From: Jimmy Chen Date: Wed, 28 May 2025 10:55:14 +1000 Subject: [PATCH 09/10] Fix condition --- .github/mergify.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/mergify.yml b/.github/mergify.yml index a84b51b32e..6caf2c4bf0 100644 --- a/.github/mergify.yml +++ b/.github/mergify.yml @@ -50,7 +50,7 @@ pull_request_rules: - check-success=local-testnet-success # Update the label only if there are no more change requests from any reviewers and no unresolved threads. # This rule ensures that a PR with passing CI can be marked as `waiting-on-author`. - - or: + - and: - "#changes-requested-reviews-by = 0" - "#review-threads-unresolved = 0" actions: From 9e9c51be6fef85c4995f032294025b3c55133d6c Mon Sep 17 00:00:00 2001 From: Jimmy Chen Date: Wed, 28 May 2025 10:59:17 +1000 Subject: [PATCH 10/10] Remove redundant `and` --- .github/mergify.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/mergify.yml b/.github/mergify.yml index 6caf2c4bf0..4ab73bcf07 100644 --- a/.github/mergify.yml +++ b/.github/mergify.yml @@ -50,9 +50,8 @@ pull_request_rules: - check-success=local-testnet-success # Update the label only if there are no more change requests from any reviewers and no unresolved threads. # This rule ensures that a PR with passing CI can be marked as `waiting-on-author`. - - and: - - "#changes-requested-reviews-by = 0" - - "#review-threads-unresolved = 0" + - "#changes-requested-reviews-by = 0" + - "#review-threads-unresolved = 0" actions: label: remove: