diff --git a/Cargo.lock b/Cargo.lock index 9aa92b9..eedf678 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -399,7 +399,7 @@ dependencies = [ [[package]] name = "protosol" -version = "18.0.0" +version = "19.0.0" dependencies = [ "prost", "prost-build", diff --git a/Cargo.toml b/Cargo.toml index b7ca46f..aef9ee5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "protosol" -version = "18.0.0" +version = "19.0.0" edition = "2021" license = "Apache-2.0" description = "Protobuf definitions for the SVM fuzzing project." diff --git a/proto/votor.options b/proto/votor.options index 5a09d23..6d418d0 100644 --- a/proto/votor.options +++ b/proto/votor.options @@ -1,24 +1,28 @@ votor.proto package:"fd_exec_test" votor.proto include:"../../../../ballet/nanopb/pb_firedancer.h" -fd_exec_test.VotorBlockId.block_hash max_size:32 fixed_length:true +fd_exec_test.VotorVote.block_id max_size:32 fixed_length:true +fd_exec_test.VotorVote.signature max_size:192 fixed_length:true -fd_exec_test.VotorBlockVote.block_hash max_size:32 fixed_length:true +fd_exec_test.VotorCert.block_id max_size:32 fixed_length:true +fd_exec_test.VotorCert.primary_bitmap max_size:253 +fd_exec_test.VotorCert.fallback_bitmap max_size:253 +fd_exec_test.VotorCert.signature max_size:192 fixed_length:true -fd_exec_test.VotorContext.validators type:FT_POINTER -fd_exec_test.VotorContext.key_seed max_size:32 fixed_length:true -fd_exec_test.VotorContext.actions type:FT_POINTER +fd_exec_test.VotorReceiveCert.block_id max_size:32 fixed_length:true +fd_exec_test.VotorReceiveCert.primary_bitmap max_size:253 +fd_exec_test.VotorReceiveCert.fallback_bitmap max_size:253 -fd_exec_test.VotorAggSig.signers type:FT_POINTER +fd_exec_test.VotorDatagram.data max_size:1280 -fd_exec_test.VotorBlockCert.block_hash max_size:32 fixed_length:true +fd_exec_test.VotorReceiveContext.datagrams type:FT_POINTER +fd_exec_test.VotorReceiveContext.validator_stakes max_count:16 -fd_exec_test.VotorNotarFallbackCert.block_hash max_size:32 fixed_length:true +fd_exec_test.VotorReceiveEffects.results type:FT_POINTER +fd_exec_test.VotorReceiveEffects.certs type:FT_POINTER +fd_exec_test.VotorReceiveEffects.banned type:FT_POINTER -fd_exec_test.VotorStandstill.certs type:FT_POINTER -fd_exec_test.VotorStandstill.votes type:FT_POINTER +fd_exec_test.VotorVoteSerializeEffects.wire max_size:236 +fd_exec_test.VotorVoteSerializeEffects.signing_payload max_size:43 -fd_exec_test.VotorActionResult.pool_events type:FT_POINTER -fd_exec_test.VotorActionResult.repair_requests type:FT_POINTER - -fd_exec_test.VotorEffects.results type:FT_POINTER +fd_exec_test.VotorCertSerializeEffects.wire max_size:1280 diff --git a/proto/votor.proto b/proto/votor.proto index 562dcb3..af0e721 100644 --- a/proto/votor.proto +++ b/proto/votor.proto @@ -3,166 +3,130 @@ package org.solana.sealevel.v1; import "metadata.proto"; -message VotorBlockId { - uint64 slot = 1; - bytes block_hash = 2; -} - -message VotorBlockVote { - uint64 slot = 1; - bytes block_hash = 2; - uint64 signer = 3; -} - -message VotorSlotVote { - uint64 slot = 1; - uint64 signer = 2; +/* Field numbers match the wire tags */ +enum VotorVoteKind { + VOTOR_VOTE_KIND_UNSPECIFIED = 0; + VOTOR_VOTE_KIND_NOTAR = 1; + VOTOR_VOTE_KIND_FINAL = 2; + VOTOR_VOTE_KIND_SKIP = 3; + VOTOR_VOTE_KIND_NOTAR_FALLBACK = 4; + VOTOR_VOTE_KIND_SKIP_FALLBACK = 5; } message VotorVote { - oneof vote { - VotorBlockVote notar = 1; - VotorBlockVote notar_fallback = 2; - VotorSlotVote skip = 3; - VotorSlotVote skip_fallback = 4; - VotorSlotVote final_vote = 5; - } -} - -message VotorValidator { - uint64 stake = 1; -} - -message VotorBlock { - VotorBlockId block = 1; - VotorBlockId parent = 2; -} - -message VotorAction { - oneof action { - VotorVote vote = 1; - VotorBlock block = 2; - bool standstill = 3; - } -} - -message VotorContext { - repeated VotorValidator validators = 1; - bytes key_seed = 2; - uint64 own_id = 3; - uint64 slot_offset = 4; - repeated VotorAction actions = 5; -} - -message VotorAggSig { - repeated uint64 signers = 2; -} - -message VotorBlockCert { - uint64 slot = 1; - bytes block_hash = 2; - VotorAggSig agg_sig = 3; - uint64 stake = 4; -} - -message VotorNotarFallbackCert { - uint64 slot = 1; - bytes block_hash = 2; - VotorAggSig agg_sig_notar = 3; - VotorAggSig agg_sig_notar_fallback = 4; - uint64 stake = 5; -} - -message VotorSkipCert { - uint64 slot = 1; - VotorAggSig agg_sig_skip = 2; - VotorAggSig agg_sig_skip_fallback = 3; - uint64 stake = 4; + VotorVoteKind kind = 1; + uint64 slot = 2; + /* Exactly 32 bytes; ignored for kinds that carry no block */ + bytes block_id = 3; + /* 192 bytes, an uncompressed G2 point, as on the wire */ + bytes signature = 4; } -message VotorFinalCert { - uint64 slot = 1; - VotorAggSig agg_sig = 2; - uint64 stake = 3; +/* Field numbers are the wire tag minus six */ +enum VotorCertKind { + VOTOR_CERT_KIND_UNSPECIFIED = 0; + VOTOR_CERT_KIND_FINAL = 1; + VOTOR_CERT_KIND_FAST_FINAL = 2; + VOTOR_CERT_KIND_NOTAR = 3; + VOTOR_CERT_KIND_NOTAR_FALLBACK = 4; + VOTOR_CERT_KIND_SKIP = 5; } message VotorCert { - oneof cert { - VotorBlockCert notar = 1; - VotorNotarFallbackCert notar_fallback = 2; - VotorSkipCert skip = 3; - VotorBlockCert fast_final = 4; - VotorFinalCert final_cert = 5; - } -} - -message VotorParentReady { - uint64 slot = 1; - VotorBlockId parent = 2; -} - -message VotorStandstill { - uint64 slot = 1; - repeated VotorCert certs = 2; - repeated VotorVote votes = 3; -} - -message VotorPoolEvent { - oneof event { - VotorParentReady parent_ready = 1; - VotorBlockId safe_to_notar = 2; - uint64 safe_to_skip = 3; - VotorCert cert_created = 4; - VotorStandstill standstill = 5; - } -} - -enum VotorAddVoteError { - VOTOR_ADD_VOTE_ERROR_OK = 0; - VOTOR_ADD_VOTE_ERROR_SLOT_OUT_OF_BOUNDS = 1; - VOTOR_ADD_VOTE_ERROR_DUPLICATE = 2; - VOTOR_ADD_VOTE_ERROR_SLASHABLE = 3; - VOTOR_ADD_VOTE_ERROR_UNKNOWN_SIGNER = 4; + VotorCertKind kind = 1; + uint64 slot = 2; + /* Exactly 32 bytes; zero for kinds that carry no block */ + bytes block_id = 3; + /* Base2 signer bitmaps by rank; fallback only for notar fallback and skip */ + bytes primary_bitmap = 4; + bytes fallback_bitmap = 5; + /* Aggregate signature, 192 bytes uncompressed, as on the wire */ + bytes signature = 6; +} + +/* Receive: datagrams run in order through each node's receive path and pool */ +message VotorDatagram { + /* Index into validator_stakes; out of range is an unknown sender */ + uint32 sender = 1; + /* Raw wire bytes, a vote or a cert */ + bytes data = 2; +} + +message VotorReceiveContext { + /* Processed in this order */ + repeated VotorDatagram datagrams = 1; + uint64 root_slot = 2; + uint32 shred_version = 3; + uint64 highest_parent_ready_slot = 4; + /* Stake of validator i (at most 16); its keys are fixed by the harness */ + repeated uint64 validator_stakes = 5; +} + +/* A cert the pool holds, with its signature as an 8-byte XXH64 hash (seed 0) */ +message VotorReceiveCert { + VotorCertKind kind = 1; + uint64 slot = 2; + /* Exactly 32 bytes; zero for kinds that carry no block */ + bytes block_id = 3; + /* Base2 signer bitmaps by rank; fallback only for notar fallback and skip */ + bytes primary_bitmap = 4; + bytes fallback_bitmap = 5; + fixed64 signature_hash = 6; +} + +message VotorReceiveEffects { + /* One per datagram: was it added to the consensus pool */ + repeated bool results = 1; + /* Certs the pool holds at the end, sorted by kind, slot, block_id */ + repeated VotorReceiveCert certs = 2; + /* Senders banned at the end, sorted */ + repeated uint32 banned = 3; +} + +message VotorReceiveFixture { + FixtureMetadata metadata = 1; + VotorReceiveContext input = 2; + VotorReceiveEffects output = 3; } -enum VotorSlashableOffence { - VOTOR_SLASHABLE_OFFENCE_UNSET = 0; - VOTOR_SLASHABLE_OFFENCE_NOTAR_DIFFERENT_HASH = 1; - VOTOR_SLASHABLE_OFFENCE_SKIP_AND_NOTARIZE = 2; - VOTOR_SLASHABLE_OFFENCE_SKIP_AND_FINALIZE = 3; - VOTOR_SLASHABLE_OFFENCE_NOTAR_FALLBACK_AND_FINALIZE = 4; +/* Vote serialize: the wire message and signing payload of a vote */ +message VotorVoteSerializeContext { + VotorVote vote = 1; + uint32 shred_version = 2; } -message VotorSlashable { - VotorSlashableOffence offence = 1; - uint64 validator = 2; - uint64 slot = 3; +message VotorVoteSerializeEffects { + /* Wire message as sent over QUIC */ + bytes wire = 1; + /* Bytes the BLS signature is computed over */ + bytes signing_payload = 2; + /* Not a vote production builds; nothing was serialized */ + bool skipped = 3; + /* The serializer rejected a vote production builds */ + bool refused = 4; } -message VotorActionResult { - VotorAddVoteError error = 1; - VotorSlashable slashable = 2; - repeated VotorPoolEvent pool_events = 3; - repeated VotorBlockId repair_requests = 4; +message VotorVoteSerializeFixture { + FixtureMetadata metadata = 1; + VotorVoteSerializeContext input = 2; + VotorVoteSerializeEffects output = 3; } -enum VotorRunStatus { - VOTOR_RUN_STATUS_UNSET = 0; - VOTOR_RUN_STATUS_OK = 1; - VOTOR_RUN_STATUS_PANIC = 2; - VOTOR_RUN_STATUS_INVALID_INPUT = 3; - VOTOR_RUN_STATUS_TIMEOUT = 4; +/* Cert serialize: the wire message of a cert */ +message VotorCertSerializeContext { + VotorCert cert = 1; + uint32 shred_version = 2; } -message VotorEffects { - VotorRunStatus status = 1; - repeated VotorActionResult results = 2; - uint64 finalized_slot = 3; - uint64 first_unpruned_slot = 4; +message VotorCertSerializeEffects { + /* Wire message as sent over QUIC */ + bytes wire = 1; + /* Not a cert a pool builds; nothing was serialized */ + bool skipped = 2; } -message VotorFixture { +message VotorCertSerializeFixture { FixtureMetadata metadata = 1; - VotorContext input = 2; - VotorEffects output = 3; + VotorCertSerializeContext input = 2; + VotorCertSerializeEffects output = 3; } diff --git a/src/generated/file_descriptor_set.bin b/src/generated/file_descriptor_set.bin index 4aa17bb..9250ce7 100644 Binary files a/src/generated/file_descriptor_set.bin and b/src/generated/file_descriptor_set.bin differ diff --git a/src/generated/org.solana.sealevel.v1.rs b/src/generated/org.solana.sealevel.v1.rs index 81a83bf..4523409 100644 --- a/src/generated/org.solana.sealevel.v1.rs +++ b/src/generated/org.solana.sealevel.v1.rs @@ -1413,345 +1413,232 @@ pub struct VmSerializationFixture { pub output: ::core::option::Option, } #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] -pub struct VotorBlockId { - #[prost(uint64, tag = "1")] +pub struct VotorVote { + #[prost(enumeration = "VotorVoteKind", tag = "1")] + pub kind: i32, + #[prost(uint64, tag = "2")] pub slot: u64, - #[prost(bytes = "vec", tag = "2")] - pub block_hash: ::prost::alloc::vec::Vec, + /// Exactly 32 bytes; ignored for kinds that carry no block + #[prost(bytes = "vec", tag = "3")] + pub block_id: ::prost::alloc::vec::Vec, + /// 192 bytes, an uncompressed G2 point, as on the wire + #[prost(bytes = "vec", tag = "4")] + pub signature: ::prost::alloc::vec::Vec, } #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] -pub struct VotorBlockVote { - #[prost(uint64, tag = "1")] +pub struct VotorCert { + #[prost(enumeration = "VotorCertKind", tag = "1")] + pub kind: i32, + #[prost(uint64, tag = "2")] pub slot: u64, + /// Exactly 32 bytes; zero for kinds that carry no block + #[prost(bytes = "vec", tag = "3")] + pub block_id: ::prost::alloc::vec::Vec, + /// Base2 signer bitmaps by rank; fallback only for notar fallback and skip + #[prost(bytes = "vec", tag = "4")] + pub primary_bitmap: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "5")] + pub fallback_bitmap: ::prost::alloc::vec::Vec, + /// Aggregate signature, 192 bytes uncompressed, as on the wire + #[prost(bytes = "vec", tag = "6")] + pub signature: ::prost::alloc::vec::Vec, +} +/// Receive: datagrams run in order through each node's receive path and pool +#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] +pub struct VotorDatagram { + /// Index into validator_stakes; out of range is an unknown sender + #[prost(uint32, tag = "1")] + pub sender: u32, + /// Raw wire bytes, a vote or a cert #[prost(bytes = "vec", tag = "2")] - pub block_hash: ::prost::alloc::vec::Vec, - #[prost(uint64, tag = "3")] - pub signer: u64, + pub data: ::prost::alloc::vec::Vec, } -#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] -pub struct VotorSlotVote { - #[prost(uint64, tag = "1")] - pub slot: u64, +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct VotorReceiveContext { + /// Processed in this order + #[prost(message, repeated, tag = "1")] + pub datagrams: ::prost::alloc::vec::Vec, #[prost(uint64, tag = "2")] - pub signer: u64, + pub root_slot: u64, + #[prost(uint32, tag = "3")] + pub shred_version: u32, + #[prost(uint64, tag = "4")] + pub highest_parent_ready_slot: u64, + /// Stake of validator i (at most 16); its keys are fixed by the harness + #[prost(uint64, repeated, tag = "5")] + pub validator_stakes: ::prost::alloc::vec::Vec, } +/// A cert the pool holds, with its signature as an 8-byte XXH64 hash (seed 0) #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] -pub struct VotorVote { - #[prost(oneof = "votor_vote::Vote", tags = "1, 2, 3, 4, 5")] - pub vote: ::core::option::Option, -} -/// Nested message and enum types in `VotorVote`. -pub mod votor_vote { - #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)] - pub enum Vote { - #[prost(message, tag = "1")] - Notar(super::VotorBlockVote), - #[prost(message, tag = "2")] - NotarFallback(super::VotorBlockVote), - #[prost(message, tag = "3")] - Skip(super::VotorSlotVote), - #[prost(message, tag = "4")] - SkipFallback(super::VotorSlotVote), - #[prost(message, tag = "5")] - FinalVote(super::VotorSlotVote), - } +pub struct VotorReceiveCert { + #[prost(enumeration = "VotorCertKind", tag = "1")] + pub kind: i32, + #[prost(uint64, tag = "2")] + pub slot: u64, + /// Exactly 32 bytes; zero for kinds that carry no block + #[prost(bytes = "vec", tag = "3")] + pub block_id: ::prost::alloc::vec::Vec, + /// Base2 signer bitmaps by rank; fallback only for notar fallback and skip + #[prost(bytes = "vec", tag = "4")] + pub primary_bitmap: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "5")] + pub fallback_bitmap: ::prost::alloc::vec::Vec, + #[prost(fixed64, tag = "6")] + pub signature_hash: u64, } -#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] -pub struct VotorValidator { - #[prost(uint64, tag = "1")] - pub stake: u64, +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct VotorReceiveEffects { + /// One per datagram: was it added to the consensus pool + #[prost(bool, repeated, tag = "1")] + pub results: ::prost::alloc::vec::Vec, + /// Certs the pool holds at the end, sorted by kind, slot, block_id + #[prost(message, repeated, tag = "2")] + pub certs: ::prost::alloc::vec::Vec, + /// Senders banned at the end, sorted + #[prost(uint32, repeated, tag = "3")] + pub banned: ::prost::alloc::vec::Vec, } -#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] -pub struct VotorBlock { +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct VotorReceiveFixture { #[prost(message, optional, tag = "1")] - pub block: ::core::option::Option, + pub metadata: ::core::option::Option, #[prost(message, optional, tag = "2")] - pub parent: ::core::option::Option, -} -#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] -pub struct VotorAction { - #[prost(oneof = "votor_action::Action", tags = "1, 2, 3")] - pub action: ::core::option::Option, -} -/// Nested message and enum types in `VotorAction`. -pub mod votor_action { - #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)] - pub enum Action { - #[prost(message, tag = "1")] - Vote(super::VotorVote), - #[prost(message, tag = "2")] - Block(super::VotorBlock), - #[prost(bool, tag = "3")] - Standstill(bool), - } -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct VotorContext { - #[prost(message, repeated, tag = "1")] - pub validators: ::prost::alloc::vec::Vec, - #[prost(bytes = "vec", tag = "2")] - pub key_seed: ::prost::alloc::vec::Vec, - #[prost(uint64, tag = "3")] - pub own_id: u64, - #[prost(uint64, tag = "4")] - pub slot_offset: u64, - #[prost(message, repeated, tag = "5")] - pub actions: ::prost::alloc::vec::Vec, -} -#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] -pub struct VotorAggSig { - #[prost(uint64, repeated, tag = "2")] - pub signers: ::prost::alloc::vec::Vec, + pub input: ::core::option::Option, + #[prost(message, optional, tag = "3")] + pub output: ::core::option::Option, } +/// Vote serialize: the wire message and signing payload of a vote #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] -pub struct VotorBlockCert { - #[prost(uint64, tag = "1")] - pub slot: u64, - #[prost(bytes = "vec", tag = "2")] - pub block_hash: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "3")] - pub agg_sig: ::core::option::Option, - #[prost(uint64, tag = "4")] - pub stake: u64, +pub struct VotorVoteSerializeContext { + #[prost(message, optional, tag = "1")] + pub vote: ::core::option::Option, + #[prost(uint32, tag = "2")] + pub shred_version: u32, } #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] -pub struct VotorNotarFallbackCert { - #[prost(uint64, tag = "1")] - pub slot: u64, +pub struct VotorVoteSerializeEffects { + /// Wire message as sent over QUIC + #[prost(bytes = "vec", tag = "1")] + pub wire: ::prost::alloc::vec::Vec, + /// Bytes the BLS signature is computed over #[prost(bytes = "vec", tag = "2")] - pub block_hash: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "3")] - pub agg_sig_notar: ::core::option::Option, - #[prost(message, optional, tag = "4")] - pub agg_sig_notar_fallback: ::core::option::Option, - #[prost(uint64, tag = "5")] - pub stake: u64, + pub signing_payload: ::prost::alloc::vec::Vec, + /// Not a vote production builds; nothing was serialized + #[prost(bool, tag = "3")] + pub skipped: bool, + /// The serializer rejected a vote production builds + #[prost(bool, tag = "4")] + pub refused: bool, } #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] -pub struct VotorSkipCert { - #[prost(uint64, tag = "1")] - pub slot: u64, +pub struct VotorVoteSerializeFixture { + #[prost(message, optional, tag = "1")] + pub metadata: ::core::option::Option, #[prost(message, optional, tag = "2")] - pub agg_sig_skip: ::core::option::Option, + pub input: ::core::option::Option, #[prost(message, optional, tag = "3")] - pub agg_sig_skip_fallback: ::core::option::Option, - #[prost(uint64, tag = "4")] - pub stake: u64, + pub output: ::core::option::Option, } +/// Cert serialize: the wire message of a cert #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] -pub struct VotorFinalCert { - #[prost(uint64, tag = "1")] - pub slot: u64, - #[prost(message, optional, tag = "2")] - pub agg_sig: ::core::option::Option, - #[prost(uint64, tag = "3")] - pub stake: u64, +pub struct VotorCertSerializeContext { + #[prost(message, optional, tag = "1")] + pub cert: ::core::option::Option, + #[prost(uint32, tag = "2")] + pub shred_version: u32, } #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] -pub struct VotorCert { - #[prost(oneof = "votor_cert::Cert", tags = "1, 2, 3, 4, 5")] - pub cert: ::core::option::Option, -} -/// Nested message and enum types in `VotorCert`. -pub mod votor_cert { - #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)] - pub enum Cert { - #[prost(message, tag = "1")] - Notar(super::VotorBlockCert), - #[prost(message, tag = "2")] - NotarFallback(super::VotorNotarFallbackCert), - #[prost(message, tag = "3")] - Skip(super::VotorSkipCert), - #[prost(message, tag = "4")] - FastFinal(super::VotorBlockCert), - #[prost(message, tag = "5")] - FinalCert(super::VotorFinalCert), - } +pub struct VotorCertSerializeEffects { + /// Wire message as sent over QUIC + #[prost(bytes = "vec", tag = "1")] + pub wire: ::prost::alloc::vec::Vec, + /// Not a cert a pool builds; nothing was serialized + #[prost(bool, tag = "2")] + pub skipped: bool, } #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)] -pub struct VotorParentReady { - #[prost(uint64, tag = "1")] - pub slot: u64, - #[prost(message, optional, tag = "2")] - pub parent: ::core::option::Option, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct VotorStandstill { - #[prost(uint64, tag = "1")] - pub slot: u64, - #[prost(message, repeated, tag = "2")] - pub certs: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "3")] - pub votes: ::prost::alloc::vec::Vec, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct VotorPoolEvent { - #[prost(oneof = "votor_pool_event::Event", tags = "1, 2, 3, 4, 5")] - pub event: ::core::option::Option, -} -/// Nested message and enum types in `VotorPoolEvent`. -pub mod votor_pool_event { - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Event { - #[prost(message, tag = "1")] - ParentReady(super::VotorParentReady), - #[prost(message, tag = "2")] - SafeToNotar(super::VotorBlockId), - #[prost(uint64, tag = "3")] - SafeToSkip(u64), - #[prost(message, tag = "4")] - CertCreated(super::VotorCert), - #[prost(message, tag = "5")] - Standstill(super::VotorStandstill), - } -} -#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)] -pub struct VotorSlashable { - #[prost(enumeration = "VotorSlashableOffence", tag = "1")] - pub offence: i32, - #[prost(uint64, tag = "2")] - pub validator: u64, - #[prost(uint64, tag = "3")] - pub slot: u64, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct VotorActionResult { - #[prost(enumeration = "VotorAddVoteError", tag = "1")] - pub error: i32, - #[prost(message, optional, tag = "2")] - pub slashable: ::core::option::Option, - #[prost(message, repeated, tag = "3")] - pub pool_events: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "4")] - pub repair_requests: ::prost::alloc::vec::Vec, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct VotorEffects { - #[prost(enumeration = "VotorRunStatus", tag = "1")] - pub status: i32, - #[prost(message, repeated, tag = "2")] - pub results: ::prost::alloc::vec::Vec, - #[prost(uint64, tag = "3")] - pub finalized_slot: u64, - #[prost(uint64, tag = "4")] - pub first_unpruned_slot: u64, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct VotorFixture { +pub struct VotorCertSerializeFixture { #[prost(message, optional, tag = "1")] pub metadata: ::core::option::Option, #[prost(message, optional, tag = "2")] - pub input: ::core::option::Option, + pub input: ::core::option::Option, #[prost(message, optional, tag = "3")] - pub output: ::core::option::Option, + pub output: ::core::option::Option, } +/// Field numbers match the wire tags #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] -pub enum VotorAddVoteError { - Ok = 0, - SlotOutOfBounds = 1, - Duplicate = 2, - Slashable = 3, - UnknownSigner = 4, -} -impl VotorAddVoteError { - /// String value of the enum field names used in the ProtoBuf definition. - /// - /// The values are not transformed in any way and thus are considered stable - /// (if the ProtoBuf definition does not change) and safe for programmatic use. - pub fn as_str_name(&self) -> &'static str { - match self { - Self::Ok => "VOTOR_ADD_VOTE_ERROR_OK", - Self::SlotOutOfBounds => "VOTOR_ADD_VOTE_ERROR_SLOT_OUT_OF_BOUNDS", - Self::Duplicate => "VOTOR_ADD_VOTE_ERROR_DUPLICATE", - Self::Slashable => "VOTOR_ADD_VOTE_ERROR_SLASHABLE", - Self::UnknownSigner => "VOTOR_ADD_VOTE_ERROR_UNKNOWN_SIGNER", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "VOTOR_ADD_VOTE_ERROR_OK" => Some(Self::Ok), - "VOTOR_ADD_VOTE_ERROR_SLOT_OUT_OF_BOUNDS" => Some(Self::SlotOutOfBounds), - "VOTOR_ADD_VOTE_ERROR_DUPLICATE" => Some(Self::Duplicate), - "VOTOR_ADD_VOTE_ERROR_SLASHABLE" => Some(Self::Slashable), - "VOTOR_ADD_VOTE_ERROR_UNKNOWN_SIGNER" => Some(Self::UnknownSigner), - _ => None, - } - } +pub enum VotorVoteKind { + Unspecified = 0, + Notar = 1, + Final = 2, + Skip = 3, + NotarFallback = 4, + SkipFallback = 5, } -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum VotorSlashableOffence { - Unset = 0, - NotarDifferentHash = 1, - SkipAndNotarize = 2, - SkipAndFinalize = 3, - NotarFallbackAndFinalize = 4, -} -impl VotorSlashableOffence { +impl VotorVoteKind { /// String value of the enum field names used in the ProtoBuf definition. /// /// The values are not transformed in any way and thus are considered stable /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - Self::Unset => "VOTOR_SLASHABLE_OFFENCE_UNSET", - Self::NotarDifferentHash => "VOTOR_SLASHABLE_OFFENCE_NOTAR_DIFFERENT_HASH", - Self::SkipAndNotarize => "VOTOR_SLASHABLE_OFFENCE_SKIP_AND_NOTARIZE", - Self::SkipAndFinalize => "VOTOR_SLASHABLE_OFFENCE_SKIP_AND_FINALIZE", - Self::NotarFallbackAndFinalize => { - "VOTOR_SLASHABLE_OFFENCE_NOTAR_FALLBACK_AND_FINALIZE" - } + Self::Unspecified => "VOTOR_VOTE_KIND_UNSPECIFIED", + Self::Notar => "VOTOR_VOTE_KIND_NOTAR", + Self::Final => "VOTOR_VOTE_KIND_FINAL", + Self::Skip => "VOTOR_VOTE_KIND_SKIP", + Self::NotarFallback => "VOTOR_VOTE_KIND_NOTAR_FALLBACK", + Self::SkipFallback => "VOTOR_VOTE_KIND_SKIP_FALLBACK", } } /// Creates an enum from field names used in the ProtoBuf definition. pub fn from_str_name(value: &str) -> ::core::option::Option { match value { - "VOTOR_SLASHABLE_OFFENCE_UNSET" => Some(Self::Unset), - "VOTOR_SLASHABLE_OFFENCE_NOTAR_DIFFERENT_HASH" => { - Some(Self::NotarDifferentHash) - } - "VOTOR_SLASHABLE_OFFENCE_SKIP_AND_NOTARIZE" => Some(Self::SkipAndNotarize), - "VOTOR_SLASHABLE_OFFENCE_SKIP_AND_FINALIZE" => Some(Self::SkipAndFinalize), - "VOTOR_SLASHABLE_OFFENCE_NOTAR_FALLBACK_AND_FINALIZE" => { - Some(Self::NotarFallbackAndFinalize) - } + "VOTOR_VOTE_KIND_UNSPECIFIED" => Some(Self::Unspecified), + "VOTOR_VOTE_KIND_NOTAR" => Some(Self::Notar), + "VOTOR_VOTE_KIND_FINAL" => Some(Self::Final), + "VOTOR_VOTE_KIND_SKIP" => Some(Self::Skip), + "VOTOR_VOTE_KIND_NOTAR_FALLBACK" => Some(Self::NotarFallback), + "VOTOR_VOTE_KIND_SKIP_FALLBACK" => Some(Self::SkipFallback), _ => None, } } } +/// Field numbers are the wire tag minus six #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] -pub enum VotorRunStatus { - Unset = 0, - Ok = 1, - Panic = 2, - InvalidInput = 3, - Timeout = 4, -} -impl VotorRunStatus { +pub enum VotorCertKind { + Unspecified = 0, + Final = 1, + FastFinal = 2, + Notar = 3, + NotarFallback = 4, + Skip = 5, +} +impl VotorCertKind { /// String value of the enum field names used in the ProtoBuf definition. /// /// The values are not transformed in any way and thus are considered stable /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { - Self::Unset => "VOTOR_RUN_STATUS_UNSET", - Self::Ok => "VOTOR_RUN_STATUS_OK", - Self::Panic => "VOTOR_RUN_STATUS_PANIC", - Self::InvalidInput => "VOTOR_RUN_STATUS_INVALID_INPUT", - Self::Timeout => "VOTOR_RUN_STATUS_TIMEOUT", + Self::Unspecified => "VOTOR_CERT_KIND_UNSPECIFIED", + Self::Final => "VOTOR_CERT_KIND_FINAL", + Self::FastFinal => "VOTOR_CERT_KIND_FAST_FINAL", + Self::Notar => "VOTOR_CERT_KIND_NOTAR", + Self::NotarFallback => "VOTOR_CERT_KIND_NOTAR_FALLBACK", + Self::Skip => "VOTOR_CERT_KIND_SKIP", } } /// Creates an enum from field names used in the ProtoBuf definition. pub fn from_str_name(value: &str) -> ::core::option::Option { match value { - "VOTOR_RUN_STATUS_UNSET" => Some(Self::Unset), - "VOTOR_RUN_STATUS_OK" => Some(Self::Ok), - "VOTOR_RUN_STATUS_PANIC" => Some(Self::Panic), - "VOTOR_RUN_STATUS_INVALID_INPUT" => Some(Self::InvalidInput), - "VOTOR_RUN_STATUS_TIMEOUT" => Some(Self::Timeout), + "VOTOR_CERT_KIND_UNSPECIFIED" => Some(Self::Unspecified), + "VOTOR_CERT_KIND_FINAL" => Some(Self::Final), + "VOTOR_CERT_KIND_FAST_FINAL" => Some(Self::FastFinal), + "VOTOR_CERT_KIND_NOTAR" => Some(Self::Notar), + "VOTOR_CERT_KIND_NOTAR_FALLBACK" => Some(Self::NotarFallback), + "VOTOR_CERT_KIND_SKIP" => Some(Self::Skip), _ => None, } }