Skip to content

Commit dd67b7e

Browse files
danielxiangzlclaude
andcommitted
[forge] Tighter binary classifier: lower threshold + zero failed_weight + larger window
Tunes the existing ProposerAndVoter binary classifier on three axes so it reliably bans a slow validator instead of leaving it oscillating at the threshold boundary: - failure_threshold_percent: 10 -> 5 V6's injected real failure rate is 10%, exactly at the default threshold. Sampling noise pushed it above only ~26-38% of windows. Lowering the threshold to 5 makes V6's 10% clearly exceed it under any window size. - failed_weight: 1 -> 0 When a validator IS classified failed, it currently keeps a tiny weight (1 vs active 1000), still leaking ~1/N share. Setting to 0 fully excludes. - proposer_window_num_validators_multiplier: 10 -> 50 Larger observation window reduces variance in the failure-rate estimate, so classification flips less and is more decisive when it does. No heuristic changes. Stacks on baseline #19330. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 9e0d4e5 commit dd67b7e

1 file changed

Lines changed: 32 additions & 4 deletions

File tree

testsuite/forge-cli/src/suites/realistic_environment.rs

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ use aptos_forge::{
2020
TransactionType,
2121
};
2222
use aptos_sdk::types::on_chain_config::{
23-
BlockGasLimitType, FeatureFlag, Features, OnChainChunkyDKGConfig, OnChainConsensusConfig,
24-
OnChainExecutionConfig, OnChainRandomnessConfig, TransactionShufflerType,
23+
BlockGasLimitType, ConsensusAlgorithmConfig, FeatureFlag, Features, LeaderReputationType,
24+
OnChainChunkyDKGConfig, OnChainConsensusConfig, OnChainExecutionConfig, OnChainRandomnessConfig,
25+
ProposerAndVoterConfig, ProposerElectionType, TransactionShufflerType,
2526
};
2627
use aptos_testcases::{
2728
load_vs_perf_benchmark::{LoadVsPerfBenchmark, TransactionWorkload, Workloads},
@@ -452,9 +453,36 @@ pub(crate) fn realistic_env_max_load_test(
452453
.with_genesis_helm_config_fn(Arc::new(move |helm_values| {
453454
// No epoch change so measurements are stable.
454455
helm_values["chain"]["epoch_duration_secs"] = (24 * 3600).into();
456+
// Tighter binary classifier for slow leaders:
457+
// - failure_threshold_percent: 10 -> 5 so a validator with a true 10%
458+
// failure rate clearly exceeds the threshold (instead of sitting on
459+
// the boundary, which causes oscillation between active/failed under
460+
// sampling noise).
461+
// - failed_weight: 1 -> 0 so a validator classified failed is excluded
462+
// entirely from leader selection instead of leaking 1/N share.
463+
// - proposer_window_num_validators_multiplier: 10 -> 50 so the larger
464+
// observation window stabilizes the failure-rate estimate.
465+
let mut consensus_config = OnChainConsensusConfig::default_for_genesis();
466+
if let OnChainConsensusConfig::V5 {
467+
alg: ConsensusAlgorithmConfig::JolteonV2 { ref mut main, .. },
468+
..
469+
} = consensus_config
470+
{
471+
main.proposer_election_type = ProposerElectionType::LeaderReputation(
472+
LeaderReputationType::ProposerAndVoterV2(ProposerAndVoterConfig {
473+
active_weight: 1000,
474+
inactive_weight: 10,
475+
failed_weight: 0, // bumped from 1: classified-failed -> banned
476+
failure_threshold_percent: 5, // bumped from 10: clear of V6's true 10%
477+
proposer_window_num_validators_multiplier: 50, // bumped from 10
478+
voter_window_num_validators_multiplier: 1,
479+
weight_by_voting_power: true,
480+
use_history_from_previous_epoch_max_count: 5,
481+
}),
482+
);
483+
}
455484
helm_values["chain"]["on_chain_consensus_config"] =
456-
serde_yaml::to_value(OnChainConsensusConfig::default_for_genesis())
457-
.expect("must serialize");
485+
serde_yaml::to_value(consensus_config).expect("must serialize");
458486
helm_values["chain"]["on_chain_execution_config"] =
459487
serde_yaml::to_value(OnChainExecutionConfig::default_for_genesis())
460488
.expect("must serialize");

0 commit comments

Comments
 (0)