From d9dd9b43eeff1bf6adf60ed44e7be71fe51b5994 Mon Sep 17 00:00:00 2001 From: Mark Mackey Date: Fri, 13 Jan 2023 10:47:19 -0600 Subject: [PATCH 1/3] Sign BlsToExecutionChange w/ GENESIS_FORK_VERSION --- .../src/per_block_processing/signature_sets.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/consensus/state_processing/src/per_block_processing/signature_sets.rs b/consensus/state_processing/src/per_block_processing/signature_sets.rs index fa37681c7..c05d3f057 100644 --- a/consensus/state_processing/src/per_block_processing/signature_sets.rs +++ b/consensus/state_processing/src/per_block_processing/signature_sets.rs @@ -161,10 +161,9 @@ pub fn bls_execution_change_signature_set<'a, T: EthSpec>( signed_address_change: &'a SignedBlsToExecutionChange, spec: &'a ChainSpec, ) -> Result> { - let domain = spec.get_domain( - state.current_epoch(), + let domain = spec.compute_domain( Domain::BlsToExecutionChange, - &state.fork(), + spec.genesis_fork_version, state.genesis_validators_root(), ); let message = signed_address_change.message.signing_root(domain); From 05c1291d8a8118df5cf1d7bedb385efa53177339 Mon Sep 17 00:00:00 2001 From: Mark Mackey Date: Fri, 13 Jan 2023 12:53:25 -0600 Subject: [PATCH 2/3] Don't Penalize Early `bls_to_execution_change` --- .../src/beacon_processor/worker/gossip_methods.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/beacon_node/network/src/beacon_processor/worker/gossip_methods.rs b/beacon_node/network/src/beacon_processor/worker/gossip_methods.rs index 589d7e9b4..08f659e58 100644 --- a/beacon_node/network/src/beacon_processor/worker/gossip_methods.rs +++ b/beacon_node/network/src/beacon_processor/worker/gossip_methods.rs @@ -1217,11 +1217,13 @@ impl Worker { ); self.propagate_validation_result(message_id, peer_id, MessageAcceptance::Reject); // We penalize the peer slightly to prevent overuse of invalids. - self.gossip_penalize_peer( - peer_id, - PeerAction::HighToleranceError, - "invalid_bls_to_execution_change", - ); + if !matches!(e, BeaconChainError::BlsToExecutionChangeBadFork(_)) { + self.gossip_penalize_peer( + peer_id, + PeerAction::HighToleranceError, + "invalid_bls_to_execution_change", + ); + } return; } }; From 13196837361d2b4aae404f4fb973720fddc35388 Mon Sep 17 00:00:00 2001 From: realbigsean Date: Fri, 13 Jan 2023 14:59:03 -0500 Subject: [PATCH 3/3] Update gossip_methods.rs --- .../beacon_processor/worker/gossip_methods.rs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/beacon_node/network/src/beacon_processor/worker/gossip_methods.rs b/beacon_node/network/src/beacon_processor/worker/gossip_methods.rs index 08f659e58..959a16eb9 100644 --- a/beacon_node/network/src/beacon_processor/worker/gossip_methods.rs +++ b/beacon_node/network/src/beacon_processor/worker/gossip_methods.rs @@ -1215,9 +1215,20 @@ impl Worker { "peer" => %peer_id, "error" => ?e ); - self.propagate_validation_result(message_id, peer_id, MessageAcceptance::Reject); - // We penalize the peer slightly to prevent overuse of invalids. - if !matches!(e, BeaconChainError::BlsToExecutionChangeBadFork(_)) { + // We ignore pre-capella messages without penalizing peers. + if matches!(e, BeaconChainError::BlsToExecutionChangeBadFork(_)) { + self.propagate_validation_result( + message_id, + peer_id, + MessageAcceptance::Ignore, + ); + } else { + // We penalize the peer slightly to prevent overuse of invalids. + self.propagate_validation_result( + message_id, + peer_id, + MessageAcceptance::Reject, + ); self.gossip_penalize_peer( peer_id, PeerAction::HighToleranceError,