mirror of
https://github.com/sigp/lighthouse.git
synced 2026-06-29 10:54:24 +00:00
Lenient duplicate checks on HTTP API for block publication (#5574)
* start splitting gossip verification * WIP * Gossip verify separate (#7) * save * save * make ProvenancedBlock concrete * delete into gossip verified block contents * get rid of IntoBlobSidecar trait * remove IntoGossipVerified trait * get tests compiling * don't check sidecar slashability in publish * remove second publish closure * drop blob bool. also prefer using message index over index of position in list * Merge remote-tracking branch 'origin/unstable' into gossip-verify-separate * Fix low-hanging tests * Fix tests and clean up * Clean up imports * more cleanup * Merge remote-tracking branch 'origin/unstable' into gossip-verify-separate * Further refine behaviour and add tests * Merge remote-tracking branch 'origin/unstable' into gossip-verify-separate * Merge remote-tracking branch 'origin/unstable' into gossip-verify-separate * Remove empty line * Fix test (block is not fully imported just gossip verified) * Merge remote-tracking branch 'origin/unstable' into gossip-verify-separate * Update for unstable & use empty blob list * Update comment * Add test for duplicate block case * Merge remote-tracking branch 'origin/unstable' into gossip-verify-separate * Clarify unreachable case * Fix another publish_block case * Remove unreachable case in filter chain segment * Revert unrelated blob optimisation * Merge remote-tracking branch 'origin/unstable' into gossip-verify-separate * Merge remote-tracking branch 'origin/unstable' into gossip-verify-separate * Fix merge conflicts * Merge remote-tracking branch 'origin/unstable' into gossip-verify-separate * Fix some compilation issues. Impl is fucked though * Support peerDAS * Fix tests * Merge remote-tracking branch 'origin/unstable' into gossip-verify-separate * Fix conflict * Merge remote-tracking branch 'origin/unstable' into gossip-verify-separate * Address review comments * Merge remote-tracking branch 'origin/unstable' into gossip-verify-separate
This commit is contained in:
@@ -976,7 +976,7 @@ async fn block_gossip_verification() {
|
||||
|
||||
harness
|
||||
.chain
|
||||
.process_gossip_blob(gossip_verified)
|
||||
.process_gossip_blob(gossip_verified, || Ok(()))
|
||||
.await
|
||||
.expect("should import valid gossip verified blob");
|
||||
}
|
||||
@@ -1173,7 +1173,7 @@ async fn block_gossip_verification() {
|
||||
assert!(
|
||||
matches!(
|
||||
unwrap_err(harness.chain.verify_block_for_gossip(Arc::new(block.clone())).await),
|
||||
BlockError::BlockIsAlreadyKnown(_),
|
||||
BlockError::DuplicateImportStatusUnknown(_),
|
||||
),
|
||||
"should register any valid signature against the proposer, even if the block failed later verification"
|
||||
);
|
||||
@@ -1201,7 +1201,7 @@ async fn block_gossip_verification() {
|
||||
.verify_block_for_gossip(block.clone())
|
||||
.await
|
||||
.expect_err("should error when processing known block"),
|
||||
BlockError::BlockIsAlreadyKnown(_)
|
||||
BlockError::DuplicateImportStatusUnknown(_)
|
||||
),
|
||||
"the second proposal by this validator should be rejected"
|
||||
);
|
||||
@@ -1247,7 +1247,7 @@ async fn verify_block_for_gossip_slashing_detection() {
|
||||
.unwrap();
|
||||
harness
|
||||
.chain
|
||||
.process_gossip_blob(verified_blob)
|
||||
.process_gossip_blob(verified_blob, || Ok(()))
|
||||
.await
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ async fn blob_sidecar_event_on_process_gossip_blob() {
|
||||
|
||||
let _ = harness
|
||||
.chain
|
||||
.process_gossip_blob(gossip_verified_blob)
|
||||
.process_gossip_blob(gossip_verified_blob, || Ok(()))
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user