diff --git a/.github/mergify.yml b/.github/mergify.yml index 73267904b8..4ab73bcf07 100644 --- a/.github/mergify.yml +++ b/.github/mergify.yml @@ -1,8 +1,10 @@ pull_request_rules: - name: Ask to resolve conflict conditions: + - -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. @@ -12,6 +14,64 @@ 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: + - -closed + - label=ready-for-review + - or: + - check-skipped=test-suite-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}}? 🙏 + label: + add: + - waiting-on-author + remove: + - ready-for-review + + - name: Update labels when PR is unblocked + conditions: + - -closed + - -draft + - label=waiting-on-author + - -conflict + # Unfortunately, it doesn't look like there's an easy way to check for PRs pending + # CI workflows approvals. + - check-success=test-suite-success + - 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`. + - "#changes-requested-reviews-by = 0" + - "#review-threads-unresolved = 0" + actions: + label: + remove: + - waiting-on-author + add: + - ready-for-review + + - name: Close stale pull request after 30 days of inactivity + conditions: + - -closed + - 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: diff --git a/beacon_node/src/cli.rs b/beacon_node/src/cli.rs index f3f9aa97a2..eb27a03552 100644 --- a/beacon_node/src/cli.rs +++ b/beacon_node/src/cli.rs @@ -822,7 +822,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 b6aacbb77a..f8acd28f32 100644 --- a/beacon_node/store/src/state_cache.rs +++ b/beacon_node/store/src/state_cache.rs @@ -345,7 +345,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 b2d2af6cec..642add152e 100644 --- a/book/src/help_bn.md +++ b/book/src/help_bn.md @@ -381,7 +381,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 26b6c8ff0e..7a5a83cb29 100644 --- a/lighthouse/tests/beacon_node.rs +++ b/lighthouse/tests/beacon_node.rs @@ -1829,7 +1829,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() {