From e722dd12a3bb8ec817c45d068a47258867255c97 Mon Sep 17 00:00:00 2001 From: Thomas Dinsdale-Young Date: Tue, 18 Nov 2025 13:20:43 +0100 Subject: [PATCH 01/26] Add support for ProtocolVersion::P10. --- CHANGELOG.md | 1 + concordium-base | 2 +- src/protocol_level_tokens/mod.rs | 4 +- src/types/queries.rs | 1 + src/v2/conversions.rs | 2 + src/v2/generated/concordium.v2.plt.rs | 33 +- src/v2/generated/concordium.v2.rs | 799 ++++++++++++++++++-------- src/v2/proto_schema_version.rs | 2 +- 8 files changed, 596 insertions(+), 248 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3abb14028a..3d60ee6ed3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ## Unreleased changes +- Support for `ProtocolVersion::P10`. - The flag `serde_deprecated` now guards `serde::Serialize` and `serde::Deserialize` implemetations on the following types. The implementations will eventually be removed. - `protocol_level_tokens::AccountToken` - `protocol_level_tokens::TokenAccountState` diff --git a/concordium-base b/concordium-base index 409f8ad6b3..70667d9161 160000 --- a/concordium-base +++ b/concordium-base @@ -1 +1 @@ -Subproject commit 409f8ad6b3596a24af90eddcaf1cd86e16ed3f9f +Subproject commit 70667d91611edfd5c5d26b2407fa8b3c1e16f6e9 diff --git a/src/protocol_level_tokens/mod.rs b/src/protocol_level_tokens/mod.rs index 1964fee6d0..d6bdeace8c 100644 --- a/src/protocol_level_tokens/mod.rs +++ b/src/protocol_level_tokens/mod.rs @@ -57,8 +57,8 @@ impl TryFrom for TokenModuleRef { } } -impl From for RawCbor { - fn from(wrapper: generated::plt::CBor) -> Self { +impl From for RawCbor { + fn from(wrapper: generated::plt::Cbor) -> Self { wrapper.value.into() } } diff --git a/src/types/queries.rs b/src/types/queries.rs index a20c6dec77..9c9499a758 100644 --- a/src/types/queries.rs +++ b/src/types/queries.rs @@ -41,6 +41,7 @@ impl ProtocolVersionInt { ProtocolVersion::P7 => Self(7), ProtocolVersion::P8 => Self(8), ProtocolVersion::P9 => Self(9), + ProtocolVersion::P10 => Self(10), } } } diff --git a/src/v2/conversions.rs b/src/v2/conversions.rs index 4d933999cf..c5ed1bd363 100644 --- a/src/v2/conversions.rs +++ b/src/v2/conversions.rs @@ -496,6 +496,7 @@ impl From for super::types::ProtocolVersion { ProtocolVersion::ProtocolVersion7 => super::types::ProtocolVersion::P7, ProtocolVersion::ProtocolVersion8 => super::types::ProtocolVersion::P8, ProtocolVersion::ProtocolVersion9 => super::types::ProtocolVersion::P9, + ProtocolVersion::ProtocolVersion10 => super::types::ProtocolVersion::P10, } } } @@ -512,6 +513,7 @@ impl From for ProtocolVersion { super::types::ProtocolVersion::P7 => ProtocolVersion::ProtocolVersion7, super::types::ProtocolVersion::P8 => ProtocolVersion::ProtocolVersion8, super::types::ProtocolVersion::P9 => ProtocolVersion::ProtocolVersion9, + super::types::ProtocolVersion::P10 => ProtocolVersion::ProtocolVersion10, } } } diff --git a/src/v2/generated/concordium.v2.plt.rs b/src/v2/generated/concordium.v2.plt.rs index 162bf5f3e6..8cc03609b2 100644 --- a/src/v2/generated/concordium.v2.plt.rs +++ b/src/v2/generated/concordium.v2.plt.rs @@ -1,16 +1,17 @@ // This file is @generated by prost-build. -/// A Cbor encoded bytestring +/// A CBOR encoded bytestring #[derive(Clone, PartialEq, ::prost::Message)] -pub struct CBor { +pub struct Cbor { /// A CBOR encoded byte string. #[prost(bytes = "vec", tag = "1")] pub value: ::prost::alloc::vec::Vec, } -/// The unique symbol and identifier of a protocol level token. +/// Token ID: a unique symbol and identifier of a protocol level token. #[derive(Clone, PartialEq, ::prost::Message)] pub struct TokenId { /// Unique identifier for the token, guaranteed to be distinct across the - /// entire concordium blockchain. + /// entire concordium blockchain. The token id must be between 1 and 128 bytes long and consist of + /// only a-z, A-Z, 0-9, `.`, `%` and `-`. #[prost(string, tag = "1")] pub value: ::prost::alloc::string::String, } @@ -45,7 +46,7 @@ pub struct TokenState { pub total_supply: ::core::option::Option, /// Token module specific state, such as token name, feature flags, meta data. #[prost(message, optional, tag = "5")] - pub module_state: ::core::option::Option, + pub module_state: ::core::option::Option, } /// Token state at the account level #[derive(Clone, PartialEq, ::prost::Message)] @@ -56,7 +57,7 @@ pub struct TokenAccountState { /// Token module specific account state, such as whether the account is on /// the allow or deny list. #[prost(message, optional, tag = "4")] - pub module_state: ::core::option::Option, + pub module_state: ::core::option::Option, } /// Single token event originating from a token module as part of a token /// transaction. @@ -67,19 +68,23 @@ pub struct TokenModuleEvent { pub r#type: ::prost::alloc::string::String, /// The CBOR encoded event details. #[prost(message, optional, tag = "2")] - pub details: ::core::option::Option, + pub details: ::core::option::Option, } /// A token holder is an entity that can hold tokens. Currently, this is limited /// to accounts, but in the future it may be extended to other entities. #[derive(Clone, PartialEq, ::prost::Message)] pub struct TokenHolder { /// The holder address + /// + /// This field might be extended in future versions of the API. #[prost(oneof = "token_holder::Address", tags = "1")] pub address: ::core::option::Option, } /// Nested message and enum types in `TokenHolder`. pub mod token_holder { /// The holder address + /// + /// This field might be extended in future versions of the API. #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Address { /// The account address of the holder. @@ -118,16 +123,20 @@ pub struct TokenSupplyUpdateEvent { /// Token event originating from token transactions. #[derive(Clone, PartialEq, ::prost::Message)] pub struct TokenEvent { - /// The unique token symbol. + /// The Token ID. #[prost(message, optional, tag = "1")] pub token_id: ::core::option::Option, /// The type of the event. + /// + /// This field might be extended in future versions of the API. #[prost(oneof = "token_event::Event", tags = "2, 3, 4, 5")] pub event: ::core::option::Option, } /// Nested message and enum types in `TokenEvent`. pub mod token_event { /// The type of the event. + /// + /// This field might be extended in future versions of the API. #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Event { /// An event emitted by the token module. @@ -156,7 +165,7 @@ pub struct TokenEffect { /// Details provided by the token module in the event of rejecting a transaction. #[derive(Clone, PartialEq, ::prost::Message)] pub struct TokenModuleRejectReason { - /// The identifier of the protocol-level token. + /// The Token ID of the protocol-level token. #[prost(message, optional, tag = "1")] pub token_id: ::core::option::Option, /// The type of the reject reason. @@ -164,12 +173,12 @@ pub struct TokenModuleRejectReason { pub r#type: ::prost::alloc::string::String, /// (Optional) CBOR-encoded details. #[prost(message, optional, tag = "3")] - pub details: ::core::option::Option, + pub details: ::core::option::Option, } /// Update payload for creating a new protocol-level token #[derive(Clone, PartialEq, ::prost::Message)] pub struct CreatePlt { - /// The identifier of the protocol-level token. + /// The Token ID of the protocol-level token. #[prost(message, optional, tag = "1")] pub token_id: ::core::option::Option, /// The hash that identifies the token module implementation. @@ -182,7 +191,7 @@ pub struct CreatePlt { pub decimals: u32, /// The initialization parameters of the token, encoded in CBOR. #[prost(message, optional, tag = "5")] - pub initialization_parameters: ::core::option::Option, + pub initialization_parameters: ::core::option::Option, } /// Details about the creation of a protocol-level token. #[derive(Clone, PartialEq, ::prost::Message)] diff --git a/src/v2/generated/concordium.v2.rs b/src/v2/generated/concordium.v2.rs index 9c025479cb..2ae7b61800 100644 --- a/src/v2/generated/concordium.v2.rs +++ b/src/v2/generated/concordium.v2.rs @@ -6,6 +6,7 @@ pub struct AccountAddress { pub value: ::prost::alloc::vec::Vec, } /// A memo which can be included as part of a transfer. Max size is 256 bytes. +/// This message can occur starting from protocol version 2. #[derive(Clone, PartialEq, ::prost::Message)] pub struct Memo { #[prost(bytes = "vec", tag = "1")] @@ -53,7 +54,7 @@ pub struct BlockHeight { #[prost(uint64, tag = "1")] pub value: u64, } -/// The ID of a baker, which is the index of its account. +/// The ID of a validator, which is the index of its account. #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct BakerId { #[prost(uint64, tag = "1")] @@ -75,6 +76,8 @@ pub struct ModuleRef { /// Source bytes of a versioned smart contract module. #[derive(Clone, PartialEq, ::prost::Message)] pub struct VersionedModuleSource { + /// This field will not be extended in future versions of the API, instead new data versions will + /// use optional fields in `ModuleSourceV1`. #[prost(oneof = "versioned_module_source::Module", tags = "1, 2")] pub module: ::core::option::Option, } @@ -92,6 +95,8 @@ pub mod versioned_module_source { #[prost(bytes = "vec", tag = "1")] pub value: ::prost::alloc::vec::Vec, } + /// This field will not be extended in future versions of the API, instead new data versions will + /// use optional fields in `ModuleSourceV1`. #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Module { #[prost(message, tag = "1")] @@ -187,65 +192,69 @@ pub struct EncryptedBalance { /// Entity to which the account delegates a portion of its stake. #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct DelegationTarget { + /// This field might be extended in future versions of the API. #[prost(oneof = "delegation_target::Target", tags = "1, 2")] pub target: ::core::option::Option, } /// Nested message and enum types in `DelegationTarget`. pub mod delegation_target { + /// This field might be extended in future versions of the API. #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum Target { - /// Delegate passively, i.e., to no specific baker. + /// Delegate passively, i.e., to no specific validator. #[prost(message, tag = "1")] Passive(super::Empty), - /// Delegate to a specific baker. + /// Delegate to a specific validator. #[prost(message, tag = "2")] Baker(super::BakerId), } } -/// Baker's public key used to check whether they won the lottery or not. +/// Validator's public key used to check whether they won the lottery or not. #[derive(Clone, PartialEq, ::prost::Message)] pub struct BakerElectionVerifyKey { #[prost(bytes = "vec", tag = "1")] pub value: ::prost::alloc::vec::Vec, } -/// Baker's public key used to check that they are indeed the ones who +/// Validator's public key used to check that they are indeed the ones who /// produced the block. #[derive(Clone, PartialEq, ::prost::Message)] pub struct BakerSignatureVerifyKey { #[prost(bytes = "vec", tag = "1")] pub value: ::prost::alloc::vec::Vec, } -/// Baker's public key used to check signatures on finalization records. -/// This is only used if the baker has sufficient stake to participate in +/// Validator's public key used to check signatures on finalization records. +/// This is only used if the validator has sufficient stake to participate in /// finalization. #[derive(Clone, PartialEq, ::prost::Message)] pub struct BakerAggregationVerifyKey { #[prost(bytes = "vec", tag = "1")] pub value: ::prost::alloc::vec::Vec, } -/// Information about a baker. +/// Information about a validator. #[derive(Clone, PartialEq, ::prost::Message)] pub struct BakerInfo { - /// Identity of the baker. This is actually the account index of - /// the account controlling the baker. + /// Identity of the validator. This is actually the account index of + /// the account controlling the validator. #[prost(message, optional, tag = "1")] pub baker_id: ::core::option::Option, - /// Baker's public key used to check whether they won the lottery or not. + /// Validator's public key used to check whether they won the lottery or not. #[prost(message, optional, tag = "2")] pub election_key: ::core::option::Option, - /// Baker's public key used to check that they are indeed the ones who + /// Validator's public key used to check that they are indeed the ones who /// produced the block. #[prost(message, optional, tag = "3")] pub signature_key: ::core::option::Option, - /// Baker's public key used to check signatures on finalization records. - /// This is only used if the baker has sufficient stake to participate in + /// Validator's public key used to check signatures on finalization records. + /// This is only used if the validator has sufficient stake to participate in /// finalization. #[prost(message, optional, tag = "4")] pub aggregation_key: ::core::option::Option, } -/// Pending change to the stake either of a baker or delegator. +/// Pending change to the stake either of a validator or delegator. #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct StakePendingChange { + /// This field will not be extended in future versions of the API, since it is not used starting + /// from Concordium Protocol Version 7. #[prost(oneof = "stake_pending_change::Change", tags = "1, 2")] pub change: ::core::option::Option, } @@ -259,6 +268,8 @@ pub mod stake_pending_change { #[prost(message, optional, tag = "2")] pub effective_time: ::core::option::Option, } + /// This field will not be extended in future versions of the API, since it is not used starting + /// from Concordium Protocol Version 7. #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum Change { #[prost(message, tag = "1")] @@ -282,14 +293,14 @@ pub struct CommissionRates { /// Fraction of finalization rewards charged by the pool owner. #[prost(message, optional, tag = "1")] pub finalization: ::core::option::Option, - /// Fraction of baking rewards charged by the pool owner. + /// Fraction of block production rewards charged by the pool owner. #[prost(message, optional, tag = "2")] pub baking: ::core::option::Option, /// Fraction of transaction rewards charged by the pool owner. #[prost(message, optional, tag = "3")] pub transaction: ::core::option::Option, } -/// Additional information about a baking pool. +/// Additional information about a validator pool. /// This information is added with the introduction of delegation. #[derive(Clone, PartialEq, ::prost::Message)] pub struct BakerPoolInfo { @@ -303,10 +314,11 @@ pub struct BakerPoolInfo { #[prost(message, optional, tag = "3")] pub commission_rates: ::core::option::Option, } -/// Information about the account stake, if the account is either a baker or a +/// Information about the account stake, if the account is either a validator or a /// delegator. #[derive(Clone, PartialEq, ::prost::Message)] pub struct AccountStakingInfo { + /// This field might be extended in future versions of the API. #[prost(oneof = "account_staking_info::StakingInfo", tags = "1, 2")] pub staking_info: ::core::option::Option, } @@ -317,17 +329,19 @@ pub mod account_staking_info { /// Amount staked at present. #[prost(message, optional, tag = "1")] pub staked_amount: ::core::option::Option, - /// A flag indicating whether rewards paid to the baker are automatically + /// A flag indicating whether rewards paid to the validator are automatically /// restaked or not. #[prost(bool, tag = "2")] pub restake_earnings: bool, - /// Information about the baker that is staking. + /// Information about the validator that is staking. #[prost(message, optional, tag = "3")] pub baker_info: ::core::option::Option, /// If present, any pending change to the delegated stake. + /// Starting from Concordium Protocol Version 7 this will never be present, due to changes for + /// the staking cooldown. #[prost(message, optional, tag = "4")] pub pending_change: ::core::option::Option, - /// Present if the account is currently a baker, i.e., it is in the baking + /// Present if the account is currently a validator, i.e., it is in the validator /// committee of the current epoch. #[prost(message, optional, tag = "5")] pub pool_info: ::core::option::Option, @@ -354,9 +368,10 @@ pub mod account_staking_info { #[prost(message, optional, tag = "4")] pub pending_change: ::core::option::Option, } + /// This field might be extended in future versions of the API. #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum StakingInfo { - /// The account is a baker. + /// The account is a validator. #[prost(message, tag = "1")] Baker(Baker), /// The account is a delegator. @@ -414,11 +429,13 @@ pub struct EncryptionKey { /// An address of either a contract or an account. #[derive(Clone, PartialEq, ::prost::Message)] pub struct Address { + /// This field will not be extended in future versions of the API. #[prost(oneof = "address::Type", tags = "1, 2")] pub r#type: ::core::option::Option, } /// Nested message and enum types in `Address`. pub mod address { + /// This field will not be extended in future versions of the API. #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Type { #[prost(message, tag = "1")] @@ -430,11 +447,13 @@ pub mod address { /// A public key used to verify transaction signatures from an account. #[derive(Clone, PartialEq, ::prost::Message)] pub struct AccountVerifyKey { + /// This field might be extended in future versions of the API. #[prost(oneof = "account_verify_key::Key", tags = "1")] pub key: ::core::option::Option, } /// Nested message and enum types in `AccountVerifyKey`. pub mod account_verify_key { + /// This field might be extended in future versions of the API. #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Key { #[prost(bytes, tag = "1")] @@ -579,11 +598,13 @@ pub struct NormalCredentialValues { /// Credential that is part of an account. #[derive(Clone, PartialEq, ::prost::Message)] pub struct AccountCredential { + /// This field might be extended in future versions of the API. #[prost(oneof = "account_credential::CredentialValues", tags = "1, 2")] pub credential_values: ::core::option::Option, } /// Nested message and enum types in `AccountCredential`. pub mod account_credential { + /// This field might be extended in future versions of the API. #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum CredentialValues { #[prost(message, tag = "1")] @@ -608,12 +629,14 @@ pub struct Cooldown { } /// Nested message and enum types in `Cooldown`. pub mod cooldown { - /// The status of a cooldown. When stake is removed from a baker or delegator + /// The status of a cooldown. When stake is removed from a validator or delegator /// (from protocol version 7) it first enters the pre-pre-cooldown state. /// The next time the stake snaphot is taken (at the epoch transition before /// a payday) it enters the pre-cooldown state. At the subsequent payday, it /// enters the cooldown state. At the payday after the end of the cooldown /// period, the stake is finally released. + /// + /// This type might be extended in future versions of the API. #[derive( Clone, Copy, @@ -705,12 +728,12 @@ pub struct AccountInfo { /// Internal index of the account. Accounts on the chain get sequential /// indices. These should generally not be used outside of the chain, /// the account address is meant to be used to refer to accounts, - /// however the account index serves the role of the baker id, if the - /// account is a baker. Hence it is exposed here as well. + /// however the account index serves the role of the validator id, if the + /// account is a validator. Hence it is exposed here as well. #[prost(message, optional, tag = "8")] pub index: ::core::option::Option, - /// Present if the account is a baker or delegator. In that case - /// it is the information about the baker or delegator. + /// Present if the account is a validator or delegator. In that case + /// it is the information about the validator or delegator. #[prost(message, optional, tag = "9")] pub stake: ::core::option::Option, /// Canonical address of the account. This is derived from the first credential @@ -750,6 +773,7 @@ pub mod account_info { /// Input to queries which take a block as a parameter. #[derive(Clone, PartialEq, ::prost::Message)] pub struct BlockHashInput { + /// This field might be extended in future versions of the API. #[prost(oneof = "block_hash_input::BlockHashInput", tags = "1, 2, 3, 4, 5")] pub block_hash_input: ::core::option::Option, } @@ -769,6 +793,7 @@ pub mod block_hash_input { #[prost(bool, tag = "3")] pub restrict: bool, } + /// This field might be extended in future versions of the API. #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum BlockHashInput { /// Query for the best block. @@ -791,6 +816,7 @@ pub mod block_hash_input { /// Input to queries which take an epoch as a parameter. #[derive(Clone, PartialEq, ::prost::Message)] pub struct EpochRequest { + /// This field might be extended in future versions of the API. #[prost(oneof = "epoch_request::EpochRequestInput", tags = "1, 2")] pub epoch_request_input: ::core::option::Option, } @@ -807,6 +833,7 @@ pub mod epoch_request { #[prost(message, optional, tag = "2")] pub epoch: ::core::option::Option, } + /// This field might be extended in future versions of the API. #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum EpochRequestInput { /// Query by genesis index and epoch number. @@ -820,6 +847,7 @@ pub mod epoch_request { /// Input to queries which take an account as a parameter. #[derive(Clone, PartialEq, ::prost::Message)] pub struct AccountIdentifierInput { + /// This field might be extended in future versions of the API. #[prost( oneof = "account_identifier_input::AccountIdentifierInput", tags = "1, 2, 3" @@ -830,6 +858,7 @@ pub struct AccountIdentifierInput { } /// Nested message and enum types in `AccountIdentifierInput`. pub mod account_identifier_input { + /// This field might be extended in future versions of the API. #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum AccountIdentifierInput { /// Identify the account by the address of the account. @@ -918,6 +947,9 @@ pub struct InstanceInfoRequest { #[derive(Clone, PartialEq, ::prost::Message)] pub struct InstanceInfo { /// The information depends on the smart contract version used by the instance. + /// + /// This field will not be extended in future versions of the API, instead new data versions will + /// use optional fields in `InstanceInfo.V1`. #[prost(oneof = "instance_info::Version", tags = "1, 2")] pub version: ::core::option::Option, } @@ -965,6 +997,9 @@ pub mod instance_info { pub source_module: ::core::option::Option, } /// The information depends on the smart contract version used by the instance. + /// + /// This field will not be extended in future versions of the API, instead new data versions will + /// use optional fields in `InstanceInfo.V1`. #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Version { #[prost(message, tag = "1")] @@ -1033,6 +1068,7 @@ pub struct ContractStateV0 { /// Status of a block item known to the node. #[derive(Clone, PartialEq, ::prost::Message)] pub struct BlockItemStatus { + /// This field might be extended in future versions of the API. #[prost(oneof = "block_item_status::Status", tags = "1, 2, 3")] pub status: ::core::option::Option, } @@ -1048,6 +1084,7 @@ pub mod block_item_status { #[prost(message, optional, tag = "1")] pub outcome: ::core::option::Option, } + /// This field might be extended in future versions of the API. #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Status { /// Block item is received, but not yet in any blocks. @@ -1081,7 +1118,7 @@ pub struct Energy { #[prost(uint64, tag = "1")] pub value: u64, } -/// A number representing a slot for baking a block. +/// A number representing a slot for producing a block. #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Slot { #[prost(uint64, tag = "1")] @@ -1108,6 +1145,7 @@ pub struct Duration { /// rejected transaction is payment. #[derive(Clone, PartialEq, ::prost::Message)] pub struct RejectReason { + /// This field might be extended in future versions of the API. #[prost( oneof = "reject_reason::Reason", tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56" @@ -1163,6 +1201,7 @@ pub mod reject_reason { #[prost(message, repeated, tag = "1")] pub ids: ::prost::alloc::vec::Vec, } + /// This field might be extended in future versions of the API. #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Reason { /// Raised while validating a Wasm module that is not well formed. @@ -1207,26 +1246,26 @@ pub mod reject_reason { /// Rejected due to contract logic in receive function of a contract. #[prost(message, tag = "13")] RejectedReceive(RejectedReceive), - /// Proof that the baker owns relevant private keys is not valid. + /// Proof that the validator owns relevant private keys is not valid. #[prost(message, tag = "14")] InvalidProof(super::Empty), - /// Tried to add baker for an account that already has a baker. + /// Tried to add validator for an account that already has a validator. #[prost(message, tag = "15")] AlreadyABaker(super::BakerId), - /// Tried to remove a baker for an account that has no baker. + /// Tried to remove a validator for an account that has no validator. #[prost(message, tag = "16")] NotABaker(super::AccountAddress), /// The amount on the account was insufficient to cover the proposed stake. #[prost(message, tag = "17")] InsufficientBalanceForBakerStake(super::Empty), - /// The amount provided is under the threshold required for becoming a baker. + /// The amount provided is under the threshold required for becoming a validator. #[prost(message, tag = "18")] StakeUnderMinimumThresholdForBaking(super::Empty), - /// The change could not be made because the baker is in cooldown for + /// The change could not be made because the validator is in cooldown for /// another change. #[prost(message, tag = "19")] BakerInCooldown(super::Empty), - /// A baker with the given aggregation key already exists. + /// A validator with the given aggregation key already exists. #[prost(message, tag = "20")] DuplicateAggregationKey(super::BakerAggregationVerifyKey), /// Encountered credential ID that does not exist. @@ -1300,20 +1339,20 @@ pub mod reject_reason { /// from/to public to/from encrypted). #[prost(message, tag = "40")] NotAllowedToHandleEncrypted(super::Empty), - /// A configure baker transaction is missing one or more arguments in order - /// to add a baker. + /// A `ConfigureBaker` transaction is missing one or more arguments in order + /// to add a validator. #[prost(message, tag = "41")] MissingBakerAddParameters(super::Empty), - /// Finalization reward commission is not in the valid range for a baker. + /// Finalization reward commission is not in the valid range for a validator. #[prost(message, tag = "42")] FinalizationRewardCommissionNotInRange(super::Empty), - /// Baking reward commission is not in the valid range for a baker. + /// Block production reward commission is not in the valid range for a validator. #[prost(message, tag = "43")] BakingRewardCommissionNotInRange(super::Empty), - /// Transaction fee commission is not in the valid range for a baker. + /// Transaction fee commission is not in the valid range for a validator. #[prost(message, tag = "44")] TransactionFeeCommissionNotInRange(super::Empty), - /// Tried to add baker for an account that already has a delegator. + /// Tried to add validator for an account that already has a delegator. #[prost(message, tag = "45")] AlreadyADelegator(super::Empty), /// The amount on the account was insufficient to cover the proposed stake. @@ -1332,7 +1371,7 @@ pub mod reject_reason { /// Account is not a delegation account. #[prost(message, tag = "50")] NotADelegator(super::AccountAddress), - /// Delegation target is not a baker + /// Delegation target is not a validator #[prost(message, tag = "51")] DelegationTargetNotABaker(super::BakerId), /// The amount would result in pool capital higher than the maximum @@ -1419,12 +1458,13 @@ pub struct InstanceUpdatedEvent { /// A single invocation will produce a sequence of these effects. #[derive(Clone, PartialEq, ::prost::Message)] pub struct ContractTraceElement { + /// This field might be extended in future versions of the API. #[prost(oneof = "contract_trace_element::Element", tags = "1, 2, 3, 4, 5")] pub element: ::core::option::Option, } /// Nested message and enum types in `ContractTraceElement`. pub mod contract_trace_element { - /// A contract transferred an amount to an account. + /// A contract transferred an amount of CCD to an account. #[derive(Clone, PartialEq, ::prost::Message)] pub struct Transferred { /// Sender contract. @@ -1459,6 +1499,7 @@ pub mod contract_trace_element { pub success: bool, } /// A previously interrupted contract was resumed. + /// This message can occur starting from protocol version 5. #[derive(Clone, PartialEq, ::prost::Message)] pub struct Upgraded { /// The that was upgraded. @@ -1471,12 +1512,13 @@ pub mod contract_trace_element { #[prost(message, optional, tag = "3")] pub to: ::core::option::Option, } + /// This field might be extended in future versions of the API. #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Element { /// A contract instance was updated. #[prost(message, tag = "1")] Updated(super::InstanceUpdatedEvent), - /// A contract transferred an amount to an account. + /// A contract transferred an amount of CCD to an account. #[prost(message, tag = "2")] Transferred(Transferred), /// A contract was interrupted. @@ -1487,23 +1529,24 @@ pub mod contract_trace_element { #[prost(message, tag = "4")] Resumed(Resumed), /// A contract was upgraded. + /// This trace element can occur starting from protocol version 5. #[prost(message, tag = "5")] Upgraded(Upgraded), } } -/// Result of a successful change of baker keys. +/// Result of a successful change of validator keys. #[derive(Clone, PartialEq, ::prost::Message)] pub struct BakerKeysEvent { - /// ID of the baker whose keys were changed. + /// ID of the validator whose keys were changed. #[prost(message, optional, tag = "1")] pub baker_id: ::core::option::Option, - /// Account address of the baker. + /// Account address of the validator. #[prost(message, optional, tag = "2")] pub account: ::core::option::Option, /// The new public key for verifying block signatures. #[prost(message, optional, tag = "3")] pub sign_key: ::core::option::Option, - /// The new public key for verifying whether the baker won the block + /// The new public key for verifying whether the validator won the block /// lottery. #[prost(message, optional, tag = "4")] pub election_key: ::core::option::Option, @@ -1511,9 +1554,12 @@ pub struct BakerKeysEvent { #[prost(message, optional, tag = "5")] pub aggregation_key: ::core::option::Option, } +/// The associated transaction type can no longer be created starting from protocol version 4. +/// Hence, this message does not occur anymore. +/// The functionality was replaced in protocol version 4 by the `BakerConfigured` transaction type. #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct BakerStakeUpdatedData { - /// Affected baker. + /// Affected validator. #[prost(message, optional, tag = "1")] pub baker_id: ::core::option::Option, /// New stake. @@ -1571,9 +1617,12 @@ pub struct RegisteredData { #[prost(bytes = "vec", tag = "1")] pub value: ::prost::alloc::vec::Vec, } -/// Events that may result from the ConfigureBaker transaction. +/// Events that may result from the `ConfigureBaker` transaction which adds, modify, or removes a validator pool starting in protocol version 4. +/// Before protocol version 4, distinct transaction types (`BakerAdded`, `BakerRemoved`, `BakerStakeUpdated`, `BakerRestakeEarningsUpdated`, +/// and `BakerKeysUpdated`) existed which emitted validator related events instead. #[derive(Clone, PartialEq, ::prost::Message)] pub struct BakerEvent { + /// This field might be extended in future versions of the API. #[prost( oneof = "baker_event::Event", tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14" @@ -1582,34 +1631,39 @@ pub struct BakerEvent { } /// Nested message and enum types in `BakerEvent`. pub mod baker_event { - /// A baker was added. + /// A validator was added. + /// This message/event is always accompanied by `BakerEvent::BakerSetRestakeEarnings`, and starting from protocol version 4 also `BakerEvent::BakerSetOpenStatus`, + /// `BakerEvent::BakerSetMetadataURL`, `BakerEvent::BakerSetTransactionFeeCommission`, `BakerEvent::BakerSetBakingRewardCommission` and `BakerEvent::BakerSetFinalizationRewardCommission` events in the same transaction. #[derive(Clone, PartialEq, ::prost::Message)] pub struct BakerAdded { - /// The keys with which the baker registered. + /// The keys with which the validator registered. #[prost(message, optional, tag = "1")] pub keys_event: ::core::option::Option, - /// The amount the account staked to become a baker. This amount is + /// The amount the account staked to become a validator. This amount is /// locked. #[prost(message, optional, tag = "2")] pub stake: ::core::option::Option, - /// Whether the baker will automatically add earnings to their stake or + /// Whether the validator will automatically add earnings to their stake or /// not. #[prost(bool, tag = "3")] pub restake_earnings: bool, } - /// Baker stake increased. + /// Validator stake increased. #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct BakerStakeIncreased { - /// Baker's id. + /// Validator's id. #[prost(message, optional, tag = "1")] pub baker_id: ::core::option::Option, /// The new stake. #[prost(message, optional, tag = "2")] pub new_stake: ::core::option::Option, } + /// The validator's stake was decreased. + /// The behavior of decreasing the stake of validators changed in protocol version 7 + /// (see for more details). #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct BakerStakeDecreased { - /// Baker's id. + /// Validator's id. #[prost(message, optional, tag = "1")] pub baker_id: ::core::option::Option, /// The new stake. @@ -1618,57 +1672,62 @@ pub mod baker_event { } #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct BakerRestakeEarningsUpdated { - /// Baker's id. + /// Validator's id. #[prost(message, optional, tag = "1")] pub baker_id: ::core::option::Option, /// The new value of the flag. #[prost(bool, tag = "2")] pub restake_earnings: bool, } - /// Updated open status for a baker pool. + /// Updated open status for a validator pool. + /// This message can occur starting from protocol version 4. #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct BakerSetOpenStatus { - /// Baker's id. + /// Validator's id. #[prost(message, optional, tag = "1")] pub baker_id: ::core::option::Option, /// The new open status. #[prost(enumeration = "super::OpenStatus", tag = "2")] pub open_status: i32, } - /// Updated metadata url for a baker pool. + /// Updated metadata url for a validator pool. + /// This message can occur starting from protocol version 4. #[derive(Clone, PartialEq, ::prost::Message)] pub struct BakerSetMetadataUrl { - /// Baker's id. + /// Validator's id. #[prost(message, optional, tag = "1")] pub baker_id: ::core::option::Option, /// The URL. #[prost(string, tag = "2")] pub url: ::prost::alloc::string::String, } - /// Updated transaction fee commission for a baker pool. + /// Updated transaction fee commission for a validator pool. + /// This message can occur starting from protocol version 4. #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct BakerSetTransactionFeeCommission { - /// Baker's id. + /// Validator's id. #[prost(message, optional, tag = "1")] pub baker_id: ::core::option::Option, /// The transaction fee commission. #[prost(message, optional, tag = "2")] pub transaction_fee_commission: ::core::option::Option, } - /// Updated baking reward commission for baker pool + /// Updated block production reward commission for validator pool. + /// This message can occur starting from protocol version 4. #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct BakerSetBakingRewardCommission { - /// Baker's id + /// Validator's id #[prost(message, optional, tag = "1")] pub baker_id: ::core::option::Option, - /// The baking reward commission + /// The block production reward commission #[prost(message, optional, tag = "2")] pub baking_reward_commission: ::core::option::Option, } - /// Updated finalization reward commission for baker pool + /// Updated finalization reward commission for validator pool. + /// This message can occur starting from protocol version 4. #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct BakerSetFinalizationRewardCommission { - /// Baker's id + /// Validator's id #[prost(message, optional, tag = "1")] pub baker_id: ::core::option::Option, /// The finalization reward commission @@ -1678,68 +1737,99 @@ pub mod baker_event { >, } /// Removed an existing delegator. + /// An existing delegation was removed by a transaction sent from a delegator that switched its staking behavior to being a validator. + /// If the account is a delegator in the current payday, it will remain so until the + /// next payday with respect to staking reward payouts, although the delegation record will be removed from the account immediately. + /// If the cause of the delegation removal is a transaction sent by the delegator that decreased the delegator's stake to 0, + /// the `DelegationEvent::DelegationRemoved` is emitted instead of this event/message. + /// This message can occur starting from protocol version 7. #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct DelegationRemoved { /// Delegator's id. #[prost(message, optional, tag = "1")] pub delegator_id: ::core::option::Option, } - /// A baker has been suspended. + /// The validator has been suspended by a transaction sent from the validator itself. + /// If the validator is suspended by the protocol (e.g., due to inactivity), the `BlockSpecialEvent::ValidatorSuspended` + /// event is emitted instead of this event. + /// This message can occur starting from protocol version 8. #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct BakerSuspended { - /// Suspended baker's id + /// Suspended validator's id #[prost(message, optional, tag = "1")] pub baker_id: ::core::option::Option, } - /// A baker has been resumed. + /// A validator has been resumed by a transaction sent from the validator itself. + /// This message can occur starting from protocol version 8. #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct BakerResumed { - /// The resumed baker's id + /// The resumed validator's id #[prost(message, optional, tag = "1")] pub baker_id: ::core::option::Option, } + /// This field might be extended in future versions of the API. #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Event { - /// A baker was added. + /// A validator was added. + /// This event is always accompanied by `BakerEvent::BakerSetRestakeEarnings`, and starting from protocol version 4 also `BakerEvent::BakerSetOpenStatus`, + /// `BakerEvent::BakerSetMetadataURL`, `BakerEvent::BakerSetTransactionFeeCommission`, `BakerEvent::BakerSetBakingRewardCommission` and `BakerEvent::BakerSetFinalizationRewardCommission` events in the same transaction. #[prost(message, tag = "1")] BakerAdded(BakerAdded), - /// A baker was removed. + /// A validator was removed by a transaction sent by the validator that decreased the validator's own stake to 0. + /// When a validator is removed, it results in its delegators targeting the pool to be moved to the passive delegation. + /// The behavior of validators being removed changed in protocol version 7 + /// (see for more details). + /// If the cause of the validator removal is a transaction from an existing validator that switched its staking behavior to `delegation`, + /// the `DelegationEvent::BakerRemoved` is emitted instead of this event. #[prost(message, tag = "2")] BakerRemoved(super::BakerId), - /// The baker's stake was increased. + /// The validator's stake was increased. #[prost(message, tag = "3")] BakerStakeIncreased(BakerStakeIncreased), - /// The baker's stake was decreased. + /// The validator's stake was decreased. + /// The behavior of decreasing the stake of validators changed in protocol version 7 + /// (see for more details). #[prost(message, tag = "4")] BakerStakeDecreased(BakerStakeDecreased), - /// The baker's setting for restaking earnings was updated. + /// The validator's setting for restaking earnings was updated. #[prost(message, tag = "5")] BakerRestakeEarningsUpdated(BakerRestakeEarningsUpdated), - /// Baker keys were updated. + /// Validator keys were updated. #[prost(message, tag = "6")] BakerKeysUpdated(super::BakerKeysEvent), - /// The baker's open status was updated. + /// The validator's open status was updated. #[prost(message, tag = "7")] BakerSetOpenStatus(BakerSetOpenStatus), - /// The baker's metadata URL was updated. + /// The validator's metadata URL was updated. #[prost(message, tag = "8")] BakerSetMetadataUrl(BakerSetMetadataUrl), - /// The baker's transaction fee commission was updated. + /// The validator's transaction fee commission was updated. #[prost(message, tag = "9")] BakerSetTransactionFeeCommission(BakerSetTransactionFeeCommission), - /// The baker's baking reward commission was updated. + /// The validator's block production reward commission was updated. #[prost(message, tag = "10")] BakerSetBakingRewardCommission(BakerSetBakingRewardCommission), - /// The baker's finalization reward commission was updated. + /// The validator's finalization reward commission was updated. #[prost(message, tag = "11")] BakerSetFinalizationRewardCommission(BakerSetFinalizationRewardCommission), - /// An existing delegator was removed. + /// An existing delegation was removed by a transaction sent from a delegator that switched its staking behavior to being a validator. + /// This event is always accompanied by `BakerEvent::BakerAdded`, `BakerEvent::BakerSetRestakeEarnings`, and starting from protocol version 4 also `BakerEvent::BakerSetOpenStatus`, + /// `BakerEvent::BakerSetMetadataURL`, `BakerEvent::BakerSetTransactionFeeCommission`, `BakerEvent::BakerSetBakingRewardCommission` and `BakerEvent::BakerSetFinalizationRewardCommission` events in the same transaction. + /// If the account is a delegator in the current payday, it will remain so until the + /// next payday with respect to staking reward payouts, although the delegation record will be removed from the account immediately. + /// If the cause of the delegation removal is a transaction sent by the delegator that decreased the delegator's stake to 0, + /// the `DelegationEvent::DelegationRemoved` is emitted instead of this event. + /// This event was introduced in protocol version version 7. #[prost(message, tag = "12")] DelegationRemoved(DelegationRemoved), - /// The baker's account has been suspended. + /// The validator has been suspended by a transaction sent from the validator itself. + /// If the validator is suspended by the protocol (e.g., due to inactivity), the `BlockSpecialEvent::ValidatorSuspended` + /// event is emitted instead of this event. + /// This event can occur starting from protocol version 8. #[prost(message, tag = "13")] BakerSuspended(BakerSuspended), - /// The baker's account has been suspended. + /// The validator has been resumed by a transaction sent from the validator itself. + /// This event can occur starting from protocol version 8. #[prost(message, tag = "14")] BakerResumed(BakerResumed), } @@ -1750,8 +1840,11 @@ pub struct DelegatorId { #[prost(message, optional, tag = "1")] pub id: ::core::option::Option, } +/// Events that may result from the `ConfigureDelegation` transaction which adds, modify, or removes a delegator starting in protocol version 4. +/// There was no delegation feature before protocol version 4. #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct DelegationEvent { + /// This field might be extended in future versions of the API. #[prost(oneof = "delegation_event::Event", tags = "1, 2, 3, 4, 5, 6, 7")] pub event: ::core::option::Option, } @@ -1789,16 +1882,18 @@ pub mod delegation_event { /// Delegator's id #[prost(message, optional, tag = "1")] pub delegator_id: ::core::option::Option, - /// New delegation target + /// New delegation target (either to a validator pool or passive delegation) #[prost(message, optional, tag = "2")] pub delegation_target: ::core::option::Option, } + /// This message can occur starting from protocol version 7. #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct BakerRemoved { - /// Baker's id + /// Validator's id #[prost(message, optional, tag = "1")] pub baker_id: ::core::option::Option, } + /// This field might be extended in future versions of the API. #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum Event { /// The delegator's stake increased. @@ -1810,16 +1905,28 @@ pub mod delegation_event { /// The delegator's restaking setting was updated. #[prost(message, tag = "3")] DelegationSetRestakeEarnings(DelegationSetRestakeEarnings), - /// The delegator's delegation target was updated. + /// The delegator's delegation target (either a validator pool or passive delegation) was updated by a transaction from the delegator. #[prost(message, tag = "4")] DelegationSetDelegationTarget(DelegationSetDelegationTarget), /// A delegator was added. + /// This event is always accompanied by `DelegationEvent::DelegationSetDelegationTarget`, `DelegationEvent::DelegationSetRestakeEarnings `, and `DelegationEvent::DelegationStakeIncreased` events in the same transaction. #[prost(message, tag = "5")] DelegationAdded(super::DelegatorId), - /// A delegator was removed. + /// A delegator was removed by a transaction sent from the delegator that decreased the delegators's stake to 0. + /// If the account is a delegator in the current payday, it will remain so until the + /// next payday with respect to staking reward payouts, although the delegation record will be removed from the account immediately. + /// If the cause of the delegation removal is a transaction sent from a delegator that switched its staking behavior to being a validator, + /// the `BakerEvent::DelegationRemoved` is emitted instead of this event. #[prost(message, tag = "6")] DelegationRemoved(super::DelegatorId), - /// An existing baker was removed. + /// An existing validator was removed by a transaction sent from an validator that switched its staking behavior to `delegation`. + /// This event is always accompanied by `DelegationEvent::DelegationAdded`, `DelegationEvent::DelegationSetDelegationTarget`, `DelegationEvent::DelegationSetRestakeEarnings `, and `DelegationEvent::DelegationStakeIncreased` events in the same transaction. + /// When a validator is removed, it results in its delegators targeting the pool to be moved to the passive delegation. + /// The behavior of validators being removed changed in protocol version 7. + /// (see for more details). + /// If the cause of the validator removal is a transaction that decreased the validator's own stake to 0, + /// the `BakerEvent::BakerRemoved` is emitted instead of this event. + /// This event can occur starting from protocol version 7. #[prost(message, tag = "7")] BakerRemoved(BakerRemoved), } @@ -1828,6 +1935,7 @@ pub mod delegation_event { /// correspond to a unique transaction that was successful. #[derive(Clone, PartialEq, ::prost::Message)] pub struct AccountTransactionEffects { + /// This field might be extended in future versions of the API. #[prost( oneof = "account_transaction_effects::Effect", tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20" @@ -1866,11 +1974,15 @@ pub mod account_transaction_effects { #[prost(message, optional, tag = "2")] pub receiver: ::core::option::Option, /// Memo. + /// This field can occur starting from protocol version 2. #[prost(message, optional, tag = "3")] pub memo: ::core::option::Option, } - /// An account was deregistered as a baker. This is the result of a - /// successful UpdateBakerStake transaction. + /// A validator updated its stake. This is the result of a + /// successful `UpdateBakerStake` transaction. + /// The associated transaction type can no longer be created starting from protocol version 4. + /// Hence, this message does not occur anymore. + /// The functionality was replaced in protocol version 4 by the `BakerConfigured` transaction type. #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct BakerStakeUpdated { /// If the stake was updated (that is, it changed and did not stay the @@ -1880,12 +1992,15 @@ pub mod account_transaction_effects { } /// An encrypted amount was transferred. This is the result of a successful /// EncryptedAmountTransfer transaction. + /// The associated transaction type can no longer be created starting from protocol 7. + /// Hence, this message does not occur anymore. #[derive(Clone, PartialEq, ::prost::Message)] pub struct EncryptedAmountTransferred { #[prost(message, optional, tag = "1")] pub removed: ::core::option::Option, #[prost(message, optional, tag = "2")] pub added: ::core::option::Option, + /// This field can occur starting from protocol version 2. #[prost(message, optional, tag = "3")] pub memo: ::core::option::Option, } @@ -1909,6 +2024,7 @@ pub mod account_transaction_effects { #[prost(message, repeated, tag = "2")] pub amount: ::prost::alloc::vec::Vec, /// Optional memo. + /// This field can occur starting from protocol version 2. #[prost(message, optional, tag = "3")] pub memo: ::core::option::Option, } @@ -1926,8 +2042,10 @@ pub mod account_transaction_effects { #[prost(message, optional, tag = "3")] pub new_threshold: ::core::option::Option, } - /// A baker was configured. The details of what happened are contained in - /// the list of BakerEvents. + /// A validator was configured. The details of what happened are contained in + /// the list of `BakerEvents`. + /// The associated transaction type is available starting from protocol version 4 and replaces the existing transaction types and effects from earlier protocols (`BakerAdded`, + /// `BakerRemoved`, `BakerStakeUpdated`, `BakerRestakeEarningsUpdated`, and `BakerKeysUpdated`). #[derive(Clone, PartialEq, ::prost::Message)] pub struct BakerConfigured { #[prost(message, repeated, tag = "1")] @@ -1935,11 +2053,14 @@ pub mod account_transaction_effects { } /// An account configured delegation. The details of what happened are /// contained in the list of DelegationEvents. + /// The associated transaction type is available starting from protocol version 4 and replaces the existing transaction types and effects from earlier protocols (`BakerAdded`, + /// `BakerRemoved`, `BakerStakeUpdated`, `BakerRestakeEarningsUpdated`, and `BakerKeysUpdated`). #[derive(Clone, PartialEq, ::prost::Message)] pub struct DelegationConfigured { #[prost(message, repeated, tag = "1")] pub events: ::prost::alloc::vec::Vec, } + /// This field might be extended in future versions of the API. #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Effect { /// No effects other than payment from this transaction. @@ -1958,26 +2079,45 @@ pub mod account_transaction_effects { /// A simple account to account transfer occurred. #[prost(message, tag = "5")] AccountTransfer(AccountTransfer), - /// A baker was added. + /// A validator was added. + /// The associated transaction type can no longer be created starting from protocol version 4. + /// Hence, this effect does not occur anymore. + /// The functionality was replaced in protocol version 4 by the `BakerConfigured` transaction type. #[prost(message, tag = "6")] BakerAdded(super::baker_event::BakerAdded), - /// A baker was removed. + /// A validator was removed. + /// The associated transaction type can no longer be created starting from protocol version 4. + /// Hence, this effect does not occur anymore. + /// The functionality was replaced in protocol version 4 by the `BakerConfigured` transaction type. #[prost(message, tag = "7")] BakerRemoved(super::BakerId), - /// A baker's stake was updated. + /// A validator's stake was updated. + /// The associated transaction type can no longer be created starting from protocol version 4. + /// Hence, this effect does not occur anymore. + /// The functionality was replaced in protocol version 4 by the `BakerConfigured` transaction type. #[prost(message, tag = "8")] BakerStakeUpdated(BakerStakeUpdated), - /// A baker's restake earnings setting was updated. + /// A validator's restake earnings setting was updated. + /// The associated transaction type can no longer be created starting from protocol version 4. + /// Hence, this effect does not occur anymore. + /// The functionality was replaced in protocol version 4 by the `BakerConfigured` transaction type. #[prost(message, tag = "9")] BakerRestakeEarningsUpdated(super::baker_event::BakerRestakeEarningsUpdated), - /// A baker's keys were updated. + /// A validator's keys were updated. + /// The associated transaction type can no longer be created starting from protocol version 4. + /// Hence, this effect does not occur anymore. + /// The functionality was replaced in protocol version 4 by the `BakerConfigured` transaction type. #[prost(message, tag = "10")] BakerKeysUpdated(super::BakerKeysEvent), /// An encrypted amount was transferred. + /// The associated transaction type can no longer be created starting from protocol 7. + /// Hence, this effect does not occur anymore. #[prost(message, tag = "11")] EncryptedAmountTransferred(EncryptedAmountTransferred), /// An account transferred part of its public balance to its encrypted /// balance. + /// The associated transaction type can no longer be created starting from protocol 7. + /// Hence, this effect does not occur anymore. #[prost(message, tag = "12")] TransferredToEncrypted(super::EncryptedSelfAmountAddedEvent), /// An account transferred part of its encrypted balance to its public balance. @@ -1995,10 +2135,13 @@ pub mod account_transaction_effects { /// Some data was registered on the chain. #[prost(message, tag = "17")] DataRegistered(super::RegisteredData), - /// A baker was configured. The details of what happened are contained in a list of BakerEvents. + /// A validator was configured. The details of what happened are contained in a list of `BakerEvents`. + /// The associated transaction type is available starting from protocol version 4 and replaces the existing transaction types and effects from earlier protocols (`BakerAdded`, + /// `BakerRemoved`, `BakerStakeUpdated`, `BakerRestakeEarningsUpdated`, and `BakerKeysUpdated`). #[prost(message, tag = "18")] BakerConfigured(BakerConfigured), /// A delegator was configured. The details of what happened are contained in a list of DelegatorEvents. + /// This transaction type is available starting from protocol version 4. #[prost(message, tag = "19")] DelegationConfigured(DelegationConfigured), /// Token update transaction effect. @@ -2152,7 +2295,7 @@ pub struct AuthorizationsV0 { #[prost(message, optional, tag = "10")] pub parameter_gas_rewards: ::core::option::Option, /// Access structure for updating the pool parameters. For V0 this is only - /// the baker stake threshold, for V1 there are more. + /// the validator stake threshold, for V1 there are more. #[prost(message, optional, tag = "11")] pub pool_parameters: ::core::option::Option, /// Access structure for adding new anonymity revokers. @@ -2169,7 +2312,7 @@ pub struct AuthorizationsV0 { pub struct AuthorizationsV1 { #[prost(message, optional, tag = "1")] pub v0: ::core::option::Option, - /// Access structure for updating the cooldown periods related to baking and delegation. + /// Access structure for updating the cooldown periods related to validation and delegation. #[prost(message, optional, tag = "2")] pub parameter_cooldown: ::core::option::Option, /// Access structure for updating the length of the reward period. @@ -2283,21 +2426,39 @@ pub struct CommissionRanges { /// The range of allowed finalization commissions. #[prost(message, optional, tag = "1")] pub finalization: ::core::option::Option, - /// The range of allowed baker commissions. + /// The range of allowed validator commissions. #[prost(message, optional, tag = "2")] pub baking: ::core::option::Option, /// The range of allowed transaction commissions. #[prost(message, optional, tag = "3")] pub transaction: ::core::option::Option, } -/// A bound on the relative share of the total staked capital that a baker can -/// have as its stake. This is required to be greater than 0. +/// The capital bound is a chain parameter that is set to guarantee network decentralization by preventing +/// a single validator from gaining excessive power in the consensus protocol. +/// The capital bound is required to be set to a value greater than 0 (capital_bound > 0). +/// The value roughly describes the maximum proportion of the total stake in the protocol (from all validators including passive delegation) +/// to the stake of a validator that a validator can achieve where the total stake of the validator is considered effective +/// (meaning the validator's total stake is used for caculating the lottery power or finalizer weight in the consensus). +/// Once a validator passes this bound, some of the validator's total stake no longer contributes to the validator's effective stake. +/// Delegators are prevented from increasing their delegation to the pool +/// (via sending a `ConfigureDelegation` transaction) if that would cause the pool to exceed the capital bound cap. +/// See the comment at the `delegated_capital_cap` type for the exact formula. #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct CapitalBound { #[prost(message, optional, tag = "1")] pub value: ::core::option::Option, } -/// A leverage factor. +/// The leverage factor (leverage bound) is a chain parameter that is set to guarantee that each validator +/// has skin in the game with respect to its delegators by providing some of the CCD staked at the validator's pool from the validator's funds. +/// The leverage factor is required to be set to a value greater than or equal to 1 (1 <= leverage_factor). +/// The leverage factor is the maximum proportion of total stake of a validator (including the validator's own stake and the delegated +/// stake to the validator) to the validator's own stake (excluding delegated stake to the validator) +/// that a validator can achieve where the total stake of the validator is considered effective +/// (meaning the validator's total stake is used for caculating the lottery power or finalizer weight in the consensus). +/// Once a validator passes this bound, some of the validator's total stake no longer contributes to the validator's effective stake. +/// Delegators are prevented from increasing their delegation to the pool +/// (via sending a `ConfigureDelegation` transaction) if that would cause the pool to exceed the leverage bound cap. +/// See the comment at the `delegated_capital_cap` type for the exact formula. #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct LeverageFactor { #[prost(message, optional, tag = "1")] @@ -2349,23 +2510,23 @@ pub struct PoolParametersCpv1 { /// Fraction of finalization rewards charged by the passive delegation. #[prost(message, optional, tag = "1")] pub passive_finalization_commission: ::core::option::Option, - /// Fraction of baking rewards charged by the passive delegation. + /// Fraction of block production rewards charged by the passive delegation. #[prost(message, optional, tag = "2")] pub passive_baking_commission: ::core::option::Option, /// Fraction of transaction rewards charged by the L-pool. #[prost(message, optional, tag = "3")] pub passive_transaction_commission: ::core::option::Option, - /// Bounds on the commission rates that may be charged by bakers. + /// Bounds on the commission rates that may be charged by validators. #[prost(message, optional, tag = "4")] pub commission_bounds: ::core::option::Option, - /// Minimum equity capital required for a new baker. + /// Minimum equity capital required for a new validator. #[prost(message, optional, tag = "5")] pub minimum_equity_capital: ::core::option::Option, - /// Maximum fraction of the total staked capital of that a new baker can + /// Maximum fraction of the total staked capital of that a new validator can /// have. #[prost(message, optional, tag = "6")] pub capital_bound: ::core::option::Option, - /// The maximum leverage that a baker can have as a ratio of total stake + /// The maximum leverage that a validator can have as a ratio of total stake /// to equity capital. #[prost(message, optional, tag = "7")] pub leverage_bound: ::core::option::Option, @@ -2403,7 +2564,7 @@ pub struct ProtocolUpdate { #[prost(bytes = "vec", tag = "4")] pub specification_auxiliary_data: ::prost::alloc::vec::Vec, } -/// The minting rate and the distribution of newly-minted CCD among bakers, +/// The minting rate and the distribution of newly-minted CCD among validators, /// finalizers, and the foundation account. It must be the case that /// baking_reward + finalization_reward <= 1. The remaining amount is the /// platform development charge. @@ -2412,7 +2573,7 @@ pub struct MintDistributionCpv0 { /// Mint rate per slot. #[prost(message, optional, tag = "1")] pub mint_per_slot: ::core::option::Option, - /// The fraction of newly created CCD allocated to baker rewards. + /// The fraction of newly created CCD allocated to validator rewards. #[prost(message, optional, tag = "2")] pub baking_reward: ::core::option::Option, /// The fraction of newly created CCD allocated to finalization rewards. @@ -2422,7 +2583,7 @@ pub struct MintDistributionCpv0 { /// Parameters determining the distribution of transaction fees. #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct TransactionFeeDistribution { - /// The fraction allocated to the baker. + /// The fraction allocated to the validator. #[prost(message, optional, tag = "1")] pub baker: ::core::option::Option, /// The fraction allocated to the GAS account. @@ -2432,7 +2593,7 @@ pub struct TransactionFeeDistribution { /// Distribution of gas rewards for chain parameters version 0 and 1. #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct GasRewards { - /// The fraction paid to the baker. + /// The fraction paid to the validator. #[prost(message, optional, tag = "1")] pub baker: ::core::option::Option, /// Fraction paid for including a finalization proof in a block. @@ -2448,7 +2609,7 @@ pub struct GasRewards { /// Distribution of gas rewards for chain parameters version 2. #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct GasRewardsCpv2 { - /// The fraction paid to the baker. + /// The fraction paid to the validator. #[prost(message, optional, tag = "1")] pub baker: ::core::option::Option, /// Fraction paid for including each account creation transaction in a block. @@ -2458,11 +2619,10 @@ pub struct GasRewardsCpv2 { #[prost(message, optional, tag = "4")] pub chain_update: ::core::option::Option, } -/// Minimum stake needed to become a baker. This only applies to protocol version -/// 1-3. +/// Minimum stake needed to become a validator. This only applies to protocol version 1-3. #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct BakerStakeThreshold { - /// Minimum threshold required for registering as a baker. + /// Minimum threshold required for registering as a validator. #[prost(message, optional, tag = "1")] pub baker_stake_threshold: ::core::option::Option, } @@ -2470,11 +2630,15 @@ pub struct BakerStakeThreshold { /// even themselves. They can only be performed by Root level keys. #[derive(Clone, PartialEq, ::prost::Message)] pub struct RootUpdate { + /// This field will not be extended in future versions of the API, instead new data versions will + /// use optional fields in either `HigherLevelKeys` or `AuthorizationsV1`. #[prost(oneof = "root_update::UpdateType", tags = "1, 2, 3, 4")] pub update_type: ::core::option::Option, } /// Nested message and enum types in `RootUpdate`. pub mod root_update { + /// This field will not be extended in future versions of the API, instead new data versions will + /// use optional fields in either `HigherLevelKeys` or `AuthorizationsV1`. #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum UpdateType { /// The root keys were updated. @@ -2495,11 +2659,15 @@ pub mod root_update { /// They can update themselves or level 2 keys. They can only be performed by level 1 keys. #[derive(Clone, PartialEq, ::prost::Message)] pub struct Level1Update { + /// This field will not be extended in future versions of the API, instead new data versions will + /// use optional fields in either `HigherLevelKeys` or `AuthorizationsV1`. #[prost(oneof = "level1_update::UpdateType", tags = "1, 2, 3")] pub update_type: ::core::option::Option, } /// Nested message and enum types in `Level1Update`. pub mod level1_update { + /// This field will not be extended in future versions of the API, instead new data versions will + /// use optional fields in either `HigherLevelKeys` or `AuthorizationsV1`. #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum UpdateType { /// The level 1 keys were updated. @@ -2516,6 +2684,7 @@ pub mod level1_update { /// The payload of a chain update. #[derive(Clone, PartialEq, ::prost::Message)] pub struct UpdatePayload { + /// This field might be extended in future versions of the API. #[prost( oneof = "update_payload::Payload", tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24" @@ -2524,6 +2693,7 @@ pub struct UpdatePayload { } /// Nested message and enum types in `UpdatePayload`. pub mod update_payload { + /// This field might be extended in future versions of the API. #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Payload { /// The protocol version was updated. @@ -2550,7 +2720,7 @@ pub mod update_payload { /// The gas rewards were updated. #[prost(message, tag = "8")] GasRewardsUpdate(super::GasRewards), - /// The minimum amount of CCD needed to be come a baker was updated. + /// The minimum amount of CCD needed to be come a validator was updated. #[prost(message, tag = "9")] BakerStakeThresholdUpdate(super::BakerStakeThreshold), /// The root keys were updated. @@ -2660,6 +2830,8 @@ pub struct BlockItemSummary { #[prost(message, optional, tag = "3")] pub hash: ::core::option::Option, /// Details that are specific to different transaction types. + /// + /// This field might be extended in future versions of the API. #[prost(oneof = "block_item_summary::Details", tags = "4, 5, 6, 7")] pub details: ::core::option::Option, } @@ -2671,6 +2843,8 @@ pub mod block_item_summary { pub value: u64, } /// Details that are specific to different transaction types. + /// + /// This field might be extended in future versions of the API. #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Details { /// Details about an account transaction. @@ -2868,7 +3042,7 @@ pub struct BlockInfo { /// The time of the slot in which the block was baked. #[prost(message, optional, tag = "10")] pub slot_time: ::core::option::Option, - /// The baker id of account baking this block. Not provided for a genesis block. + /// The validator id of the account producing this block. Not provided for a genesis block. #[prost(message, optional, tag = "11")] pub baker: ::core::option::Option, /// Whether the block is finalized. @@ -2902,22 +3076,24 @@ pub struct PoolInfoRequest { /// Block in which to query the pool information. #[prost(message, optional, tag = "1")] pub block_hash: ::core::option::Option, - /// The 'BakerId' of the pool owner. + /// The validator id of the pool owner. #[prost(message, optional, tag = "2")] pub baker: ::core::option::Option, } -/// A pending change to a baker pool. +/// A pending change to a validator pool. #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct PoolPendingChange { + /// This field will not be extended in future versions of the API, since it is not used starting + /// from Concordium Protocol Version 7. #[prost(oneof = "pool_pending_change::Change", tags = "1, 2")] pub change: ::core::option::Option, } /// Nested message and enum types in `PoolPendingChange`. pub mod pool_pending_change { - /// A reduction in baker equity capital is pending. + /// A reduction in validator equity capital is pending. #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Reduce { - /// New baker equity capital. + /// New validator equity capital. #[prost(message, optional, tag = "1")] pub reduced_equity_capital: ::core::option::Option, /// Timestamp when the change takes effect. @@ -2931,6 +3107,8 @@ pub mod pool_pending_change { #[prost(message, optional, tag = "1")] pub effective_time: ::core::option::Option, } + /// This field will not be extended in future versions of the API, since it is not used starting + /// from Concordium Protocol Version 7. #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum Change { #[prost(message, tag = "1")] @@ -2939,25 +3117,25 @@ pub mod pool_pending_change { Remove(Remove), } } -/// Information about a baker pool in the current reward period. +/// Information about a validator pool in the current reward period. #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct PoolCurrentPaydayInfo { /// The number of blocks baked in the current reward period. #[prost(uint64, tag = "1")] pub blocks_baked: u64, - /// Whether the baker has contributed a finalization proof in the current reward period. + /// Whether the validator has contributed a finalization proof in the current reward period. #[prost(bool, tag = "2")] pub finalization_live: bool, /// The transaction fees accruing to the pool in the current reward period. #[prost(message, optional, tag = "3")] pub transaction_fees_earned: ::core::option::Option, - /// The effective stake of the baker in the current reward period. + /// The effective stake of the validator in the current reward period. #[prost(message, optional, tag = "4")] pub effective_stake: ::core::option::Option, - /// The lottery power of the baker in the current reward period. + /// The lottery power of the validator in the current reward period. #[prost(double, tag = "5")] pub lottery_power: f64, - /// The effective equity capital of the baker for the current reward period. + /// The effective equity capital of the validator for the current reward period. #[prost(message, optional, tag = "6")] pub baker_equity_capital: ::core::option::Option, /// The effective delegated capital to the pool for the current reward period. @@ -2985,7 +3163,7 @@ pub struct PoolCurrentPaydayInfo { /// will also be absent, as stake changes are immediate. #[derive(Clone, PartialEq, ::prost::Message)] pub struct PoolInfoResponse { - /// The 'BakerId' of the pool owner. + /// The validator id of the pool owner. #[prost(message, optional, tag = "1")] pub baker: ::core::option::Option, /// The account address of the pool owner. @@ -2997,8 +3175,21 @@ pub struct PoolInfoResponse { /// The capital delegated to the pool by other accounts. Absent if the pool is removed. #[prost(message, optional, tag = "4")] pub delegated_capital: ::core::option::Option, - /// The maximum amount that may be delegated to the pool, accounting for leverage and stake limits. + /// The maximum amount that may be delegated to the pool, accounting for leverage and capital bounds. /// Absent if the pool is removed. + /// + /// leverage_bound_cap for pool p: Lₚ = λ * Cₚ - Cₚ = (λ - 1) * Cₚ + /// capital_bound_cap for pool p: Bₚ = max (0, floor( (κ * (T - Dₚ) - Cₚ) / (1 - K) )) + /// delegated_capital_cap for pool p = min (Lₚ, Bₚ) + /// + /// Where + /// κ is the `CapitalBound`. + /// λ is the `LeverageFactor`. + /// T is the total staked capital on the whole chain (including passive + /// delegation). + /// Dₚ is the delegated capital of pool p. + /// Cₚ is the equity capital (staked by the pool owner excluding delegated stake + /// to the pool) of pool p. #[prost(message, optional, tag = "5")] pub delegated_capital_cap: ::core::option::Option, /// The pool info associated with the pool: open status, metadata URL and commission rates. @@ -3016,7 +3207,7 @@ pub struct PoolInfoResponse { #[prost(message, optional, tag = "9")] pub all_pool_total_capital: ::core::option::Option, /// A flag indicating whether the pool owner is suspended. - /// Absent if the protocol version does not support validator suspension or the pool is removed. + /// Absent if the protocol version does not support validator suspension (meaning prior protocol version 8) or the pool is removed. #[prost(bool, optional, tag = "10")] pub is_suspended: ::core::option::Option, } @@ -3043,6 +3234,7 @@ pub struct PassiveDelegationInfo { /// Request for GetBlocksAtHeight. #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct BlocksAtHeightRequest { + /// This field might be extended in future versions of the API. #[prost(oneof = "blocks_at_height_request::BlocksAtHeight", tags = "1, 2")] pub blocks_at_height: ::core::option::Option< blocks_at_height_request::BlocksAtHeight, @@ -3071,6 +3263,7 @@ pub mod blocks_at_height_request { #[prost(bool, tag = "3")] pub restrict: bool, } + /// This field might be extended in future versions of the API. #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum BlocksAtHeight { #[prost(message, tag = "1")] @@ -3090,6 +3283,8 @@ pub struct BlocksAtHeightResponse { /// Contains information related to tokenomics at the end of a given block. #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct TokenomicsInfo { + /// This field will not be extended in future versions of the API, instead new data versions will + /// use optional fields in `TokenomicsInfo.V1`. #[prost(oneof = "tokenomics_info::Tokenomics", tags = "1, 2")] pub tokenomics: ::core::option::Option, } @@ -3104,7 +3299,7 @@ pub mod tokenomics_info { /// The total CCD in encrypted balances. #[prost(message, optional, tag = "2")] pub total_encrypted_amount: ::core::option::Option, - /// The amount in the baking reward account. + /// The amount in the block production reward account. #[prost(message, optional, tag = "3")] pub baking_reward_account: ::core::option::Option, /// The amount in the finalization reward account. @@ -3126,7 +3321,7 @@ pub mod tokenomics_info { /// The total CCD in encrypted balances. #[prost(message, optional, tag = "2")] pub total_encrypted_amount: ::core::option::Option, - /// The amount in the baking reward account. + /// The amount in the block production reward account. #[prost(message, optional, tag = "3")] pub baking_reward_account: ::core::option::Option, /// The amount in the finalization reward account. @@ -3144,13 +3339,15 @@ pub mod tokenomics_info { /// The rate at which CCD will be minted (as a proportion of the total supply) at the next payday. #[prost(message, optional, tag = "8")] pub next_payday_mint_rate: ::core::option::Option, - /// The total capital put up as stake by bakers and delegators. + /// The total capital put up as stake by validators and delegators. #[prost(message, optional, tag = "9")] pub total_staked_capital: ::core::option::Option, /// The protocol version. #[prost(enumeration = "super::ProtocolVersion", tag = "10")] pub protocol_version: i32, } + /// This field will not be extended in future versions of the API, instead new data versions will + /// use optional fields in `TokenomicsInfo.V1`. #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum Tokenomics { #[prost(message, tag = "1")] @@ -3192,6 +3389,7 @@ pub struct InvokeInstanceRequest { /// Response type for InvokeInstance. #[derive(Clone, PartialEq, ::prost::Message)] pub struct InvokeInstanceResponse { + /// This field might be extended in future versions of the API. #[prost(oneof = "invoke_instance_response::Result", tags = "1, 2")] pub result: ::core::option::Option, } @@ -3227,6 +3425,7 @@ pub mod invoke_instance_response { #[prost(message, repeated, tag = "3")] pub effects: ::prost::alloc::vec::Vec, } + /// This field might be extended in future versions of the API. #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Result { #[prost(message, tag = "1")] @@ -3241,7 +3440,7 @@ pub struct GetPoolDelegatorsRequest { /// Block in which to query the delegators. #[prost(message, optional, tag = "1")] pub block_hash: ::core::option::Option, - /// The 'BakerId' of the pool owner. + /// The validator id of the pool owner. #[prost(message, optional, tag = "2")] pub baker: ::core::option::Option, } @@ -3279,7 +3478,7 @@ pub struct Branch { pub children: ::prost::alloc::vec::Vec, } /// The leadership election nonce is an unpredictable value updated once an -/// epoch to make sure that bakers cannot predict too far in the future when +/// epoch to make sure that validators cannot predict too far in the future when /// they will win the right to bake blocks. #[derive(Clone, PartialEq, ::prost::Message)] pub struct LeadershipElectionNonce { @@ -3287,16 +3486,18 @@ pub struct LeadershipElectionNonce { pub value: ::prost::alloc::vec::Vec, } /// Response type for GetElectionInfo. -/// Contains information related to baker election for a perticular block. +/// Contains information related to validator election for a perticular block. +/// The `ElectionInfo` will be the same for all blocks in the same epoch. +/// Moreover, from protocol version 4, it is the same for all blocks in the same payday. #[derive(Clone, PartialEq, ::prost::Message)] pub struct ElectionInfo { - /// Baking lottery election difficulty. Present only in protocol versions 1-5. + /// Block production lottery election difficulty. Present only in protocol versions 1-5. #[prost(message, optional, tag = "1")] pub election_difficulty: ::core::option::Option, /// Current leadership election nonce for the lottery. #[prost(message, optional, tag = "2")] pub election_nonce: ::core::option::Option, - /// List of the currently eligible bakers. + /// List of the currently eligible validators. #[prost(message, repeated, tag = "3")] pub baker_election_info: ::prost::alloc::vec::Vec, } @@ -3304,21 +3505,22 @@ pub struct ElectionInfo { pub mod election_info { #[derive(Clone, PartialEq, ::prost::Message)] pub struct Baker { - /// The ID of the baker. + /// The ID of the validator. #[prost(message, optional, tag = "1")] pub baker: ::core::option::Option, - /// The account address of the baker. + /// The account address of the validator. #[prost(message, optional, tag = "2")] pub account: ::core::option::Option, - /// The lottery power of the baker, rounded to the nearest representable "double". + /// The lottery power of the validator, rounded to the nearest representable "double". #[prost(double, tag = "3")] pub lottery_power: f64, } } /// A protocol generated event that is not directly caused by a transaction. This -/// includes minting new CCD, rewarding different bakers and delegators, etc. +/// includes minting new CCD, rewarding different validators and delegators, etc. #[derive(Clone, PartialEq, ::prost::Message)] pub struct BlockSpecialEvent { + /// This field might be extended in future versions of the API. #[prost( oneof = "block_special_event::Event", tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10" @@ -3346,18 +3548,21 @@ pub mod block_special_event { pub amount: ::core::option::Option, } } - /// Payment to each baker of a previous epoch, in proportion to the number - /// of blocks they contributed. + /// Rewards issued to each validator at the end of an epoch for producing blocks in the epoch, + /// in proportion to the number of blocks they contributed. This only occurs in protocol versions + /// 1 to 3. From protocol version 4, it is replaced by `PaydayPoolReward` and `PaydayAccountReward` messages. #[derive(Clone, PartialEq, ::prost::Message)] pub struct BakingRewards { - /// The amount awarded to each baker. + /// The amount awarded to each validator. #[prost(message, optional, tag = "1")] pub baker_rewards: ::core::option::Option, - /// The remaining balance of the baker reward account. + /// The remaining balance of the validator reward account. #[prost(message, optional, tag = "2")] pub remainder: ::core::option::Option, } - /// Minting of new CCD. + /// Minting of new CCDs. + /// Starting from protocol version 4, this event occurs only in each payday block. + /// Before protocol version 4, this event occured every block (slot). #[derive(Clone, PartialEq, ::prost::Message)] pub struct Mint { /// The amount allocated to the banking reward account. @@ -3384,7 +3589,7 @@ pub mod block_special_event { pub remainder: ::core::option::Option, } /// Disbursement of fees from a block between the GAS account, - /// the baker, and the foundation. It should always be that: + /// the validator, and the foundation. It should always be that: /// /// ```transaction_fees + old_gas_account = new_gas_account + baker_reward + foundation_charge``` #[derive(Clone, PartialEq, ::prost::Message)] @@ -3398,20 +3603,20 @@ pub mod block_special_event { /// The new balance of the GAS account. #[prost(message, optional, tag = "3")] pub new_gas_account: ::core::option::Option, - /// The amount awarded to the baker. + /// The amount awarded to the validator. #[prost(message, optional, tag = "4")] pub baker_reward: ::core::option::Option, /// The amount awarded to the foundation. #[prost(message, optional, tag = "5")] pub foundation_charge: ::core::option::Option, - /// The baker of the block, who receives the award. + /// The validator of the block, who receives the award. #[prost(message, optional, tag = "6")] pub baker: ::core::option::Option, /// The foundation account. #[prost(message, optional, tag = "7")] pub foundation_account: ::core::option::Option, } - /// Foundation tax. + /// Foundation tax paid at a payday block starting from protocol version 4. #[derive(Clone, PartialEq, ::prost::Message)] pub struct PaydayFoundationReward { /// The account that got rewarded. @@ -3421,7 +3626,20 @@ pub mod block_special_event { #[prost(message, optional, tag = "2")] pub development_charge: ::core::option::Option, } - /// Reward payment to the given account. + /// Reward payment to the given account at a payday block starting from protocol version 4. + /// When listed in a block summary, the delegated pool of the account is + /// given by the last `PaydayPoolReward` outcome included before this outcome. + /// + /// For example: + /// PaydayPoolReward to pool 1 + /// PaydayAccountReward to account 5 + /// PaydayAccountReward to account 6 + /// PaydayAccountReward to account 1 (is the payout to the validator itself) + /// PaydayPoolReward to `None` + /// PaydayAccountReward to account 10 + /// PaydayAccountReward to account 3 + /// Means 5, 6 are receiving rewards from delegating to validator 1 and 10, 3 are receiving rewards from passive + /// delegation. #[derive(Clone, PartialEq, ::prost::Message)] pub struct PaydayAccountReward { /// The account that got rewarded. @@ -3430,7 +3648,7 @@ pub mod block_special_event { /// The transaction fee reward at payday to the account. #[prost(message, optional, tag = "2")] pub transaction_fees: ::core::option::Option, - /// The baking reward at payday to the account. + /// The block production reward at payday to the account. #[prost(message, optional, tag = "3")] pub baker_reward: ::core::option::Option, /// The finalization reward at payday to the account. @@ -3449,7 +3667,7 @@ pub mod block_special_event { /// The new balance of the GAS account. #[prost(message, optional, tag = "3")] pub new_gas_account: ::core::option::Option, - /// The amount awarded to the baker. + /// The amount awarded to the validator. #[prost(message, optional, tag = "4")] pub baker_reward: ::core::option::Option, /// The amount awarded to the passive delegators. @@ -3458,11 +3676,24 @@ pub mod block_special_event { /// The amount awarded to the foundation. #[prost(message, optional, tag = "6")] pub foundation_charge: ::core::option::Option, - /// The baker of the block, who will receive the award. + /// The validator of the block, who will receive the award. #[prost(message, optional, tag = "7")] pub baker: ::core::option::Option, } - /// Payment distributed to a pool or passive delegators. + /// Payment distributed to a pool or passive delegators at a payday block starting from protocol version 4. + /// When listed in a block summary, the reward distribution to the delagtors of the given pool is + /// given by the following `PaydayAccountReward` outcomes included after this outcome. + /// + /// For example: + /// PaydayPoolReward to pool 1 + /// PaydayAccountReward to account 5 + /// PaydayAccountReward to account 6 + /// PaydayAccountReward to account 1 (is the payout to the validator itself) + /// PaydayPoolReward to `None` + /// PaydayAccountReward to account 10 + /// PaydayAccountReward to account 3 + /// Means 5, 6 are receiving rewards from delegating to validator 1 and 10, 3 are receiving rewards from passive + /// delegation. #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct PaydayPoolReward { /// The pool owner (passive delegators when not present). @@ -3471,7 +3702,7 @@ pub mod block_special_event { /// Accrued transaction fees for pool. #[prost(message, optional, tag = "2")] pub transaction_fees: ::core::option::Option, - /// Accrued baking rewards for pool. + /// Accrued block production rewards for pool. #[prost(message, optional, tag = "3")] pub baker_reward: ::core::option::Option, /// Accrued finalization rewards for pool. @@ -3479,6 +3710,7 @@ pub mod block_special_event { pub finalization_reward: ::core::option::Option, } /// The id of a validator that got suspended due to too many missed rounds. + /// The message can occur starting from protocol version 8. #[derive(Clone, PartialEq, ::prost::Message)] pub struct ValidatorSuspended { /// The id of the suspended validator. @@ -3490,6 +3722,7 @@ pub mod block_special_event { } /// The id of a validator that is primed for suspension at the next snapshot /// epoch due to too many missed rounds. + /// The message can occur starting from protocol version 8. #[derive(Clone, PartialEq, ::prost::Message)] pub struct ValidatorPrimedForSuspension { /// The id of the primed validator. @@ -3499,26 +3732,46 @@ pub mod block_special_event { #[prost(message, optional, tag = "2")] pub account: ::core::option::Option, } + /// This field might be extended in future versions of the API. #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Event { + /// Rewards issued to each validator at the end of an epoch for producing blocks in the epoch, + /// in proportion to the number of blocks they contributed. This only occurs in protocol versions + /// 1 to 3. From protocol version 4, it is replaced by `PaydayPoolReward` and `PaydayAccountReward` messages. #[prost(message, tag = "1")] BakingRewards(BakingRewards), + /// Minting of new CCDs. + /// Starting from protocol version 4, this event occurs in each payday block. + /// Before protocol version 4, this event occured every block (slot). #[prost(message, tag = "2")] Mint(Mint), #[prost(message, tag = "3")] FinalizationRewards(FinalizationRewards), #[prost(message, tag = "4")] BlockReward(BlockReward), + /// Foundation rewards paid out at a payday block starting from protocol version 4. #[prost(message, tag = "5")] PaydayFoundationReward(PaydayFoundationReward), + /// Reward payment to the given account at a payday block (from passive deleagtion or delegation to a validator or being a validator) starting from protocol version 4. + /// When listed in a block summary, the delegated pool of the account is + /// given by the last `PaydayPoolReward` outcome included before this outcome. #[prost(message, tag = "6")] PaydayAccountReward(PaydayAccountReward), #[prost(message, tag = "7")] BlockAccrueReward(BlockAccrueReward), + /// Payment distributed to a pool or passive delegators at a payday block starting from protocol version 4. + /// When listed in a block summary, the reward distribution to the delagtors of the given pool is + /// given by the following `PaydayAccountReward` outcomes included after this outcome. #[prost(message, tag = "8")] PaydayPoolReward(PaydayPoolReward), + /// The protocol suspends validators due to inactivity. + /// If the validator is suspended by a transaction sent from the validator itself, the `BakerEvent::BakerSuspended` + /// event is emitted instead of this event. + /// The event can occur starting from protocol version 8. #[prost(message, tag = "9")] ValidatorSuspended(ValidatorSuspended), + /// The protocol primes validators for suspension due to inactivity. + /// The event can occur starting from protocol version 8. #[prost(message, tag = "10")] ValidatorPrimedForSuspension(ValidatorPrimedForSuspension), } @@ -3530,6 +3783,8 @@ pub struct PendingUpdate { #[prost(message, optional, tag = "1")] pub effective_time: ::core::option::Option, /// The effect of the update. + /// + /// This field might be extended in future versions of the API. #[prost( oneof = "pending_update::Effect", tags = "2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26" @@ -3539,6 +3794,8 @@ pub struct PendingUpdate { /// Nested message and enum types in `PendingUpdate`. pub mod pending_update { /// The effect of the update. + /// + /// This field might be extended in future versions of the API. #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Effect { /// Updates to the root keys. @@ -3580,7 +3837,7 @@ pub mod pending_update { /// Updates to the GAS rewards. #[prost(message, tag = "14")] GasRewards(super::GasRewards), - /// Updates baker stake threshold. Is only relevant prior to protocol version 4. + /// Updates validator stake threshold. Is only relevant prior to protocol version 4. #[prost(message, tag = "15")] PoolParametersCpv0(super::BakerStakeThreshold), /// Updates pool parameters. Introduced in protocol version 4. @@ -3730,8 +3987,7 @@ pub struct BannedPeer { #[prost(message, optional, tag = "1")] pub ip_address: ::core::option::Option, } -/// The banned peers given by -/// their IP addresses. +/// The banned peers given by their IP addresses. #[derive(Clone, PartialEq, ::prost::Message)] pub struct BannedPeers { #[prost(message, repeated, tag = "1")] @@ -3777,7 +4033,9 @@ pub mod peers_info { /// Network related statistics for the peer. #[prost(message, optional, tag = "3")] pub network_stats: ::core::option::Option, - /// consensus related information of the peer. + /// Consensus related information of the peer. + /// + /// This field might be extended in future versions of the API. #[prost(oneof = "peer::ConsensusInfo", tags = "4, 5")] pub consensus_info: ::core::option::Option, } @@ -3800,6 +4058,7 @@ pub mod peers_info { #[prost(uint64, tag = "4")] pub latency: u64, } + /// This type might be extended in future versions of the API. #[derive( Clone, Copy, @@ -3850,7 +4109,9 @@ pub mod peers_info { } } } - /// consensus related information of the peer. + /// Consensus related information of the peer. + /// + /// This field might be extended in future versions of the API. #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum ConsensusInfo { /// The peer is of type `Bootstrapper` is not participating in consensus @@ -3883,6 +4144,8 @@ pub struct NodeInfo { #[prost(message, optional, tag = "5")] pub network_info: ::core::option::Option, /// Details of the node. + /// + /// This field might be extended in future versions of the API. #[prost(oneof = "node_info::Details", tags = "6, 7")] pub details: ::core::option::Option, } @@ -3907,30 +4170,34 @@ pub mod node_info { #[prost(uint64, tag = "5")] pub avg_bps_out: u64, } - /// Consensus info for a node configured with baker keys. + /// Consensus info for a node configured with validator keys. #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct BakerConsensusInfo { #[prost(message, optional, tag = "1")] pub baker_id: ::core::option::Option, - /// Status of the baker configured node. + /// Status of the validator configured node. + /// + /// This field might be extended in future versions of the API. #[prost(oneof = "baker_consensus_info::Status", tags = "2, 3, 4")] pub status: ::core::option::Option, } /// Nested message and enum types in `BakerConsensusInfo`. pub mod baker_consensus_info { /// Tagging message type for a node that - /// is configured with baker keys and active in - /// the current baking committee + /// is configured with validator keys and active in + /// the current validation committee #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct ActiveBakerCommitteeInfo {} /// Tagging message type for a node that - /// is configured with baker keys and active in - /// the current finalizer committee (and also baking committee). + /// is configured with validator keys and active in + /// the current finalizer committee (and also validation committee). #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct ActiveFinalizerCommitteeInfo {} /// The committee information of a node configured with - /// baker keys but somehow the node is _not_ part of the - /// current baking committee. + /// validator keys but somehow the node is _not_ part of the + /// current validation committee. + /// + /// This type might be extended in future versions of the API. #[derive( Clone, Copy, @@ -3944,14 +4211,14 @@ pub mod node_info { )] #[repr(i32)] pub enum PassiveCommitteeInfo { - /// The node is started with baker keys however it is currently not in the baking committee. + /// The node is started with validator keys however it is currently not in the validation committee. /// The node is __not__ baking. NotInCommittee = 0, - /// The account is registered as a baker but not in the current `Epoch`. + /// The account is registered as a validator but not in the current `Epoch`. /// The node is __not__ baking. AddedButNotActiveInCommittee = 1, - /// The node has configured invalid baker keys i.e., the configured - /// baker keys do not match the current keys on the baker account. + /// The node has configured invalid validator keys i.e., the configured + /// validator keys do not match the current keys on the validator account. /// The node is __not__ baking. AddedButWrongKeys = 2, } @@ -3981,18 +4248,20 @@ pub mod node_info { } } } - /// Status of the baker configured node. + /// Status of the validator configured node. + /// + /// This field might be extended in future versions of the API. #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum Status { /// The node is currently not baking. #[prost(enumeration = "PassiveCommitteeInfo", tag = "2")] PassiveCommitteeInfo(i32), - /// The node is configured with baker keys and - /// is member of the baking committee. + /// The node is configured with validator keys and + /// is member of the validation committee. #[prost(message, tag = "3")] ActiveBakerCommitteeInfo(ActiveBakerCommitteeInfo), - /// The node is configured with baker keys and - /// is member of the baking and finalization committees. + /// The node is configured with validator keys and + /// is member of the validator and finalization committees. #[prost(message, tag = "4")] ActiveFinalizerCommitteeInfo(ActiveFinalizerCommitteeInfo), } @@ -4000,11 +4269,13 @@ pub mod node_info { /// The node is a regular node. #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct Node { + /// This field might be extended in future versions of the API. #[prost(oneof = "node::ConsensusStatus", tags = "1, 2, 3")] pub consensus_status: ::core::option::Option, } /// Nested message and enum types in `Node`. pub mod node { + /// This field might be extended in future versions of the API. #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum ConsensusStatus { /// The node is not running consensus. @@ -4014,18 +4285,20 @@ pub mod node_info { #[prost(message, tag = "1")] NotRunning(super::super::Empty), /// Consensus info for a node that is - /// not configured with baker keys. + /// not configured with validator keys. /// The node is only processing blocks and /// relaying blocks and transactions and responding to /// catchup messages. #[prost(message, tag = "2")] Passive(super::super::Empty), - /// The node is configured with baker credentials and consensus is running. + /// The node is configured with validator credentials and consensus is running. #[prost(message, tag = "3")] Active(super::BakerConsensusInfo), } } /// Details of the node. + /// + /// This field might be extended in future versions of the API. #[derive(Clone, Copy, PartialEq, ::prost::Oneof)] pub enum Details { /// The node is a bootstrapper and is not running consensus. @@ -4039,18 +4312,20 @@ pub mod node_info { } #[derive(Clone, PartialEq, ::prost::Message)] pub struct SendBlockItemRequest { + /// This field might be extended in future versions of the API. #[prost(oneof = "send_block_item_request::BlockItem", tags = "1, 2, 3")] pub block_item: ::core::option::Option, } /// Nested message and enum types in `SendBlockItemRequest`. pub mod send_block_item_request { + /// This field might be extended in future versions of the API. #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum BlockItem { /// Account transactions are messages which are signed and paid for by an account. #[prost(message, tag = "1")] AccountTransaction(super::AccountTransaction), /// Credential deployments create new accounts. They are not paid for - /// directly by the sender. Instead, bakers are rewarded by the protocol for + /// directly by the sender. Instead, validators are rewarded by the protocol for /// including them. #[prost(message, tag = "2")] CredentialDeployment(super::CredentialDeployment), @@ -4061,19 +4336,25 @@ pub mod send_block_item_request { } } /// Credential deployments create new accounts. They are not paid for -/// directly by the sender. Instead, bakers are rewarded by the protocol for +/// directly by the sender. Instead, validators are rewarded by the protocol for /// including them. #[derive(Clone, PartialEq, ::prost::Message)] pub struct CredentialDeployment { #[prost(message, optional, tag = "1")] pub message_expiry: ::core::option::Option, /// The credential to be added. + /// + /// This field will not be extended in future versions of the API and the Concordium Node API will + /// always output the `raw_payload` in queries. #[prost(oneof = "credential_deployment::Payload", tags = "2")] pub payload: ::core::option::Option, } /// Nested message and enum types in `CredentialDeployment`. pub mod credential_deployment { /// The credential to be added. + /// + /// This field will not be extended in future versions of the API and the Concordium Node API will + /// always output the `raw_payload` in queries. #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Payload { /// A raw payload, which is just the encoded payload. @@ -4174,6 +4455,7 @@ pub struct TransferPayload { pub receiver: ::core::option::Option, } /// Payload of a transfer between two accounts with a memo. +/// This message can occur starting from protocol version 2. #[derive(Clone, PartialEq, ::prost::Message)] pub struct TransferWithMemoPayload { /// Amount of CCD to send. @@ -4189,6 +4471,8 @@ pub struct TransferWithMemoPayload { /// The payload for an account transaction. #[derive(Clone, PartialEq, ::prost::Message)] pub struct AccountTransactionPayload { + /// This field will not be extended in future versions of the API and the Concordium Node API will + /// always output the `raw_payload` in queries. #[prost( oneof = "account_transaction_payload::Payload", tags = "1, 2, 3, 4, 5, 6, 7" @@ -4197,13 +4481,14 @@ pub struct AccountTransactionPayload { } /// Nested message and enum types in `AccountTransactionPayload`. pub mod account_transaction_payload { + /// This field will not be extended in future versions of the API and the Concordium Node API will + /// always output the `raw_payload` in queries. #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Payload { /// A pre-serialized payload in the binary serialization format defined /// by the protocol. #[prost(bytes, tag = "1")] RawPayload(::prost::alloc::vec::Vec), - /// A transfer between two accounts. With an optional memo. #[prost(message, tag = "2")] DeployModule(super::VersionedModuleSource), #[prost(message, tag = "3")] @@ -4212,6 +4497,7 @@ pub mod account_transaction_payload { UpdateContract(super::UpdateContractPayload), #[prost(message, tag = "5")] Transfer(super::TransferPayload), + /// This payload can occur starting from protocol version 2. #[prost(message, tag = "6")] TransferWithMemo(super::TransferWithMemoPayload), #[prost(message, tag = "7")] @@ -4250,11 +4536,13 @@ pub struct UpdateInstructionHeader { /// The payload for an UpdateInstruction. #[derive(Clone, PartialEq, ::prost::Message)] pub struct UpdateInstructionPayload { + /// This field might be extended in future versions of the API. #[prost(oneof = "update_instruction_payload::Payload", tags = "3")] pub payload: ::core::option::Option, } /// Nested message and enum types in `UpdateInstructionPayload`. pub mod update_instruction_payload { + /// This field might be extended in future versions of the API. #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Payload { /// A raw payload encoded according to the format defined by the protocol. @@ -4298,7 +4586,7 @@ pub struct ChainParametersV0 { /// Micro CCD per euro exchange rate. #[prost(message, optional, tag = "3")] pub micro_ccd_per_euro: ::core::option::Option, - /// Extra number of epochs before reduction in stake, or baker + /// Extra number of epochs before reduction in stake, or validator /// deregistration is completed. #[prost(message, optional, tag = "4")] pub baker_cooldown_epochs: ::core::option::Option, @@ -4317,7 +4605,7 @@ pub struct ChainParametersV0 { /// The foundation account. #[prost(message, optional, tag = "9")] pub foundation_account: ::core::option::Option, - /// Minimum threshold for becoming a baker. + /// Minimum threshold for becoming a validator. #[prost(message, optional, tag = "10")] pub minimum_threshold_for_baking: ::core::option::Option, /// Keys allowed to do root updates. @@ -4342,7 +4630,7 @@ pub struct ChainParametersV1 { /// Micro CCD per euro exchange rate. #[prost(message, optional, tag = "3")] pub micro_ccd_per_euro: ::core::option::Option, - /// Extra number of epochs before reduction in stake, or baker + /// Extra number of epochs before reduction in stake, or validator /// deregistration is completed. #[prost(message, optional, tag = "4")] pub cooldown_parameters: ::core::option::Option, @@ -4366,7 +4654,7 @@ pub struct ChainParametersV1 { /// The foundation account. #[prost(message, optional, tag = "10")] pub foundation_account: ::core::option::Option, - /// Parameters governing baking pools and their commissions. + /// Parameters governing validator pools and their commissions. #[prost(message, optional, tag = "11")] pub pool_parameters: ::core::option::Option, /// Keys allowed to do root updates. @@ -4391,7 +4679,7 @@ pub struct ChainParametersV2 { /// Micro CCD per euro exchange rate. #[prost(message, optional, tag = "3")] pub micro_ccd_per_euro: ::core::option::Option, - /// Extra number of epochs before reduction in stake, or baker + /// Extra number of epochs before reduction in stake, or validator /// deregistration is completed. #[prost(message, optional, tag = "4")] pub cooldown_parameters: ::core::option::Option, @@ -4415,7 +4703,7 @@ pub struct ChainParametersV2 { /// The foundation account. #[prost(message, optional, tag = "10")] pub foundation_account: ::core::option::Option, - /// Parameters governing baking pools and their commissions. + /// Parameters governing validator pools and their commissions. #[prost(message, optional, tag = "11")] pub pool_parameters: ::core::option::Option, /// Keys allowed to do root updates. @@ -4445,7 +4733,7 @@ pub struct ChainParametersV3 { /// Micro CCD per euro exchange rate. #[prost(message, optional, tag = "3")] pub micro_ccd_per_euro: ::core::option::Option, - /// Extra number of epochs before reduction in stake, or baker + /// Extra number of epochs before reduction in stake, or validator /// deregistration is completed. #[prost(message, optional, tag = "4")] pub cooldown_parameters: ::core::option::Option, @@ -4469,7 +4757,7 @@ pub struct ChainParametersV3 { /// The foundation account. #[prost(message, optional, tag = "10")] pub foundation_account: ::core::option::Option, - /// Parameters governing baking pools and their commissions. + /// Parameters governing validator pools and their commissions. #[prost(message, optional, tag = "11")] pub pool_parameters: ::core::option::Option, /// Keys allowed to do root updates. @@ -4493,11 +4781,15 @@ pub struct ChainParametersV3 { /// Chain parameters. #[derive(Clone, PartialEq, ::prost::Message)] pub struct ChainParameters { + /// This field will not be extended in future versions of the API, instead new data versions will + /// use optional fields in `ChainParametersV3`. #[prost(oneof = "chain_parameters::Parameters", tags = "1, 2, 3, 4")] pub parameters: ::core::option::Option, } /// Nested message and enum types in `ChainParameters`. pub mod chain_parameters { + /// This field will not be extended in future versions of the API, instead new data versions will + /// use optional fields in `ChainParametersV3`. #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Parameters { /// Chain parameters that apply when the block is a protocol version 1-3 block. @@ -4517,7 +4809,7 @@ pub mod chain_parameters { /// Details about a finalizer for the finalization round. #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct FinalizationSummaryParty { - /// Baker ID. Every finalizer is in particular a baker. + /// Validator ID. Every finalizer is in particular a validator. #[prost(message, optional, tag = "1")] pub baker: ::core::option::Option, /// The weight of the finalizer in the committee. This is an "absolute" weight. @@ -4554,11 +4846,13 @@ pub struct FinalizationSummary { /// Finalization summary that may or may not be part of the block. #[derive(Clone, PartialEq, ::prost::Message)] pub struct BlockFinalizationSummary { + /// This field will not be extended in future versions of the API. #[prost(oneof = "block_finalization_summary::Summary", tags = "1, 2")] pub summary: ::core::option::Option, } /// Nested message and enum types in `BlockFinalizationSummary`. pub mod block_finalization_summary { + /// This field will not be extended in future versions of the API. #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Summary { /// There is no finalization data in the block. @@ -4574,18 +4868,20 @@ pub struct BlockItem { /// The hash of the block item that identifies it to the chain. #[prost(message, optional, tag = "1")] pub hash: ::core::option::Option, + /// This field might be extended in future versions of the API. #[prost(oneof = "block_item::BlockItem", tags = "2, 3, 4")] pub block_item: ::core::option::Option, } /// Nested message and enum types in `BlockItem`. pub mod block_item { + /// This field might be extended in future versions of the API. #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum BlockItem { /// Account transactions are messages which are signed and paid for by an account. #[prost(message, tag = "2")] AccountTransaction(super::AccountTransaction), /// Credential deployments create new accounts. They are not paid for - /// directly by the sender. Instead, bakers are rewarded by the protocol for + /// directly by the sender. Instead, validators are rewarded by the protocol for /// including them. #[prost(message, tag = "3")] CredentialDeployment(super::CredentialDeployment), @@ -4595,27 +4891,27 @@ pub mod block_item { UpdateInstruction(super::UpdateInstruction), } } -/// Information about a particular baker with respect to -/// the current reward period. +/// Information about a particular validator with respect to +/// the current reward period. The below values are historical value from the last payday block. #[derive(Clone, PartialEq, ::prost::Message)] pub struct BakerRewardPeriodInfo { - /// The baker id and public keys for the baker. + /// The validator id and public keys for the validator. #[prost(message, optional, tag = "1")] pub baker: ::core::option::Option, - /// The effective stake of the baker for the consensus protocol. + /// The effective stake of the validator for the consensus protocol. /// The returned amount accounts for delegation, capital bounds and leverage bounds. #[prost(message, optional, tag = "2")] pub effective_stake: ::core::option::Option, - /// The effective commission rate for the baker that applies for the reward period. + /// The effective commission rate for the validator that applies for the reward period. #[prost(message, optional, tag = "3")] pub commission_rates: ::core::option::Option, - /// The amount staked by the baker itself. + /// The amount staked by the validator itself. #[prost(message, optional, tag = "4")] pub equity_capital: ::core::option::Option, - /// The total amount of capital delegated to this baker pool. + /// The total amount of capital delegated to this validator pool. #[prost(message, optional, tag = "5")] pub delegated_capital: ::core::option::Option, - /// Whether the baker is a finalizer or not. + /// Whether the validator is a finalizer or not. #[prost(bool, tag = "6")] pub is_finalizer: bool, } @@ -4647,20 +4943,20 @@ pub struct QuorumCertificate { pub aggregate_signature: ::core::option::Option, /// A list of the finalizers that formed the quorum certificate /// i.e., the ones who have contributed to the 'aggregate_siganture'. - /// The finalizers are identified by their baker id as this is stable + /// The finalizers are identified by their validator id as this is stable /// across protocols and epochs. #[prost(message, repeated, tag = "5")] pub signatories: ::prost::alloc::vec::Vec, } /// The finalizer round is a map from a 'Round' -/// to the list of finalizers (identified by their 'BakerId') that signed +/// to the list of finalizers (identified by their validator id) that signed /// off the round. #[derive(Clone, PartialEq, ::prost::Message)] pub struct FinalizerRound { /// The round that was signed off. #[prost(message, optional, tag = "1")] pub round: ::core::option::Option, - /// The finalizers (identified by their 'BakerId' that + /// The finalizers (identified by their validator id) that /// signed off the in 'round'. #[prost(message, repeated, tag = "2")] pub finalizers: ::prost::alloc::vec::Vec, @@ -4727,8 +5023,7 @@ pub struct EpochFinalizationEntry { #[prost(message, optional, tag = "3")] pub successor_proof: ::core::option::Option, } -/// Certificates for a block for protocols supporting -/// ConcordiumBFT. +/// Certificates for a block for protocols supporting ConcordiumBFT. #[derive(Clone, PartialEq, ::prost::Message)] pub struct BlockCertificates { /// The quorum certificate. Is present if and only if the block is @@ -4744,16 +5039,16 @@ pub struct BlockCertificates { #[prost(message, optional, tag = "3")] pub epoch_finalization_entry: ::core::option::Option, } -/// Details of which baker won the lottery in a given round in consensus version 1. +/// Details of which validator won the lottery in a given round in consensus version 1. #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct WinningBaker { /// The round number. #[prost(message, optional, tag = "1")] pub round: ::core::option::Option, - /// The baker that won the round. + /// The validator that won the round. #[prost(message, optional, tag = "2")] pub winner: ::core::option::Option, - /// True if the baker produced a block in this round on the finalized chain, and False otherwise. + /// True if the validator produced a block in this round on the finalized chain, and False otherwise. #[prost(bool, tag = "3")] pub present: bool, } @@ -4762,11 +5057,13 @@ pub struct WinningBaker { /// state is successfully loaded. #[derive(Clone, PartialEq, ::prost::Message)] pub struct DryRunRequest { + /// This field might be extended in future versions of the API. #[prost(oneof = "dry_run_request::Request", tags = "1, 2, 3")] pub request: ::core::option::Option, } /// Nested message and enum types in `DryRunRequest`. pub mod dry_run_request { + /// This field might be extended in future versions of the API. #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Request { /// Load the state of the specified block to use for subsequent requests. @@ -4787,11 +5084,13 @@ pub mod dry_run_request { /// Run a query as part of a dry run. Queries do not update the block state. #[derive(Clone, PartialEq, ::prost::Message)] pub struct DryRunStateQuery { + /// This field might be extended in future versions of the API. #[prost(oneof = "dry_run_state_query::Query", tags = "1, 2, 3")] pub query: ::core::option::Option, } /// Nested message and enum types in `DryRunStateQuery`. pub mod dry_run_state_query { + /// This field might be extended in future versions of the API. #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Query { /// Look up information on a particular account. @@ -4842,11 +5141,13 @@ pub struct DryRunInvokeInstance { /// An operation that can update the state as part of a dry run. #[derive(Clone, PartialEq, ::prost::Message)] pub struct DryRunStateOperation { + /// This field might be extended in future versions of the API. #[prost(oneof = "dry_run_state_operation::Operation", tags = "1, 2, 3")] pub operation: ::core::option::Option, } /// Nested message and enum types in `DryRunStateOperation`. pub mod dry_run_state_operation { + /// This field might be extended in future versions of the API. #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Operation { /// Sets the current block time to the given timestamp for the purposes of future @@ -4924,11 +5225,13 @@ pub struct DryRunResponse { /// The remaining available energy quota after the dry run operation. #[prost(message, optional, tag = "3")] pub quota_remaining: ::core::option::Option, + /// This field might be extended in future versions of the API. #[prost(oneof = "dry_run_response::Response", tags = "1, 2")] pub response: ::core::option::Option, } /// Nested message and enum types in `DryRunResponse`. pub mod dry_run_response { + /// This field might be extended in future versions of the API. #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Response { /// The request produced an error. The request otherwise has no effect on the state. @@ -4941,6 +5244,7 @@ pub mod dry_run_response { } #[derive(Clone, PartialEq, ::prost::Message)] pub struct DryRunErrorResponse { + /// This field might be extended in future versions of the API. #[prost(oneof = "dry_run_error_response::Error", tags = "1, 2, 3, 4, 5, 6, 8, 9")] pub error: ::core::option::Option, } @@ -5005,6 +5309,7 @@ pub mod dry_run_error_response { #[prost(message, optional, tag = "3")] pub reason: ::core::option::Option, } + /// This field might be extended in future versions of the API. #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Error { /// The current block state is undefined. It should be initialized with @@ -5044,6 +5349,7 @@ pub mod dry_run_error_response { /// The dry run operation completed successfully. #[derive(Clone, PartialEq, ::prost::Message)] pub struct DryRunSuccessResponse { + /// This field might be extended in future versions of the API. #[prost(oneof = "dry_run_success_response::Response", tags = "1, 2, 3, 4, 5, 6, 7")] pub response: ::core::option::Option, } @@ -5097,6 +5403,7 @@ pub mod dry_run_success_response { #[prost(message, repeated, tag = "3")] pub effects: ::prost::alloc::vec::Vec, } + /// This field might be extended in future versions of the API. #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Response { /// The state from the specified block was successfully loaded. @@ -5336,7 +5643,7 @@ pub struct RoundExistingBlock { /// The round for which the node saw a block. #[prost(message, optional, tag = "1")] pub round: ::core::option::Option, - /// The baker that baked the block. + /// The validator that baked the block. #[prost(message, optional, tag = "2")] pub baker: ::core::option::Option, /// The hash of the block. @@ -5352,22 +5659,22 @@ pub struct RoundExistingQc { #[prost(message, optional, tag = "2")] pub epoch: ::core::option::Option, } -/// The keys an stake of a specific baker. +/// The keys and stake of a specific validator. #[derive(Clone, PartialEq, ::prost::Message)] pub struct FullBakerInfo { - /// The baker's identity. + /// The validator's identity. #[prost(message, optional, tag = "1")] pub baker_identity: ::core::option::Option, - /// The baker's election verify key. + /// The validator's election verify key. #[prost(message, optional, tag = "2")] pub election_verify_key: ::core::option::Option, - /// The baker's signature verify key. + /// The validator's signature verify key. #[prost(message, optional, tag = "3")] pub signature_verify_key: ::core::option::Option, - /// The baker's aggregation verify key. + /// The validator's aggregation verify key. #[prost(message, optional, tag = "4")] pub aggregation_verify_key: ::core::option::Option, - /// The stake of the baker. + /// The stake of the validator. #[prost(message, optional, tag = "5")] pub stake: ::core::option::Option, } @@ -5380,14 +5687,14 @@ pub struct FinalizationCommitteeHash { } #[derive(Clone, PartialEq, ::prost::Message)] pub struct BakersAndFinalizers { - /// The set of bakers. + /// The set of validators. #[prost(message, repeated, tag = "1")] pub bakers: ::prost::alloc::vec::Vec, - /// The IDs of the bakers that are finalizers. + /// The IDs of the validators that are finalizers. /// The order determines the finalizer index. #[prost(message, repeated, tag = "2")] pub finalizers: ::prost::alloc::vec::Vec, - /// The total effective stake of the bakers. + /// The total effective stake of the validators. #[prost(message, optional, tag = "3")] pub baker_total_stake: ::core::option::Option, /// The total effective stake of the finalizers. @@ -5399,16 +5706,16 @@ pub struct BakersAndFinalizers { } #[derive(Clone, PartialEq, ::prost::Message)] pub struct EpochBakers { - /// The bakers and finalizers for the previous epoch. - /// If the current epoch is 0, then this is the same as the bakers for the current epoch. + /// The validators and finalizers for the previous epoch. + /// If the current epoch is 0, then this is the same as the validators for the current epoch. #[prost(message, optional, tag = "1")] pub previous_epoch_bakers: ::core::option::Option, - /// The bakers and finalizers for the current epoch. - /// If this is absent, it should be treated as the same as the bakers for the previous epoch. + /// The validators and finalizers for the current epoch. + /// If this is absent, it should be treated as the same as the validators for the previous epoch. #[prost(message, optional, tag = "2")] pub current_epoch_bakers: ::core::option::Option, - /// The bakers and finalizers for the next epoch. - /// If this is absent, it should be treated as the same as the bakers for the current epoch. + /// The validators and finalizers for the next epoch. + /// If this is absent, it should be treated as the same as the validators for the current epoch. #[prost(message, optional, tag = "3")] pub next_epoch_bakers: ::core::option::Option, /// The first epoch of the next payday. @@ -5482,7 +5789,7 @@ pub struct ConsensusDetailedStatus { /// The live blocks organized by height after the last finalized block. #[prost(message, repeated, tag = "7")] pub branches: ::prost::alloc::vec::Vec, - /// Which bakers the node has seen legally-signed blocks with live parents from in + /// Which validators the node has seen legally-signed blocks with live parents from in /// non-finalized rounds. #[prost(message, repeated, tag = "8")] pub round_existing_blocks: ::prost::alloc::vec::Vec, @@ -5504,7 +5811,7 @@ pub struct ConsensusDetailedStatus { /// to determine the epoch and round of the last finalized block. #[prost(message, optional, tag = "13")] pub latest_finalization_entry: ::core::option::Option, - /// The bakers and finalizers for the previous, current and next epoch, relative to the last + /// The validators and finalizers for the previous, current and next epoch, relative to the last /// finalized block. #[prost(message, optional, tag = "14")] pub epoch_bakers: ::core::option::Option, @@ -5525,6 +5832,8 @@ pub struct AccountPending { pub first_timestamp: ::core::option::Option, } /// Information about how open the pool is to new delegators. +/// +/// This type might be extended in future versions of the API. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum OpenStatus { @@ -5555,6 +5864,8 @@ impl OpenStatus { } } /// Version of smart contract. +/// +/// This type might be extended in future versions of the API. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum ContractVersion { @@ -5582,6 +5893,8 @@ impl ContractVersion { } } /// The type of a credential. +/// +/// This type might be extended in future versions of the API. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum CredentialType { @@ -5611,6 +5924,8 @@ impl CredentialType { } } /// The type of chain update. +/// +/// This type might be extended in future versions of the API. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum UpdateType { @@ -5708,6 +6023,8 @@ impl UpdateType { } } /// The type of transaction. +/// +/// This type might be extended in future versions of the API. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum TransactionType { @@ -5715,22 +6032,35 @@ pub enum TransactionType { InitContract = 1, Update = 2, Transfer = 3, + /// Deprecated in protocol version 4. AddBaker = 4, + /// Deprecated in protocol version 4. RemoveBaker = 5, + /// Deprecated in protocol version 4. UpdateBakerStake = 6, + /// Deprecated in protocol version 4. UpdateBakerRestakeEarnings = 7, + /// Deprecated in protocol version 4. UpdateBakerKeys = 8, UpdateCredentialKeys = 9, + /// Deprecated in protocol version 7. EncryptedAmountTransfer = 10, + /// Deprecated in protocol version 7. TransferToEncrypted = 11, TransferToPublic = 12, TransferWithSchedule = 13, UpdateCredentials = 14, RegisterData = 15, + /// Introduced in protocol version 2. TransferWithMemo = 16, + /// Deprecated in protocol version 7. + /// Introduced in protocol version 2. EncryptedAmountTransferWithMemo = 17, + /// Introduced in protocol version 2. TransferWithScheduleAndMemo = 18, + /// Introduced in protocol version 4. ConfigureBaker = 19, + /// Introduced in protocol version 4. ConfigureDelegation = 20, /// Introduced in protocol version 9. TokenUpdate = 21, @@ -5800,6 +6130,8 @@ impl TransactionType { } } /// The different versions of the protocol. +/// +/// This type might be extended in future versions of the API. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum ProtocolVersion { @@ -5812,6 +6144,7 @@ pub enum ProtocolVersion { ProtocolVersion7 = 6, ProtocolVersion8 = 7, ProtocolVersion9 = 8, + ProtocolVersion10 = 9, } impl ProtocolVersion { /// String value of the enum field names used in the ProtoBuf definition. @@ -5829,6 +6162,7 @@ impl ProtocolVersion { Self::ProtocolVersion7 => "PROTOCOL_VERSION_7", Self::ProtocolVersion8 => "PROTOCOL_VERSION_8", Self::ProtocolVersion9 => "PROTOCOL_VERSION_9", + Self::ProtocolVersion10 => "PROTOCOL_VERSION_10", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -5843,6 +6177,7 @@ impl ProtocolVersion { "PROTOCOL_VERSION_7" => Some(Self::ProtocolVersion7), "PROTOCOL_VERSION_8" => Some(Self::ProtocolVersion8), "PROTOCOL_VERSION_9" => Some(Self::ProtocolVersion9), + "PROTOCOL_VERSION_10" => Some(Self::ProtocolVersion10), _ => None, } } diff --git a/src/v2/proto_schema_version.rs b/src/v2/proto_schema_version.rs index 390e74b691..d756917118 100644 --- a/src/v2/proto_schema_version.rs +++ b/src/v2/proto_schema_version.rs @@ -1 +1 @@ -pub const PROTO_SCHEMA_VERSION: &str = "f4a3e8fec9ddc33e71fce2411f6eabf7e0df47f4"; +pub const PROTO_SCHEMA_VERSION: &str = "6d04f703a2a8fbbd3f6a03e590cbaabf4ae99603"; From 01fe16260f7cf91ded2d3920a634c413411b9233 Mon Sep 17 00:00:00 2001 From: drsk Date: Mon, 1 Dec 2025 13:52:40 +0100 Subject: [PATCH 02/26] concordium-base: update submodule --- concordium-base | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/concordium-base b/concordium-base index 70667d9161..e1b1814de2 160000 --- a/concordium-base +++ b/concordium-base @@ -1 +1 @@ -Subproject commit 70667d91611edfd5c5d26b2407fa8b3c1e16f6e9 +Subproject commit e1b1814de2d1e6b27a0ca5dcc058366718f09371 From dcb69a2e07af8c91509c11e3f9b4c043399d0108 Mon Sep 17 00:00:00 2001 From: drsk Date: Mon, 1 Dec 2025 13:52:40 +0100 Subject: [PATCH 03/26] regenerate proto --- src/v2/generated/concordium.v2.rs | 126 +++++++++++++++++++++++++++++- src/v2/proto_schema_version.rs | 2 +- 2 files changed, 124 insertions(+), 4 deletions(-) diff --git a/src/v2/generated/concordium.v2.rs b/src/v2/generated/concordium.v2.rs index 2ae7b61800..5b74196090 100644 --- a/src/v2/generated/concordium.v2.rs +++ b/src/v2/generated/concordium.v2.rs @@ -2770,10 +2770,21 @@ pub mod update_payload { CreatePltUpdate(super::plt::CreatePlt), } } +/// Details about the sponsor of a transaction. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SponsorDetails { + /// The cost of the transaction. Paid by the sponsor. + #[prost(message, optional, tag = "1")] + pub cost: ::core::option::Option, + /// The sponsor of the transaction. + #[prost(message, optional, tag = "2")] + pub sponsor: ::core::option::Option, +} /// Details about an account transaction. #[derive(Clone, PartialEq, ::prost::Message)] pub struct AccountTransactionDetails { - /// The cost of the transaction. Paid by the sender. + /// The cost of the transaction. Paid by the sender. This will be zero if the + /// transaction is sponsored. #[prost(message, optional, tag = "1")] pub cost: ::core::option::Option, /// The sender of the transaction. @@ -2782,6 +2793,9 @@ pub struct AccountTransactionDetails { /// The effects of the transaction. #[prost(message, optional, tag = "3")] pub effects: ::core::option::Option, + /// The optional sponsor details of the transaction. + #[prost(message, optional, tag = "4")] + pub sponsor: ::core::option::Option, } /// Details of an account creation. These transactions are free, and we only /// ever get a response for them if the account is created, hence no failure @@ -4313,7 +4327,7 @@ pub mod node_info { #[derive(Clone, PartialEq, ::prost::Message)] pub struct SendBlockItemRequest { /// This field might be extended in future versions of the API. - #[prost(oneof = "send_block_item_request::BlockItem", tags = "1, 2, 3")] + #[prost(oneof = "send_block_item_request::BlockItem", tags = "1, 2, 3, 4, 5")] pub block_item: ::core::option::Option, } /// Nested message and enum types in `SendBlockItemRequest`. @@ -4333,6 +4347,13 @@ pub mod send_block_item_request { /// to make future update instructions. #[prost(message, tag = "3")] UpdateInstruction(super::UpdateInstruction), + /// Account transactions v1 are messages which are signed and paid for by + /// either an account or a sponsor. + #[prost(message, tag = "4")] + AccountTransactionV1(super::AccountTransactionV1), + /// A block item which has already been serialized to the format expected by the node. + #[prost(bytes, tag = "5")] + RawBlockItem(::prost::alloc::vec::Vec), } } /// Credential deployments create new accounts. They are not paid for @@ -4393,6 +4414,17 @@ pub struct AccountTransactionSignature { #[prost(map = "uint32, message", tag = "1")] pub signatures: ::std::collections::HashMap, } +/// Account transaction signatures from the sender and optionally the sponsor of +/// the transaction. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AccountTransactionV1Signatures { + /// Signatures from the sender of the transaction. + #[prost(message, optional, tag = "1")] + pub sender_signatures: ::core::option::Option, + /// The optional signature of the sponsor of the transaction. + #[prost(message, optional, tag = "2")] + pub sponsor_signatures: ::core::option::Option, +} /// Header of an account transaction that contains basic data to check whether /// the sender and the transaction are valid. The header is shared by all transaction types. #[derive(Clone, PartialEq, ::prost::Message)] @@ -4410,6 +4442,26 @@ pub struct AccountTransactionHeader { #[prost(message, optional, tag = "5")] pub expiry: ::core::option::Option, } +/// Header v1 of an account transaction with support for sponsored transactions. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AccountTransactionHeaderV1 { + /// Sender of the transaction. + #[prost(message, optional, tag = "1")] + pub sender: ::core::option::Option, + /// Sequence number of the transaction. + #[prost(message, optional, tag = "2")] + pub sequence_number: ::core::option::Option, + /// Maximum amount of energy the transaction can take to execute. + #[prost(message, optional, tag = "3")] + pub energy_amount: ::core::option::Option, + /// Latest time the transaction can included in a block. + #[prost(message, optional, tag = "5")] + pub expiry: ::core::option::Option, + /// The optional address of the account that sponsors the transaction, i.e. + /// pays the transaction fees associated with the execution. + #[prost(message, optional, tag = "6")] + pub sponsor: ::core::option::Option, +} /// Data required to initialize a new contract instance. #[derive(Clone, PartialEq, ::prost::Message)] pub struct InitContractPayload { @@ -4513,6 +4565,15 @@ pub struct PreAccountTransaction { #[prost(message, optional, tag = "2")] pub payload: ::core::option::Option, } +/// An unsigned account transaction v1. This is used with the +/// `GetTransactionSignHash` endpoint to obtain the message to sign. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct PreAccountTransactionV1 { + #[prost(message, optional, tag = "1")] + pub header: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub payload: ::core::option::Option, +} /// Account transactions are messages which are signed and paid for by the sender /// account. #[derive(Clone, PartialEq, ::prost::Message)] @@ -4524,6 +4585,21 @@ pub struct AccountTransaction { #[prost(message, optional, tag = "3")] pub payload: ::core::option::Option, } +/// Account transactions v1 are messages which are signed and paid for by the sender +/// account or by the sponsor. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AccountTransactionV1 { + /// The signatures on the transaction by the source account and other + /// relevant parties such as sponsors. + #[prost(message, optional, tag = "1")] + pub signatures: ::core::option::Option, + /// The transaction header data. + #[prost(message, optional, tag = "2")] + pub header: ::core::option::Option, + /// The account transaction payload. + #[prost(message, optional, tag = "3")] + pub payload: ::core::option::Option, +} #[derive(Clone, Copy, PartialEq, ::prost::Message)] pub struct UpdateInstructionHeader { #[prost(message, optional, tag = "1")] @@ -4869,7 +4945,7 @@ pub struct BlockItem { #[prost(message, optional, tag = "1")] pub hash: ::core::option::Option, /// This field might be extended in future versions of the API. - #[prost(oneof = "block_item::BlockItem", tags = "2, 3, 4")] + #[prost(oneof = "block_item::BlockItem", tags = "2, 3, 4, 5, 6")] pub block_item: ::core::option::Option, } /// Nested message and enum types in `BlockItem`. @@ -4889,6 +4965,13 @@ pub mod block_item { /// to make future update instructions. #[prost(message, tag = "4")] UpdateInstruction(super::UpdateInstruction), + /// Account transactions v1 are messages which are signed and paid for by + /// either an account or a sponsor. + #[prost(message, tag = "5")] + AccountTransactionV1(super::AccountTransactionV1), + /// A block item which has already been serialized to the format expected by the node. + #[prost(bytes, tag = "6")] + RawBlockItem(::prost::alloc::vec::Vec), } } /// Information about a particular validator with respect to @@ -7730,6 +7813,43 @@ pub mod queries_client { ); self.inner.unary(req, path, codec).await } + /// Get the hash to be signed for an account transaction v1. The + /// hash returned should be signed and the signatures included as an + /// AccountTransactionV1Signatures when calling `SendBlockItem`. This is + /// provided as a convenience to support cases where the right SDK is not + /// available for interacting with the node. If an SDK is available then it is + /// strongly recommended to compute this hash off-line using it. That reduces + /// the trust in the node, removes networking failure modes, and will perform + /// better. + pub async fn get_account_transaction_v1_sign_hash( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::unknown( + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/concordium.v2.Queries/GetAccountTransactionV1SignHash", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "concordium.v2.Queries", + "GetAccountTransactionV1SignHash", + ), + ); + self.inner.unary(req, path, codec).await + } /// Get the values of chain parameters in effect in the given block. pub async fn get_block_chain_parameters( &mut self, diff --git a/src/v2/proto_schema_version.rs b/src/v2/proto_schema_version.rs index d756917118..69f5432341 100644 --- a/src/v2/proto_schema_version.rs +++ b/src/v2/proto_schema_version.rs @@ -1 +1 @@ -pub const PROTO_SCHEMA_VERSION: &str = "6d04f703a2a8fbbd3f6a03e590cbaabf4ae99603"; +pub const PROTO_SCHEMA_VERSION: &str = "176d891c85c7547bf6ce6b886f7fac83d79a1c45"; From ec9798e6a1fbd11a58283d4343b6e2461b31d211 Mon Sep 17 00:00:00 2001 From: drsk Date: Mon, 17 Nov 2025 16:19:55 +0100 Subject: [PATCH 04/26] SPO-2: support for sponsored transactions --- src/v2/conversions.rs | 67 +++++++++++++++++++++++++++++++++- src/v2/mod.rs | 41 ++++++++++++++++++++- src/v2/proto_schema_version.rs | 2 +- 3 files changed, 107 insertions(+), 3 deletions(-) diff --git a/src/v2/conversions.rs b/src/v2/conversions.rs index c5ed1bd363..5ca44b5266 100644 --- a/src/v2/conversions.rs +++ b/src/v2/conversions.rs @@ -26,7 +26,10 @@ use concordium_base::{ updates, }; use cooldown::CooldownStatus; -use std::collections::{BTreeMap, BTreeSet}; +use std::{ + collections::{BTreeMap, BTreeSet}, + io::Cursor, +}; fn consume(bytes: &[u8]) -> Result { let mut cursor = std::io::Cursor::new(bytes); @@ -1294,6 +1297,56 @@ impl TryFrom } } +impl TryFrom + for concordium_base::transactions::AccountTransactionV1< + concordium_base::transactions::EncodedPayload, + > +{ + type Error = tonic::Status; + + fn try_from(value: AccountTransactionV1) -> Result { + let payload: concordium_base::transactions::EncodedPayload = + value.payload.require()?.try_into()?; + let payload_size = payload.size(); + let header = { + let header = value.header.require()?; + let sender = header.sender.require()?.try_into()?; + let sponsor = match header.sponsor { + Some(sponsor) => Some(sponsor.try_into()?), + None => None, + }; + let nonce = header.sequence_number.require()?.into(); + let energy_amount = header.energy_amount.require()?.into(); + let expiry = header.expiry.require()?.into(); + concordium_base::transactions::TransactionHeaderV1 { + sponsor, + sender, + nonce, + energy_amount, + payload_size, + expiry, + } + }; + Ok(Self { + signatures: concordium_base::common::types::TransactionSignaturesV1 { + sender: value + .signatures + .to_owned() + .require()? + .sender_signatures + .require()? + .try_into()?, + sponsor: match value.signatures.require()?.sponsor_signatures { + Some(sponsor_sigs) => Some(sponsor_sigs.try_into()?), + None => None, + }, + }, //value.signature.require()?.try_into()? + header, + payload, + }) + } +} + impl TryFrom for crate::id::types::AccountCredentialMessage< crate::id::constants::IpPairing, @@ -1390,6 +1443,18 @@ impl TryFrom Item::CredentialDeployment(Box::new(cd.try_into()?)) } block_item::BlockItem::UpdateInstruction(ui) => Item::UpdateInstruction(ui.try_into()?), + block_item::BlockItem::AccountTransactionV1(atv1) => { + Item::AccountTransactionV1(atv1.try_into()?) + } + block_item::BlockItem::RawBlockItem(bytes) => { + match concordium_base::transactions::BlockItem::deserial(&mut Cursor::new(bytes)) { + Ok(bi) => Ok(bi), + Err(err) => Err(tonic::Status::new( + tonic::Code::InvalidArgument, + err.to_string(), + )), + }? + } }; Ok(out) } diff --git a/src/v2/mod.rs b/src/v2/mod.rs index 3dfa3737c6..bcea87bf52 100644 --- a/src/v2/mod.rs +++ b/src/v2/mod.rs @@ -25,7 +25,7 @@ use concordium_base::{ base::{AccountIndex, BlockHeight, Epoch, GenesisIndex}, common::{ self, - types::{TransactionSignature, TransactionTime}, + types::{TransactionSignature, TransactionSignaturesV1, TransactionTime}, }, contracts_common::{ AccountAddress, AccountAddressParseError, Amount, ContractAddress, OwnedContractName, @@ -755,6 +755,18 @@ impl From<&transactions::TransactionHeader> for generated::AccountTransactionHea } } +impl From<&transactions::TransactionHeaderV1> for generated::AccountTransactionHeaderV1 { + fn from(v: &transactions::TransactionHeaderV1) -> Self { + Self { + sender: Some(generated::AccountAddress::from(v.sender)), + sponsor: v.sponsor.map(generated::AccountAddress::from), + sequence_number: Some(v.nonce.into()), + energy_amount: Some(v.energy_amount.into()), + expiry: Some(v.expiry.into()), + } + } +} + impl From for generated::AccountTransactionSignature { fn from(v: TransactionSignature) -> Self { (&v).into() @@ -789,6 +801,15 @@ impl From<&TransactionSignature> for generated::AccountTransactionSignature { } } +impl From<&TransactionSignaturesV1> for generated::AccountTransactionV1Signatures { + fn from(v: &TransactionSignaturesV1) -> Self { + Self { + sender_signatures: Some(v.sender.to_owned().into()), + sponsor_signatures: v.sponsor.to_owned().map(|x| x.into()), + } + } +} + impl IntoRequest for (&transactions::TransactionHeader, &transactions::Payload) { @@ -838,6 +859,24 @@ impl IntoRequest for &transacti generated::send_block_item_request::BlockItem::UpdateInstruction(v.into()), ), }, + transactions::BlockItem::AccountTransactionV1(v) => { + generated::SendBlockItemRequest { + block_item: Some( + generated::send_block_item_request::BlockItem::AccountTransactionV1( + generated::AccountTransactionV1 { + signatures: Some((&v.signatures).into()), + header: Some((&v.header).into()), + payload: { + let atp = generated::AccountTransactionPayload{ + payload: Some(generated::account_transaction_payload::Payload::RawPayload(v.payload.encode().into())), + }; + Some(atp) + }, + }, + ), + ), + } + } }; tonic::Request::new(request) } diff --git a/src/v2/proto_schema_version.rs b/src/v2/proto_schema_version.rs index 69f5432341..21f14f6622 100644 --- a/src/v2/proto_schema_version.rs +++ b/src/v2/proto_schema_version.rs @@ -1 +1 @@ -pub const PROTO_SCHEMA_VERSION: &str = "176d891c85c7547bf6ce6b886f7fac83d79a1c45"; +pub const PROTO_SCHEMA_VERSION: &str = "cc360366e47981bc1945ce39ba7f8fbd8902d423"; From b0468d097420d5226597cf9a1823b6598bd50ae8 Mon Sep 17 00:00:00 2001 From: drsk Date: Thu, 20 Nov 2025 11:06:45 +0100 Subject: [PATCH 05/26] replace unknown doctest annotation --- src/lib.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib.md b/src/lib.md index 07a3e948e3..d7699acaae 100644 --- a/src/lib.md +++ b/src/lib.md @@ -37,7 +37,7 @@ It makes potentially extended information explicit in the types and allows each Several types and fields in the SDK are now wrapped in [`Upward`] and the wrapper provides several methods to ease the migration depending on the desired behavior of the application. For some situations unknown information should cause an error, where in other situations it is safe to ignore, and maybe logging warnings to be handled in a future iteration of the application. -```rust,no_compile +```rust,ignore if let Upward::Known(details) = block_item_summary.details { // Data is familiar so we handle details as usual. } else { @@ -47,13 +47,13 @@ if let Upward::Known(details) = block_item_summary.details { To produce an error in the case of unknown data use [`known_or_err`], converting [`Upward`] into [`Result`](v2::upward::UnknownDataError). -```rust,no_compile +```rust,ignore let details = block_item_summary.details.known_or_err()?; ``` Alternatively [`known_or`] or similarly named variants can be used for directly mapping the unknown data case to an error. -```rust,no_compile +```rust,ignore let details = block_item_summary.details.known_or(MyError::UnknownData)?; ``` @@ -81,4 +81,4 @@ The `ChainParameters::micro_ccd_per_energy()` and `ChainParameters::ccd_cost()` Instead, use [`energy_rate()`](types::chain_parameters::ChainParameters::energy_rate) to obtain an [`EnergyRate`](types::chain_parameters::EnergyRate), which encapsulates the [`micro_ccd_per_energy`](types::chain_parameters::EnergyRate::micro_ccd_per_energy) exchange rate. `EnergyRate` also provides [`ccd_cost()`](types::chain_parameters::EnergyRate::ccd_cost), which should be used in place of the former `ChainParameters::ccd_cost()`. -Finally, the `ChainParameters::foundation_account()` getter function was removed, and should be replaced by directly accessing [`ChainParameters::foundation_account`](types::chain_parameters::ChainParameters::foundation_account). \ No newline at end of file +Finally, the `ChainParameters::foundation_account()` getter function was removed, and should be replaced by directly accessing [`ChainParameters::foundation_account`](types::chain_parameters::ChainParameters::foundation_account). From 0fce3a98accf70280741432bf91acecff82dcc2e Mon Sep 17 00:00:00 2001 From: drsk Date: Thu, 20 Nov 2025 11:45:53 +0100 Subject: [PATCH 06/26] cosmetics --- src/v2/conversions.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/v2/conversions.rs b/src/v2/conversions.rs index 5ca44b5266..8592fa1c1f 100644 --- a/src/v2/conversions.rs +++ b/src/v2/conversions.rs @@ -1340,7 +1340,7 @@ impl TryFrom Some(sponsor_sigs) => Some(sponsor_sigs.try_into()?), None => None, }, - }, //value.signature.require()?.try_into()? + }, header, payload, }) From a3e057ca121bd4e7defb7523d77fedc8220ac6a2 Mon Sep 17 00:00:00 2001 From: drsk Date: Tue, 25 Nov 2025 13:22:57 +0100 Subject: [PATCH 07/26] add sponsor details to account transaction details --- src/types/mod.rs | 11 +++++++++++ src/types/summary_helper.rs | 16 ++++++++++++++-- src/v2/conversions.rs | 15 +++++++++++++++ src/v2/mod.rs | 2 +- 4 files changed, 41 insertions(+), 3 deletions(-) diff --git a/src/types/mod.rs b/src/types/mod.rs index ea468d5c3d..4cdad33960 100644 --- a/src/types/mod.rs +++ b/src/types/mod.rs @@ -2006,6 +2006,15 @@ impl BlockItemSummaryDetails { } } +#[derive(Debug, Clone)] +/// Details about the sponsor of a transaction. +pub struct SponsorDetails { + /// The cost of the transaction. Paid by the sponsor. + pub sponsor: AccountAddress, + /// The sponsor of the transaction. + pub cost: Amount, +} + #[derive(Debug, Clone)] /// Details of an account transaction. This always has a sender and is paid for, /// and it might have some other effects on the state of the chain. @@ -2015,6 +2024,8 @@ pub struct AccountTransactionDetails { pub cost: Amount, /// Sender of the transaction. pub sender: AccountAddress, + /// Optional sponsor of the transaction + pub sponsor: Option, /// Effects of the account transaction, if any. pub effects: Upward, } diff --git a/src/types/summary_helper.rs b/src/types/summary_helper.rs index 43a6293443..5615223b3f 100644 --- a/src/types/summary_helper.rs +++ b/src/types/summary_helper.rs @@ -16,7 +16,7 @@ use super::{ }; use crate::{ - types::Address, + types::{Address, SponsorDetails}, v2::upward::{UnknownDataError, Upward}, }; use concordium_base::{ @@ -42,6 +42,8 @@ pub(crate) struct BlockItemSummary { /// Sender, if available. The sender is always available for account /// transactions. sender: Option, + /// Optional sponsor of the transaction. + sponsor: Option, /// Hash of the transaction. hash: hashes::TransactionHash, /// The amount of CCD the transaction was charged to the sender. @@ -510,6 +512,7 @@ impl TryFrom for BlockItemSummary { super::AccountTransactionDetails { cost, sender, + sponsor, effects, }, ) => { @@ -905,6 +908,7 @@ impl TryFrom for BlockItemSummary { }; BlockItemSummary { sender: Some(sender), + sponsor: sponsor.map(|s| s.sponsor), hash: bi.hash, cost, energy_cost: bi.energy_cost, @@ -919,6 +923,7 @@ impl TryFrom for BlockItemSummary { reg_id, }) => BlockItemSummary { sender: None, + sponsor: None, hash: bi.hash, cost: Amount::zero(), energy_cost: bi.energy_cost, @@ -941,6 +946,7 @@ impl TryFrom for BlockItemSummary { let payload = payload.known_or_err()?; BlockItemSummary { sender: None, + sponsor: None, hash: bi.hash, cost: Amount::zero(), energy_cost: bi.energy_cost, @@ -967,6 +973,7 @@ impl TryFrom for BlockItemSummary { BlockItemSummary { sender: None, + sponsor: None, hash: bi.hash, cost: Amount::zero(), energy_cost: bi.energy_cost, @@ -1012,12 +1019,14 @@ fn convert_account_transaction( ty: Option, cost: Amount, sender: AccountAddress, + sponsor: Option, value: BlockItemResult, ) -> Result { let mk_none = |reject_reason| { Ok(super::AccountTransactionDetails { cost, sender, + sponsor: sponsor.map(|s| SponsorDetails { sponsor: s, cost }), effects: Upward::Known(super::AccountTransactionEffects::None { transaction_type: ty, reject_reason: Upward::Known(reject_reason), @@ -1029,6 +1038,7 @@ fn convert_account_transaction( Ok(super::AccountTransactionDetails { cost, sender, + sponsor: sponsor.map(|sponsor| SponsorDetails { sponsor, cost }), effects: Upward::Known(effects), }) }; @@ -1509,12 +1519,14 @@ impl TryFrom for super::BlockItemSummary { let index = value.index; let energy_cost = value.energy_cost; let hash = value.hash; + let sponsor = value.sponsor; let sender = value .sender .ok_or(ConversionError::InvalidTransactionResult( "Expect `BlockItemType::Account` to have a sender".to_string(), ))?; - let details = convert_account_transaction(ty, value.cost, sender, value.result)?; + let details = + convert_account_transaction(ty, value.cost, sender, sponsor, value.result)?; Ok(super::BlockItemSummary { index, energy_cost, diff --git a/src/v2/conversions.rs b/src/v2/conversions.rs index 8592fa1c1f..be66c85d9d 100644 --- a/src/v2/conversions.rs +++ b/src/v2/conversions.rs @@ -1460,6 +1460,17 @@ impl TryFrom } } +impl TryFrom for super::types::SponsorDetails { + type Error = tonic::Status; + + fn try_from(v: SponsorDetails) -> Result { + Ok(Self { + cost: v.cost.require()?.into(), + sponsor: v.sponsor.require()?.try_into()?, + }) + } +} + impl TryFrom for super::types::AccountTransactionDetails { type Error = tonic::Status; @@ -1467,6 +1478,10 @@ impl TryFrom for super::types::AccountTransactionDeta Ok(Self { cost: v.cost.require()?.into(), sender: v.sender.require()?.try_into()?, + sponsor: match v.sponsor { + None => None, + Some(sponsor) => Some(sponsor.try_into()?), + }, effects: Upward::from(v.effects.map(TryFrom::try_from).transpose()?), }) } diff --git a/src/v2/mod.rs b/src/v2/mod.rs index bcea87bf52..3f6d46970b 100644 --- a/src/v2/mod.rs +++ b/src/v2/mod.rs @@ -805,7 +805,7 @@ impl From<&TransactionSignaturesV1> for generated::AccountTransactionV1Signature fn from(v: &TransactionSignaturesV1) -> Self { Self { sender_signatures: Some(v.sender.to_owned().into()), - sponsor_signatures: v.sponsor.to_owned().map(|x| x.into()), + sponsor_signatures: v.sponsor.to_owned().map(|s| s.into()), } } } From f29c942b615fbe6c7e2462ca362df08782429f83 Mon Sep 17 00:00:00 2001 From: drsk Date: Mon, 1 Dec 2025 14:02:06 +0100 Subject: [PATCH 08/26] cosmetics --- src/types/summary_helper.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/types/summary_helper.rs b/src/types/summary_helper.rs index 5615223b3f..dd7573195f 100644 --- a/src/types/summary_helper.rs +++ b/src/types/summary_helper.rs @@ -1038,7 +1038,7 @@ fn convert_account_transaction( Ok(super::AccountTransactionDetails { cost, sender, - sponsor: sponsor.map(|sponsor| SponsorDetails { sponsor, cost }), + sponsor: sponsor.map(|s| SponsorDetails { sponsor: s, cost }), effects: Upward::Known(effects), }) }; From 86b2bfeadcb99b549f9bf896cea60f411626297d Mon Sep 17 00:00:00 2001 From: drsk Date: Mon, 1 Dec 2025 14:02:06 +0100 Subject: [PATCH 09/26] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d60ee6ed3..e1afc92ee9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,7 @@ - `types::smart_contracts::InstanceInfo` - `types::smart_contracts::ContractContext` - `types::smart_contracts::InvokeContractResult` + - Support for sponsored transactions. ## 8.0.0 From 58917d801f1125008572c5c04f8177f47a4a7d7b Mon Sep 17 00:00:00 2001 From: drsk Date: Tue, 2 Dec 2025 15:08:09 +0100 Subject: [PATCH 10/26] added sponsored example --- examples/sponsored-plt-transfer.rs | 118 +++++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 examples/sponsored-plt-transfer.rs diff --git a/examples/sponsored-plt-transfer.rs b/examples/sponsored-plt-transfer.rs new file mode 100644 index 0000000000..ad8fa46e87 --- /dev/null +++ b/examples/sponsored-plt-transfer.rs @@ -0,0 +1,118 @@ +//! Example that shows how to transfer (PLT) tokens. +use anyhow::Context; +use clap::AppSettings; +use concordium_base::{ + contracts_common::AccountAddress, + protocol_level_tokens::{operations, ConversionRule, TokenAmount, TokenId}, +}; +use concordium_rust_sdk::{ + common::types::TransactionTime, + types::{transactions::BlockItem, WalletAccount}, + v2::{ + BlockIdentifier, {self}, + }, +}; +use rust_decimal::Decimal; +use std::{path::PathBuf, str::FromStr}; +use structopt::*; + +#[derive(StructOpt)] +struct App { + #[structopt( + long = "node", + help = "V2 GRPC interface of the node.", + default_value = "http://localhost:20000" + )] + endpoint: v2::Endpoint, + #[structopt(long = "sender", help = "Path to the sender account key file.")] + sender_account: PathBuf, + #[structopt(long = "sponsor", help = "Path to the sponsor account key file.")] + sponsor_account: PathBuf, + #[structopt(long = "receiver", help = "Receiver address.")] + receiver: String, + #[structopt(long = "token", help = "Token id of token.")] + token_id: String, + #[structopt(long = "amount", help = "Amount to send.", default_value = "100.0")] + amount: Decimal, +} + +#[tokio::main(flavor = "multi_thread")] +async fn main() -> anyhow::Result<()> { + let app = { + let app = App::clap().global_setting(AppSettings::ColoredHelp); + let matches = app.get_matches(); + App::from_clap(&matches) + }; + let mut client = v2::Client::new(app.endpoint).await?; + + // Token id of the PLT token to transfer + let token_id = TokenId::try_from(app.token_id.clone())?; + + // Token info, we need the number of decimals in the token amount representation + let token_info = client + .get_token_info(token_id.clone(), BlockIdentifier::LastFinal) + .await? + .response; + + // Amount of tokens to send. The number of decimals in the TokenAmount + // must be the same as the number of decimals in the TokenInfo + let token_amount = TokenAmount::try_from_rust_decimal( + app.amount, + token_info.token_state.decimals, + ConversionRule::AllowRounding, + )?; + println!("Token amount: {}", token_amount,); + + // Receiver of the tokens + let receiver_address = AccountAddress::from_str(&app.receiver)?; + + // Load account keys and address for sender and sponsor from a file + let sender_keys: WalletAccount = WalletAccount::from_json_file(app.sender_account) + .context("Could not read the sender account keys file.")?; + let sponsor_keys: WalletAccount = WalletAccount::from_json_file(app.sponsor_account) + .context("Could not read the sponsor account keys file.")?; + + // Get the initial nonce at the last finalized block. + let nonce = client + .get_next_account_sequence_number(&sender_keys.address) + .await? + .nonce; + + // Set expiry to now + 5min + let expiry: TransactionTime = + TransactionTime::from_seconds((chrono::Utc::now().timestamp() + 300) as u64); + + // Create transfer tokens transaction + let operation = operations::transfer_tokens(receiver_address, token_amount); + + // Compose operation to transaction + let txn = concordium_base::transactions::construct::token_update_operations( + 1, + sender_keys.address, + nonce, + expiry, + token_id, + [operation].into_iter().collect(), + )? + .extend() + .add_sponsor(sponsor_keys.address) + .sign(&sender_keys) + .sponsor(&sponsor_keys) + .map_err(|e| anyhow::anyhow!(e))? + .finalize() + .map_err(|e| anyhow::anyhow!(e))?; + + let item = BlockItem::AccountTransactionV1(txn); + + // Submit the transaction to the chain + let transaction_hash = client.send_block_item(&item).await?; + println!( + "Transaction {} submitted (nonce = {}).", + transaction_hash, nonce, + ); + let (bh, bs) = client.wait_until_finalized(&transaction_hash).await?; + println!("Transaction finalized in block {}.", bh); + println!("The outcome is {:#?}", bs); + + Ok(()) +} From 7744d4057ea160d6254809583432babb6b401748 Mon Sep 17 00:00:00 2001 From: drsk Date: Wed, 3 Dec 2025 11:50:20 +0100 Subject: [PATCH 11/26] concordium-base: update submodule --- concordium-base | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/concordium-base b/concordium-base index e1b1814de2..77f634cf0a 160000 --- a/concordium-base +++ b/concordium-base @@ -1 +1 @@ -Subproject commit e1b1814de2d1e6b27a0ca5dcc058366718f09371 +Subproject commit 77f634cf0aca4ce52331c57808bd8b1d1ec26a7c From 0dc31a60cbc1cfd8f297e5e5d1ff3c5ad3e1ec47 Mon Sep 17 00:00:00 2001 From: drsk Date: Wed, 3 Dec 2025 11:57:08 +0100 Subject: [PATCH 12/26] added sponsored example --- examples/sponsored-plt-transfer.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/examples/sponsored-plt-transfer.rs b/examples/sponsored-plt-transfer.rs index ad8fa46e87..e4f7a60501 100644 --- a/examples/sponsored-plt-transfer.rs +++ b/examples/sponsored-plt-transfer.rs @@ -94,9 +94,13 @@ async fn main() -> anyhow::Result<()> { token_id, [operation].into_iter().collect(), )? + // Extend the transaction and add a sponsor. .extend() - .add_sponsor(sponsor_keys.address) + .add_sponsor(sponsor_keys.address, 1) + .map_err(|e| anyhow::anyhow!(e))? + // Sender signs the transaction. .sign(&sender_keys) + // Sponsor signs the now sponsored transaction. .sponsor(&sponsor_keys) .map_err(|e| anyhow::anyhow!(e))? .finalize() From 2c5382428bfda83a3ad0084b7b28d91841f17183 Mon Sep 17 00:00:00 2001 From: drsk Date: Wed, 3 Dec 2025 12:01:13 +0100 Subject: [PATCH 13/26] update top-level comment --- examples/sponsored-plt-transfer.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/sponsored-plt-transfer.rs b/examples/sponsored-plt-transfer.rs index e4f7a60501..8d095ccbfb 100644 --- a/examples/sponsored-plt-transfer.rs +++ b/examples/sponsored-plt-transfer.rs @@ -1,4 +1,4 @@ -//! Example that shows how to transfer (PLT) tokens. +//! Example that shows how to create a sponsored PLT token transfer. use anyhow::Context; use clap::AppSettings; use concordium_base::{ From 15c0903f31377fbb508aef13f20f5ecd484615f5 Mon Sep 17 00:00:00 2001 From: drsk <827698+drsk0@users.noreply.github.com> Date: Wed, 3 Dec 2025 13:23:29 +0100 Subject: [PATCH 14/26] Update examples/sponsored-plt-transfer.rs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Søren Bruus Zeppelin --- examples/sponsored-plt-transfer.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/sponsored-plt-transfer.rs b/examples/sponsored-plt-transfer.rs index 8d095ccbfb..0c97889dce 100644 --- a/examples/sponsored-plt-transfer.rs +++ b/examples/sponsored-plt-transfer.rs @@ -102,9 +102,9 @@ async fn main() -> anyhow::Result<()> { .sign(&sender_keys) // Sponsor signs the now sponsored transaction. .sponsor(&sponsor_keys) - .map_err(|e| anyhow::anyhow!(e))? + .expect("Can sponsor the transaction") .finalize() - .map_err(|e| anyhow::anyhow!(e))?; + .expect("Transaction is well-formed"); let item = BlockItem::AccountTransactionV1(txn); From 4344e94220215704dbfba18c9c03875c10c1fce1 Mon Sep 17 00:00:00 2001 From: drsk <827698+drsk0@users.noreply.github.com> Date: Wed, 3 Dec 2025 13:23:40 +0100 Subject: [PATCH 15/26] Update examples/sponsored-plt-transfer.rs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Søren Bruus Zeppelin --- examples/sponsored-plt-transfer.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/sponsored-plt-transfer.rs b/examples/sponsored-plt-transfer.rs index 0c97889dce..cc40fe7bd1 100644 --- a/examples/sponsored-plt-transfer.rs +++ b/examples/sponsored-plt-transfer.rs @@ -97,7 +97,7 @@ async fn main() -> anyhow::Result<()> { // Extend the transaction and add a sponsor. .extend() .add_sponsor(sponsor_keys.address, 1) - .map_err(|e| anyhow::anyhow!(e))? + .expect("Can add sponsor account") // Sender signs the transaction. .sign(&sender_keys) // Sponsor signs the now sponsored transaction. From c46b0ea7dfee4bdab894e75ccfdb5aeca5439ef2 Mon Sep 17 00:00:00 2001 From: drsk Date: Wed, 3 Dec 2025 16:58:42 +0100 Subject: [PATCH 16/26] add sponsor account to affected accounts --- src/types/mod.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/types/mod.rs b/src/types/mod.rs index 4cdad33960..99d8ac37b5 100644 --- a/src/types/mod.rs +++ b/src/types/mod.rs @@ -1914,7 +1914,7 @@ impl BlockItemSummaryDetails { let Upward::Known(effects) = &at.effects else { return Upward::Unknown(()); }; - match effects { + let mut affected_accounts = match effects { AccountTransactionEffects::None { .. } => vec![at.sender], AccountTransactionEffects::ModuleDeployed { .. } => vec![at.sender], AccountTransactionEffects::ContractInitialized { .. } => vec![at.sender], @@ -1992,7 +1992,12 @@ impl BlockItemSummaryDetails { add_token_event_addresses(&mut addresses, events); addresses.into_iter().collect() } - } + }; + // Add the optional sponsor account to the affected accounts. + at.sponsor + .iter() + .for_each(|s| affected_accounts.push(s.sponsor)); + affected_accounts } BlockItemSummaryDetails::AccountCreation(_) => Vec::new(), BlockItemSummaryDetails::Update(_) => Vec::new(), From 42a468a765341bddb8e9230526d0c6783bcb413e Mon Sep 17 00:00:00 2001 From: drsk <827698+drsk0@users.noreply.github.com> Date: Thu, 4 Dec 2025 10:31:08 +0100 Subject: [PATCH 17/26] Update src/types/mod.rs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Søren Bruus Zeppelin --- src/types/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/types/mod.rs b/src/types/mod.rs index 99d8ac37b5..787af429ec 100644 --- a/src/types/mod.rs +++ b/src/types/mod.rs @@ -1994,9 +1994,9 @@ impl BlockItemSummaryDetails { } }; // Add the optional sponsor account to the affected accounts. - at.sponsor - .iter() - .for_each(|s| affected_accounts.push(s.sponsor)); + if let Some(sponsor) = at.sponsor { + affected_accounts.push(sponsor); + } affected_accounts } BlockItemSummaryDetails::AccountCreation(_) => Vec::new(), From 8ca392ca4465568abee108b640310b5ad6e3cc2e Mon Sep 17 00:00:00 2001 From: drsk Date: Thu, 4 Dec 2025 11:02:21 +0100 Subject: [PATCH 18/26] small fix after github update --- src/types/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/types/mod.rs b/src/types/mod.rs index 787af429ec..b314b7a65a 100644 --- a/src/types/mod.rs +++ b/src/types/mod.rs @@ -1994,8 +1994,8 @@ impl BlockItemSummaryDetails { } }; // Add the optional sponsor account to the affected accounts. - if let Some(sponsor) = at.sponsor { - affected_accounts.push(sponsor); + if let Some(sponsor) = at.sponsor.as_ref() { + affected_accounts.push(sponsor.sponsor); } affected_accounts } From 196153c793267235a2eab0f3c48f030ee7a0df92 Mon Sep 17 00:00:00 2001 From: drsk Date: Tue, 9 Dec 2025 11:14:13 +0100 Subject: [PATCH 19/26] concordium-base: update submodule --- concordium-base | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/concordium-base b/concordium-base index 77f634cf0a..c541f60334 160000 --- a/concordium-base +++ b/concordium-base @@ -1 +1 @@ -Subproject commit 77f634cf0aca4ce52331c57808bd8b1d1ec26a7c +Subproject commit c541f603343df033625e44025d71789b731ba0e0 From 00c6bbd8e836457ff01e37733c141c6e72380ed7 Mon Sep 17 00:00:00 2001 From: drsk Date: Tue, 9 Dec 2025 11:14:50 +0100 Subject: [PATCH 20/26] update implied by submodule update --- Cargo.toml | 2 +- src/v2/conversions.rs | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index cf5a0ef47b..6299cd0177 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,7 +36,7 @@ num-traits = "0.2" http = "1.2.0" tokio-stream = "0.1" -concordium_base = { version = "9.0.0", path = "./concordium-base/rust-src/concordium_base/", features = ["encryption"] } +concordium_base = { version = "10.0.0-alpha.0", path = "./concordium-base/rust-src/concordium_base/", features = ["encryption"] } concordium-smart-contract-engine = { version = "6.0", path = "./concordium-base/smart-contracts/wasm-chain-integration/", default-features = false, features = ["async"]} aes-gcm = { version = "0.10", features = ["std"] } tracing = "0.1" diff --git a/src/v2/conversions.rs b/src/v2/conversions.rs index be66c85d9d..c791ac1e8c 100644 --- a/src/v2/conversions.rs +++ b/src/v2/conversions.rs @@ -740,11 +740,9 @@ impl TryFrom for crate::id::secret_sharing::Threshold { fn try_from(value: ArThreshold) -> Result { if let Ok(v) = u8::try_from(value.value) { - if v == 0 { - Err(tonic::Status::internal("Unexpected zero AR threshold.")) - } else { - Ok(Self(v)) - } + Self::try_from(v).map_err(|e| match e { + () => tonic::Status::internal("Unexpected zero AR threshold."), + }) } else { Err(tonic::Status::internal("Unexpected AR threshold.")) } From d306351ee56d8d56ee626765863252d89c2a1ba5 Mon Sep 17 00:00:00 2001 From: drsk Date: Tue, 9 Dec 2025 11:38:32 +0100 Subject: [PATCH 21/26] clippy fix --- src/v2/conversions.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/v2/conversions.rs b/src/v2/conversions.rs index c791ac1e8c..fb9e37e2c7 100644 --- a/src/v2/conversions.rs +++ b/src/v2/conversions.rs @@ -740,8 +740,9 @@ impl TryFrom for crate::id::secret_sharing::Threshold { fn try_from(value: ArThreshold) -> Result { if let Ok(v) = u8::try_from(value.value) { - Self::try_from(v).map_err(|e| match e { - () => tonic::Status::internal("Unexpected zero AR threshold."), + Self::try_from(v).map_err(|e| { + let () = e; + tonic::Status::internal("Unexpected zero AR threshold.") }) } else { Err(tonic::Status::internal("Unexpected AR threshold.")) From ff00fc106ccf6747be0a0128d86fc84e42cfb90e Mon Sep 17 00:00:00 2001 From: drsk Date: Tue, 9 Dec 2025 14:12:38 +0100 Subject: [PATCH 22/26] bump version --- CHANGELOG.md | 2 ++ Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e1afc92ee9..1c4d896bbe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ ## Unreleased changes +## 9.0.0-alpha.0 + - Support for `ProtocolVersion::P10`. - The flag `serde_deprecated` now guards `serde::Serialize` and `serde::Deserialize` implemetations on the following types. The implementations will eventually be removed. - `protocol_level_tokens::AccountToken` diff --git a/Cargo.toml b/Cargo.toml index 6299cd0177..f2e0a9634b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "concordium-rust-sdk" -version = "8.0.0" +version = "9.0.0-alpha.0" authors = ["Concordium "] edition = "2021" rust-version = "1.85" From f72f139c3bf74c7b2df2996c0ca301c2a752da42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Bruus=20Zeppelin?= Date: Tue, 6 Jan 2026 10:16:32 +0100 Subject: [PATCH 23/26] Update base ref --- concordium-base | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/concordium-base b/concordium-base index c541f60334..ee6dcfe886 160000 --- a/concordium-base +++ b/concordium-base @@ -1 +1 @@ -Subproject commit c541f603343df033625e44025d71789b731ba0e0 +Subproject commit ee6dcfe88676424804f13db1701a015a61148aba From fa7c16154ad31a762f6ddf87a3b2c90c8ab0901d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Bruus=20Zeppelin?= Date: Fri, 9 Jan 2026 09:19:19 +0100 Subject: [PATCH 24/26] Prepare for 9.0.0 release --- Cargo.toml | 4 ++-- concordium-base | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f2e0a9634b..f6918f9ce0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "concordium-rust-sdk" -version = "9.0.0-alpha.0" +version = "9.0.0" authors = ["Concordium "] edition = "2021" rust-version = "1.85" @@ -36,7 +36,7 @@ num-traits = "0.2" http = "1.2.0" tokio-stream = "0.1" -concordium_base = { version = "10.0.0-alpha.0", path = "./concordium-base/rust-src/concordium_base/", features = ["encryption"] } +concordium_base = { version = "10.0.0", path = "./concordium-base/rust-src/concordium_base/", features = ["encryption"] } concordium-smart-contract-engine = { version = "6.0", path = "./concordium-base/smart-contracts/wasm-chain-integration/", default-features = false, features = ["async"]} aes-gcm = { version = "0.10", features = ["std"] } tracing = "0.1" diff --git a/concordium-base b/concordium-base index dcda3e5911..403628bfd2 160000 --- a/concordium-base +++ b/concordium-base @@ -1 +1 @@ -Subproject commit dcda3e591173d8cfd36af76f679acc80cb9ff045 +Subproject commit 403628bfd2f864e13b98a62da2a66b55f53c87ef From 04f1d0d174d4085ffcab0775be9a1d75c61f5558 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Bruus=20Zeppelin?= Date: Fri, 9 Jan 2026 13:04:31 +0100 Subject: [PATCH 25/26] Update base ref to latest `main` --- concordium-base | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/concordium-base b/concordium-base index 403628bfd2..92ed21a466 160000 --- a/concordium-base +++ b/concordium-base @@ -1 +1 @@ -Subproject commit 403628bfd2f864e13b98a62da2a66b55f53c87ef +Subproject commit 92ed21a466d72833b57b2ea3b871f76ee100e123 From d6f3df0c47d609959e5b75fbb87ee4966881a898 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Bruus=20Zeppelin?= Date: Fri, 9 Jan 2026 13:05:58 +0100 Subject: [PATCH 26/26] Update changelog --- CHANGELOG.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fb6c15f439..187ff9f8ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,15 +1,4 @@ -## 8.1.0 - -- Implemented `web3id::v1` module that contains functionality to support the verification flow of Concordium verifiable presentations V1. - This includes - - creating verification request anchor (VRA) - - verifying presentations - - creating verification audit anchor (VAA) - - The main entrypoints in the module are `v1::create_verification_request_and_submit_request_anchor` - and `v1::verify_presentation_and_submit_audit_anchor`. - -## 9.0.0-alpha.0 +## 9.0.0 - Support for `ProtocolVersion::P10`. - The flag `serde_deprecated` now guards `serde::Serialize` and `serde::Deserialize` implemetations on the following types. The implementations will eventually be removed. @@ -61,6 +50,17 @@ - `types::smart_contracts::InvokeContractResult` - Support for sponsored transactions. +## 8.1.0 + +- Implemented `web3id::v1` module that contains functionality to support the verification flow of Concordium verifiable presentations V1. + This includes + - creating verification request anchor (VRA) + - verifying presentations + - creating verification audit anchor (VAA) + + The main entrypoints in the module are `v1::create_verification_request_and_submit_request_anchor` + and `v1::verify_presentation_and_submit_audit_anchor`. + ## 8.0.0 - Added const conversion function to convert from `ProtocolVersion` enum to `ProtocolVersionInt`