iuna

iuna

iuna - experimental mainnet-candidate protocol
git clone https://getiuna.org/git/iuna.git
Log | Files | Refs | README | LICENSE

commit ff891838bb9f4bd7ca3efb27a4b31d692565c264
parent 1e0f6c7e259f628017cdf02b43a7a5315b8aa585
Author: Joris Hartog <jorishartog@hotmail.com>
Date:   Thu, 10 Sep 2026 08:32:47 +0200

fix(p2p): tolerate stale fork gossip

Diffstat:
M.gitignore | 1+
Msrc/adapters/p2p/peer_addr.rs | 20++++++++++++++++++++
2 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/.gitignore b/.gitignore @@ -4,6 +4,7 @@ /.docker-build /.iuna /e2e/.runtime +/release-evidence /src-tauri/target /src-tauri/gen /src-tauri/binaries/iuna-sidecar-* diff --git a/src/adapters/p2p/peer_addr.rs b/src/adapters/p2p/peer_addr.rs @@ -139,6 +139,11 @@ pub(super) fn inbound_error_counts_as_misbehavior(message: &str) -> bool { !message.contains("block timestamp is too far in the future") && !message.contains("block timestamp is before finalizer rank") && !message.contains("block page has no common ancestor with local chain") + && !message.contains("burn bundle parent hash is invalid") + && !message.contains( + "burn transaction anchor is not valid for either of the next two block heights", + ) + && !message.contains("mine transaction anchor is not on this chain") } #[cfg(test)] @@ -165,4 +170,19 @@ mod tests { assert!(is_possible_fork_error(&anyhow!(message))); assert!(!inbound_error_counts_as_misbehavior(message)); } + + #[test] + fn fork_scoped_gossip_errors_do_not_penalize_peers() { + for message in [ + "burn bundle parent hash is invalid", + "burn transaction anchor is not valid for either of the next two block heights", + "mine transaction anchor is not on this chain", + ] { + assert!(!inbound_error_counts_as_misbehavior(message)); + } + + assert!(inbound_error_counts_as_misbehavior( + "burn bundle signature is invalid" + )); + } }