diff --git a/beacon_node/http_api/src/beacon/pool.rs b/beacon_node/http_api/src/beacon/pool.rs index c6b8a69643..3525567eb4 100644 --- a/beacon_node/http_api/src/beacon/pool.rs +++ b/beacon_node/http_api/src/beacon/pool.rs @@ -629,6 +629,13 @@ fn publish_payload_attestation_messages( "Payload attestation invalid for fork choice" ); } + + if let Err(e) = chain.add_payload_attestation_to_pool(&verified) { + warn!( + reason = ?e, + "Failed to add payload attestation to pool" + ); + } } Err(PayloadAttestationError::PriorPayloadAttestationMessageKnown { .. }) => { num_already_known += 1; diff --git a/beacon_node/http_api/tests/tests.rs b/beacon_node/http_api/tests/tests.rs index 01a77ad4d7..6f8f9c10a5 100644 --- a/beacon_node/http_api/tests/tests.rs +++ b/beacon_node/http_api/tests/tests.rs @@ -2846,6 +2846,8 @@ impl ApiTester { let message = self.make_valid_payload_attestation_message(0); let fork_name = self.chain.spec.fork_name_at_slot::(message.data.slot); + let pool_count_before = self.chain.op_pool.num_payload_attestation_messages(); + self.client .post_beacon_pool_payload_attestations(&[message], fork_name) .await @@ -2856,6 +2858,12 @@ impl ApiTester { "valid payload attestation should be sent to network" ); + assert_eq!( + self.chain.op_pool.num_payload_attestation_messages(), + pool_count_before + 1, + "payload attestation should be added to op pool" + ); + self } @@ -2863,6 +2871,8 @@ impl ApiTester { let message = self.make_valid_payload_attestation_message(1); let fork_name = self.chain.spec.fork_name_at_slot::(message.data.slot); + let pool_count_before = self.chain.op_pool.num_payload_attestation_messages(); + self.client .post_beacon_pool_payload_attestations_ssz(&[message], fork_name) .await @@ -2873,6 +2883,12 @@ impl ApiTester { "valid payload attestation (SSZ) should be sent to network" ); + assert_eq!( + self.chain.op_pool.num_payload_attestation_messages(), + pool_count_before + 1, + "payload attestation should be added to op pool" + ); + self }