0.1.0-pre.004

This commit is contained in:
2026-07-23 18:25:10 +02:00
parent 0da75c1311
commit 149d4c6ef6
85 changed files with 25696 additions and 227 deletions

View File

@@ -1,5 +1,5 @@
// file: kb-lib/src/lib.rs
// version: 3
// version: 6
//! Consolidated decoder, executor, materializer and shared model library.
#![warn(missing_docs)]
@@ -11,10 +11,179 @@ pub mod executor;
pub mod materializer;
pub mod model;
/// Canonical tracing target for the consolidated library.
pub(crate) use crate::decoder::api::constants::TRACING_TARGET;
/// Stable Address Lookup Table surface code.
pub(crate) use crate::decoder::solana::SOLANA_CORE_ADDRESS_LOOKUP_TABLE_SURFACE_CODE;
/// Stable deprecated immutable BPF Loader surface code.
pub(crate) use crate::decoder::solana::SOLANA_CORE_BPF_LOADER_DEPRECATED_SURFACE_CODE;
/// Stable immutable BPF Loader v2 surface code.
pub(crate) use crate::decoder::solana::SOLANA_CORE_BPF_LOADER_SURFACE_CODE;
/// Stable upgradeable BPF Loader surface code.
pub(crate) use crate::decoder::solana::SOLANA_CORE_BPF_LOADER_UPGRADEABLE_SURFACE_CODE;
/// Stable Compute Budget surface code.
pub(crate) use crate::decoder::solana::SOLANA_CORE_COMPUTE_BUDGET_SURFACE_CODE;
/// Stable Config Program surface code.
pub(crate) use crate::decoder::solana::SOLANA_CORE_CONFIG_SURFACE_CODE;
/// Byte length of an Ed25519 public key.
pub(crate) use crate::decoder::solana::SOLANA_CORE_ED25519_PUBLIC_KEY_BYTES;
/// Stable Ed25519 signature precompile surface code.
pub(crate) use crate::decoder::solana::SOLANA_CORE_ED25519_SURFACE_CODE;
/// Stable Feature Gate surface code.
pub(crate) use crate::decoder::solana::SOLANA_CORE_FEATURE_SURFACE_CODE;
/// Stable Loader v4 surface code.
pub(crate) use crate::decoder::solana::SOLANA_CORE_LOADER_V4_SURFACE_CODE;
/// Maximum retained native instruction payload accepted by the first decoder phase.
pub(crate) use crate::decoder::solana::SOLANA_CORE_MAX_NATIVE_INSTRUCTION_PAYLOAD_BYTES;
/// Current native event payload contract version.
pub(crate) use crate::decoder::solana::SOLANA_CORE_NATIVE_EVENT_VERSION;
/// Stable Native Loader surface code.
pub(crate) use crate::decoder::solana::SOLANA_CORE_NATIVE_LOADER_SURFACE_CODE;
/// Maximum number of component bytes retained as a hexadecimal event prefix.
pub(crate) use crate::decoder::solana::SOLANA_CORE_PRECOMPILE_COMPONENT_PREFIX_BYTES;
/// Expected role and privileges for one positional instruction account.
pub(crate) use crate::decoder::solana::SolanaCoreAccountRole;
/// Returns declared Address Lookup Table instruction coverage.
pub(crate) use crate::decoder::solana::solana_core_address_lookup_table_coverage;
/// Decodes one Address Lookup Table instruction.
pub(crate) use crate::decoder::solana::solana_core_address_lookup_table_decode;
/// Recognizes one Address Lookup Table instruction without producing an event.
pub(crate) use crate::decoder::solana::solana_core_address_lookup_table_recognize;
/// Returns declared Compute Budget instruction coverage.
pub(crate) use crate::decoder::solana::solana_core_compute_budget_coverage;
/// Decodes one Compute Budget instruction.
pub(crate) use crate::decoder::solana::solana_core_compute_budget_decode;
/// Recognizes one Compute Budget instruction without producing an event.
pub(crate) use crate::decoder::solana::solana_core_compute_budget_recognize;
/// Returns declared Config Program instruction coverage.
pub(crate) use crate::decoder::solana::solana_core_config_coverage;
/// Decodes one generic Config Program store instruction.
pub(crate) use crate::decoder::solana::solana_core_config_decode;
/// Recognizes one generic Config Program store instruction.
pub(crate) use crate::decoder::solana::solana_core_config_recognize;
/// Resolves positional instruction accounts and validates their core indexes.
pub(crate) use crate::decoder::solana::solana_core_resolve_accounts;
/// Stable protocol code shared by native Solana events.
pub(crate) use crate::decoder::solana::SOLANA_CORE_PROTOCOL_CODE;
/// Byte length of a secp256k1 Ethereum address.
pub(crate) use crate::decoder::solana::SOLANA_CORE_SECP256K1_ETHEREUM_ADDRESS_BYTES;
/// Stable secp256k1 signature precompile surface code.
pub(crate) use crate::decoder::solana::SOLANA_CORE_SECP256K1_SURFACE_CODE;
/// Runtime maximum number of secp256r1 signatures in one precompile instruction.
pub(crate) use crate::decoder::solana::SOLANA_CORE_SECP256R1_MAX_SIGNATURES;
/// Byte length of a compressed secp256r1 public key.
pub(crate) use crate::decoder::solana::SOLANA_CORE_SECP256R1_PUBLIC_KEY_BYTES;
/// Stable secp256r1 signature precompile surface code.
pub(crate) use crate::decoder::solana::SOLANA_CORE_SECP256R1_SURFACE_CODE;
/// Byte length shared by compact Ed25519, secp256k1 and secp256r1 signatures.
pub(crate) use crate::decoder::solana::SOLANA_CORE_SIGNATURE_BYTES;
/// Stable Slashing Program decoder surface code.
pub(crate) use crate::decoder::solana::SOLANA_CORE_SLASHING_SURFACE_CODE;
/// Stable Stake Program surface code.
pub(crate) use crate::decoder::solana::SOLANA_CORE_STAKE_SURFACE_CODE;
/// Stable System Program surface code.
pub(crate) use crate::decoder::solana::SOLANA_CORE_SYSTEM_SURFACE_CODE;
/// Canonical tracing target for this crate.
pub(crate) use crate::decoder::solana::SOLANA_CORE_TRACING_TARGET;
/// Byte length of one secp256k1 offsets entry.
pub(crate) use crate::decoder::solana::SOLANA_CORE_U8_OFFSETS_BYTES;
/// Byte length of one Ed25519 or secp256r1 offsets entry.
pub(crate) use crate::decoder::solana::SOLANA_CORE_U16_OFFSETS_BYTES;
/// Stable Vote Program surface code.
pub(crate) use crate::decoder::solana::SOLANA_CORE_VOTE_SURFACE_CODE;
/// Stable native ZK ElGamal Proof surface code.
pub(crate) use crate::decoder::solana::SOLANA_CORE_ZK_ELGAMAL_PROOF_SURFACE_CODE;
/// Stable historical ZK Token Proof surface code.
pub(crate) use crate::decoder::solana::SOLANA_CORE_ZK_TOKEN_PROOF_SURFACE_CODE;
/// One resolved outer instruction payload and its provenance relative to the target instruction.
pub(crate) use crate::decoder::solana::SolanaCoreResolvedInstructionPayload;
/// Returns a hexadecimal prefix no longer than the available byte slice.
pub(crate) use crate::decoder::solana::solana_core_bounded_hexadecimal_prefix;
/// Extracts one exact bounded byte slice with checked arithmetic.
pub(crate) use crate::decoder::solana::solana_core_bounded_slice;
/// Decodes one retained base64 instruction payload with an explicit byte limit.
pub(crate) use crate::decoder::solana::solana_core_decode_instruction_data;
/// Returns the decoded target payload length when retained and valid.
pub(crate) use crate::decoder::solana::solana_core_decoded_payload_length;
/// Returns the SHA-256 of the decoded target instruction data when available.
pub(crate) use crate::decoder::solana::solana_core_decoded_payload_sha256;
/// Builds one exact decoded native observation.
pub(crate) use crate::decoder::solana::solana_core_decoded_result;
/// Builds one failed native decode result.
pub(crate) use crate::decoder::solana::solana_core_failed_result;
/// Returns declared Feature Gate instruction coverage.
pub(crate) use crate::decoder::solana::solana_core_feature_coverage;
/// Decodes one Feature Gate instruction.
pub(crate) use crate::decoder::solana::solana_core_feature_decode;
/// Recognizes one Feature Gate instruction without producing an event.
pub(crate) use crate::decoder::solana::solana_core_feature_recognize;
/// Returns the lowercase SHA-256 of one bounded byte slice.
pub(crate) use crate::decoder::solana::solana_core_hash_bytes;
/// Returns a normalized lowercase hexadecimal prefix.
pub(crate) use crate::decoder::solana::solana_core_hexadecimal_prefix;
/// Returns declared loader instruction coverage.
pub(crate) use crate::decoder::solana::solana_core_loaders_coverage;
/// Decodes one loader instruction.
pub(crate) use crate::decoder::solana::solana_core_loaders_decode;
/// Recognizes one loader instruction without producing an event.
pub(crate) use crate::decoder::solana::solana_core_loaders_recognize;
/// Returns a stable payload hash from core or computes it from retained JSON.
pub(crate) use crate::decoder::solana::solana_core_payload_hash;
/// Returns declared signature precompile coverage.
pub(crate) use crate::decoder::solana::solana_core_precompiles_coverage;
/// Decodes one signature precompile instruction structurally without cryptographic recomputation.
pub(crate) use crate::decoder::solana::solana_core_precompiles_decode;
/// Recognizes one signature precompile instruction without resolving referenced data.
pub(crate) use crate::decoder::solana::solana_core_precompiles_recognize;
/// Reads one little-endian `u32` from an exact byte range.
pub(crate) use crate::decoder::solana::solana_core_read_u32_le;
/// Reads one little-endian `u64` from an exact byte range.
pub(crate) use crate::decoder::solana::solana_core_read_u64_le;
/// Resolves a secp256k1 instruction reference. The runtime format has no current-instruction
/// sentinel: every `u8` value is an explicit outer instruction index.
pub(crate) use crate::decoder::solana::solana_core_resolve_u8_instruction_payload;
/// Resolves an Ed25519 or secp256r1 instruction reference using the official `u16::MAX` sentinel.
pub(crate) use crate::decoder::solana::solana_core_resolve_u16_instruction_payload;
/// Returns declared Slashing Program instruction coverage.
pub(crate) use crate::decoder::solana::solana_core_slashing_coverage;
/// Decodes one Slashing Program instruction.
pub(crate) use crate::decoder::solana::solana_core_slashing_decode;
/// Recognizes one Slashing Program instruction without producing an event.
pub(crate) use crate::decoder::solana::solana_core_slashing_recognize;
/// Returns declared Stake Program instruction coverage.
pub(crate) use crate::decoder::solana::solana_core_stake_coverage;
/// Decodes one Stake Program instruction.
pub(crate) use crate::decoder::solana::solana_core_stake_decode;
/// Recognizes one Stake Program instruction without producing an event.
pub(crate) use crate::decoder::solana::solana_core_stake_recognize;
/// Returns declared System Program instruction coverage.
pub(crate) use crate::decoder::solana::solana_core_system_coverage;
/// Decodes one System Program instruction.
pub(crate) use crate::decoder::solana::solana_core_system_decode;
/// Recognizes one System Program instruction without producing an event.
pub(crate) use crate::decoder::solana::solana_core_system_recognize;
/// Returns the numeric outer index of the target instruction.
pub(crate) use crate::decoder::solana::solana_core_target_outer_instruction_index;
/// Builds one unsupported native decode result with a bounded diagnostic.
pub(crate) use crate::decoder::solana::solana_core_unsupported_result;
/// Returns declared Vote Program instruction coverage.
pub(crate) use crate::decoder::solana::solana_core_vote_coverage;
/// Decodes one Vote Program instruction.
pub(crate) use crate::decoder::solana::solana_core_vote_decode;
/// Recognizes one Vote Program instruction without producing an event.
pub(crate) use crate::decoder::solana::solana_core_vote_recognize;
/// Returns declared ZK ElGamal Proof instruction coverage.
pub(crate) use crate::decoder::solana::solana_core_zk_elgamal_coverage;
/// Decodes one native ZK ElGamal Proof instruction without recomputing the proof.
pub(crate) use crate::decoder::solana::solana_core_zk_elgamal_decode;
/// Recognizes one native ZK ElGamal Proof instruction.
pub(crate) use crate::decoder::solana::solana_core_zk_elgamal_recognize;
/// Returns declared historical and current ZK Token Proof coverage.
pub(crate) use crate::decoder::solana::solana_core_zk_token_proof_coverage;
/// Decodes one historical ZK Token Proof layout without recomputing any proof.
pub(crate) use crate::decoder::solana::solana_core_zk_token_proof_decode;
/// Recognizes one historical ZK Token Proof layout or the current no-op runtime fallback.
pub(crate) use crate::decoder::solana::solana_core_zk_token_proof_recognize;
/// Current contextual core instruction input contract version.
pub use crate::decoder::api::contracts::CORE_INSTRUCTION_INPUT_CONTRACT_VERSION;
/// Stable contextual decoded observation.
@@ -55,6 +224,8 @@ pub use crate::decoder::api::decoder::DecoderSupport;
pub use crate::decoder::api::decoder::InitialDecoder;
/// Exposes the common protocol decoder trait.
pub use crate::decoder::api::decoder::ProtocolDecoder;
/// Runtime-native Solana decoder with maximal native instruction coverage.
pub use crate::decoder::solana::SolanaCoreDecoder;
/// Exposes the blockhash policy kind.
pub use crate::executor::api::execution::ExecutionBlockhashKind;
/// Exposes the blockhash policy.