Add overlay planning commands

This commit is contained in:
Eric Wendland 2026-05-23 01:17:30 +02:00
commit c2dee50dae
18 changed files with 928 additions and 16 deletions

View file

@ -11,6 +11,7 @@ pub const ALPN_PIPE: &[u8] = b"/geth/pipe/1";
pub const ALPN_DB: &[u8] = b"/geth/db/1";
pub const ALPN_DOCUMENT: &[u8] = b"/geth/document/1";
pub const ALPN_SSH_PROXY: &[u8] = b"/geth/ssh-proxy/1";
pub const ALPN_OVERLAY: &[u8] = b"/geth/overlay/1";
pub const IROH_VERSION: &str = "0.95.1";
pub const IROH_BLOBS_VERSION: &str = "0.97.0";
@ -60,6 +61,7 @@ pub enum ProtocolKind {
Db,
Document,
SshProxy,
Overlay,
}
impl ProtocolKind {
@ -74,6 +76,7 @@ impl ProtocolKind {
Self::Db => "db",
Self::Document => "document",
Self::SshProxy => "ssh-proxy",
Self::Overlay => "overlay",
}
}
}
@ -158,6 +161,7 @@ pub fn default_protocol_descriptors() -> Vec<ProtocolDescriptor> {
ProtocolDescriptor::new(ProtocolKind::Db, ALPN_DB),
ProtocolDescriptor::new(ProtocolKind::Document, ALPN_DOCUMENT),
ProtocolDescriptor::new(ProtocolKind::SshProxy, ALPN_SSH_PROXY),
ProtocolDescriptor::new(ProtocolKind::Overlay, ALPN_OVERLAY),
]
}
@ -431,7 +435,8 @@ mod tests {
assert!(alpns.contains(&ALPN_CONTROL.to_vec()));
assert!(alpns.contains(&ALPN_CAS.to_vec()));
assert!(alpns.contains(&ALPN_SSH_PROXY.to_vec()));
assert_eq!(alpns.len(), 8);
assert!(alpns.contains(&ALPN_OVERLAY.to_vec()));
assert_eq!(alpns.len(), 9);
}
#[test]
@ -478,7 +483,11 @@ mod tests {
router.require(ALPN_SSH_PROXY).expect("ssh proxy").kind,
ProtocolKind::SshProxy
);
assert_eq!(router.descriptors().len(), 8);
assert_eq!(
router.require(ALPN_OVERLAY).expect("overlay").kind,
ProtocolKind::Overlay
);
assert_eq!(router.descriptors().len(), 9);
}
#[test]