0.1.0-pre.004
This commit is contained in:
66
kb-lib/src/decoder/solana/core/constants.rs
Normal file
66
kb-lib/src/decoder/solana/core/constants.rs
Normal file
@@ -0,0 +1,66 @@
|
||||
// file: kb-lib/src/decoder/solana/core/constants.rs
|
||||
// version: 13
|
||||
|
||||
//! Local constants for the Solana Core decoder component.
|
||||
|
||||
/// Stable protocol code shared by native Solana events.
|
||||
pub(crate) const PROTOCOL_CODE: &str = "solana_native";
|
||||
/// Stable System Program surface code.
|
||||
pub(crate) const SYSTEM_SURFACE_CODE: &str = "solana_native_system";
|
||||
/// Stable deprecated immutable BPF Loader surface code.
|
||||
pub(crate) const BPF_LOADER_DEPRECATED_SURFACE_CODE: &str = "solana_native_bpf_loader_deprecated";
|
||||
/// Stable immutable BPF Loader v2 surface code.
|
||||
pub(crate) const BPF_LOADER_SURFACE_CODE: &str = "solana_native_bpf_loader";
|
||||
/// Stable upgradeable BPF Loader surface code.
|
||||
pub(crate) const BPF_LOADER_UPGRADEABLE_SURFACE_CODE: &str = "solana_native_bpf_loader_upgradeable";
|
||||
/// Stable Loader v4 surface code.
|
||||
pub(crate) const LOADER_V4_SURFACE_CODE: &str = "solana_native_loader_v4";
|
||||
/// Stable Native Loader surface code.
|
||||
pub(crate) const NATIVE_LOADER_SURFACE_CODE: &str = "solana_native_loader";
|
||||
/// Stable Compute Budget surface code.
|
||||
pub(crate) const COMPUTE_BUDGET_SURFACE_CODE: &str = "solana_native_compute_budget";
|
||||
/// Stable Address Lookup Table surface code.
|
||||
pub(crate) const ADDRESS_LOOKUP_TABLE_SURFACE_CODE: &str = "solana_native_address_lookup_table";
|
||||
/// Stable Vote Program surface code.
|
||||
pub(crate) const VOTE_SURFACE_CODE: &str = "solana_native_vote";
|
||||
/// Stable Stake Program surface code.
|
||||
pub(crate) const STAKE_SURFACE_CODE: &str = "solana_native_stake";
|
||||
/// Stable Config Program surface code.
|
||||
pub(crate) const CONFIG_SURFACE_CODE: &str = "solana_native_config";
|
||||
/// Stable Feature Gate surface code.
|
||||
pub(crate) const FEATURE_SURFACE_CODE: &str = "solana_native_feature";
|
||||
/// Stable Ed25519 signature precompile surface code.
|
||||
pub(crate) const ED25519_SURFACE_CODE: &str = "solana_native_ed25519";
|
||||
/// Stable secp256k1 signature precompile surface code.
|
||||
pub(crate) const SECP256K1_SURFACE_CODE: &str = "solana_native_secp256k1";
|
||||
/// Stable secp256r1 signature precompile surface code.
|
||||
pub(crate) const SECP256R1_SURFACE_CODE: &str = "solana_native_secp256r1";
|
||||
/// Stable native ZK ElGamal Proof surface code.
|
||||
pub(crate) const ZK_ELGAMAL_PROOF_SURFACE_CODE: &str = "solana_native_zk_elgamal_proof";
|
||||
/// Stable historical ZK Token Proof surface code.
|
||||
pub(crate) const ZK_TOKEN_PROOF_SURFACE_CODE: &str = "solana_native_zk_token_proof";
|
||||
/// Byte length shared by compact Ed25519, secp256k1 and secp256r1 signatures.
|
||||
pub(crate) const SIGNATURE_BYTES: usize = 64;
|
||||
/// Byte length of an Ed25519 public key.
|
||||
pub(crate) const ED25519_PUBLIC_KEY_BYTES: usize = 32;
|
||||
/// Byte length of a compressed secp256r1 public key.
|
||||
pub(crate) const SECP256R1_PUBLIC_KEY_BYTES: usize = 33;
|
||||
/// Byte length of a secp256k1 Ethereum address.
|
||||
pub(crate) const SECP256K1_ETHEREUM_ADDRESS_BYTES: usize = 20;
|
||||
/// Byte length of one Ed25519 or secp256r1 offsets entry.
|
||||
pub(crate) const U16_OFFSETS_BYTES: usize = 14;
|
||||
/// Byte length of one secp256k1 offsets entry.
|
||||
pub(crate) const U8_OFFSETS_BYTES: usize = 11;
|
||||
/// Stable Slashing Program decoder surface code.
|
||||
pub(crate) const SLASHING_SURFACE_CODE: &str = "solana_native_slashing";
|
||||
/// Runtime maximum number of secp256r1 signatures in one precompile instruction.
|
||||
pub(crate) const SECP256R1_MAX_SIGNATURES: usize = 8;
|
||||
/// Maximum number of component bytes retained as a hexadecimal event prefix.
|
||||
pub(crate) const PRECOMPILE_COMPONENT_PREFIX_BYTES: usize = 16;
|
||||
/// Maximum retained native instruction payload accepted by the first decoder phase.
|
||||
pub(crate) const MAX_NATIVE_INSTRUCTION_PAYLOAD_BYTES: usize = 4_096;
|
||||
/// Current native event payload contract version.
|
||||
pub(crate) const NATIVE_EVENT_VERSION: u32 = 1;
|
||||
|
||||
/// Canonical tracing target for the Solana Core decoder component.
|
||||
pub(crate) const TRACING_TARGET: &str = "kb-lib.decoder.solana.core";
|
||||
Reference in New Issue
Block a user