From dd90b44c69b7bc7a953bac6fe19451e549d709cc Mon Sep 17 00:00:00 2001 From: Andrew Westberg Date: Fri, 17 Jun 2022 18:26:16 +0000 Subject: [PATCH] Bump n2n protocol versions for babbage --- .gitignore | 3 ++- pallas-miniprotocols/src/handshake/n2n.rs | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index e5300442..0fef8b69 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ Cargo.lock scratchpad .DS_Store -RELEASE.md \ No newline at end of file +RELEASE.md +.idea diff --git a/pallas-miniprotocols/src/handshake/n2n.rs b/pallas-miniprotocols/src/handshake/n2n.rs index 5de76215..e9cad835 100644 --- a/pallas-miniprotocols/src/handshake/n2n.rs +++ b/pallas-miniprotocols/src/handshake/n2n.rs @@ -8,6 +8,9 @@ const PROTOCOL_V4: u64 = 4; const PROTOCOL_V5: u64 = 5; const PROTOCOL_V6: u64 = 6; const PROTOCOL_V7: u64 = 7; +const PROTOCOL_V8: u64 = 8; +const PROTOCOL_V9: u64 = 9; +const PROTOCOL_V10: u64 = 10; impl VersionTable { pub fn v4_and_above(network_magic: u64) -> VersionTable { @@ -16,6 +19,9 @@ impl VersionTable { (PROTOCOL_V5, VersionData::new(network_magic, false)), (PROTOCOL_V6, VersionData::new(network_magic, false)), (PROTOCOL_V7, VersionData::new(network_magic, false)), + (PROTOCOL_V8, VersionData::new(network_magic, false)), + (PROTOCOL_V9, VersionData::new(network_magic, false)), + (PROTOCOL_V10, VersionData::new(network_magic, false)), ] .into_iter() .collect::>(); @@ -27,6 +33,22 @@ impl VersionTable { let values = vec![ (PROTOCOL_V6, VersionData::new(network_magic, false)), (PROTOCOL_V7, VersionData::new(network_magic, false)), + (PROTOCOL_V8, VersionData::new(network_magic, false)), + (PROTOCOL_V9, VersionData::new(network_magic, false)), + (PROTOCOL_V10, VersionData::new(network_magic, false)), + ] + .into_iter() + .collect::>(); + + VersionTable { values } + } + + pub fn v7_and_above(network_magic: u64) -> VersionTable { + let values = vec![ + (PROTOCOL_V7, VersionData::new(network_magic, false)), + (PROTOCOL_V8, VersionData::new(network_magic, false)), + (PROTOCOL_V9, VersionData::new(network_magic, false)), + (PROTOCOL_V10, VersionData::new(network_magic, false)), ] .into_iter() .collect::>();