Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
c0168af
feat(svm): add package-versioned library crate
xeno097 Apr 16, 2026
556268b
feat(svm): add fee program crate with fee math types and curve comput…
xeno097 Apr 16, 2026
629d08e
feat(svm): add fee account structures, PDA seeds, and discriminators
xeno097 Apr 16, 2026
73e763d
feat(svm): add fee instruction enum and builder functions
xeno097 Apr 16, 2026
e5a59f1
feat(svm): add fee processor with InitFee and owner management
xeno097 Apr 16, 2026
3adadfa
feat(svm): add SetRoute, RemoveRoute handlers and functional tests
xeno097 Apr 16, 2026
545f3cb
feat(svm): add SetCrossCollateralRoute and RemoveCrossCollateralRoute
xeno097 Apr 16, 2026
d0863a4
feat(svm): add QuoteFee on-chain handler with Leaf, Routing, and CC c…
xeno097 Apr 16, 2026
5d35d0c
feat(svm): add quote-verifier shared library crate
xeno097 Apr 16, 2026
32c85b3
feat(svm): add signer management and SetMinIssuedAt handlers
xeno097 Apr 16, 2026
7287a0c
feat(svm): add SubmitQuote handler for transient quotes
xeno097 Apr 16, 2026
4649b3e
fix(svm): add missing is_signer check on QuoteFee payer account
xeno097 Apr 16, 2026
4db7b29
feat(svm): implement QuoteFee transient quote consumption and autoclose
xeno097 Apr 16, 2026
c37879b
feat(svm): add SubmitQuote handler for standing quotes
xeno097 Apr 16, 2026
d471e81
feat(svm): implement QuoteFee standing quote cascade with fee assertions
xeno097 Apr 16, 2026
f4f1cd6
feat(svm): add CloseTransientQuote, PruneExpiredQuotes handlers
xeno097 Apr 16, 2026
9b85b62
feat(svm): add GetQuoteAccountMetas simulation instruction
xeno097 Apr 17, 2026
375c467
feat(svm): add GetProgramVersion to fee program
xeno097 Apr 17, 2026
f6ac000
fix(svm): re-derive standing quote PDA to prevent spoofing
xeno097 Apr 17, 2026
8c74d0e
fix(svm): use resize(0) in close_pda to match canonical Solana pattern
xeno097 Apr 17, 2026
226d17a
fix(svm): reject fully-wildcarded standing quotes
xeno097 Apr 17, 2026
d9d1016
fix(svm): use raw u64 LE bytes for QuoteFee return data
xeno097 Apr 17, 2026
e2eab72
fix(svm): GetQuoteAccountMetas returns full account list with prefix
xeno097 Apr 17, 2026
5a68edb
fix(svm): make CC standing quotes route-bound via target_router in PD…
xeno097 Apr 17, 2026
89b61a4
fix(svm): reject reserved domain values in SetRoute and SetCrossColla…
xeno097 Apr 17, 2026
9631f32
docs(svm): fix QuoteFee transient PDA account label to [writable]
xeno097 Apr 17, 2026
30a828a
fix(svm): reject DEFAULT_ROUTER as target_router in CC standing quotes
xeno097 Apr 17, 2026
ca470bc
refactor(svm): align fee program with monorepo conventions
xeno097 Apr 17, 2026
37cb800
perf(svm): cache Clock and Rent syscalls to reduce compute units
xeno097 Apr 17, 2026
cdcf73b
fix(svm): audit fixes — eliminate hardcoded indices, optimize transie…
xeno097 Apr 17, 2026
14a1295
test(svm): add 8 CC/standing/transient coverage tests, extract remain…
xeno097 Apr 17, 2026
6be181d
feat(svm): add missing instruction builders and admin/owner rejection…
xeno097 Apr 17, 2026
23bb74e
refactor(svm): dedup test helpers by delegating to instruction builders
xeno097 Apr 17, 2026
02873a3
fix(svm): skip standing_quote_domains tracking for CC fee accounts
xeno097 Apr 17, 2026
67afd38
fix(svm): return zero fee for unconfigured routing domains (EVM parity)
xeno097 Apr 17, 2026
523993d
fix(svm): reject quotes with issued_at too far in the future
xeno097 Apr 17, 2026
9b9c3d2
refactor(svm): standardize PDA seed separators and route owner check
xeno097 Apr 17, 2026
0c73a4e
docs(svm): enable #![deny(missing_docs)] and add all doc comments
xeno097 Apr 17, 2026
543eabd
refactor(svm): change FeeAccount.signers to Option<BTreeSet<H160>>
xeno097 Apr 18, 2026
8003149
refactor(svm): add optional signer sets to RouteDomain and CrossColla…
xeno097 Apr 18, 2026
2cc9649
refactor(svm): add signers field to InitFee instruction
xeno097 Apr 18, 2026
1fc886a
feat(svm): route-scoped signer auth for SubmitQuote and signer manage…
xeno097 Apr 18, 2026
db1ea44
test(svm): add regression test for standing quote lifecycle after sig…
xeno097 Apr 18, 2026
418216d
feat(svm): add GetSubmitQuoteAccountMetas simulation instruction
xeno097 Apr 18, 2026
9c29fc1
refactor(svm): move signer config into FeeData variant-specific structs
xeno097 Apr 19, 2026
55e83d5
feat(svm): add SetWildcardQuoteSigners instruction
xeno097 Apr 19, 2026
0ad70d8
fix(svm): secure wildcard domain signer auth and fix builder writability
xeno097 Apr 19, 2026
b182f2f
refactor(svm): make wildcard_signers mandatory and fix error semantics
xeno097 Apr 19, 2026
31c0044
fix(svm): harden CC signer resolution and fix helper writability
xeno097 Apr 19, 2026
1520659
refactor(svm): restructure fee program test suite
xeno097 Apr 20, 2026
de4ad24
fix(svm): bind quotes to strategy curve type via StrategyTag
xeno097 Apr 20, 2026
4041875
refactor(svm): simplify resolve_cc_routing with for loop
xeno097 Apr 20, 2026
efa23d3
refactor(svm): unify quote validation via ValidatableQuote trait
xeno097 Apr 20, 2026
62a608c
refactor(svm): simplify standing quote cascade with for loop
xeno097 Apr 20, 2026
58d4580
fix(svm): validate fee account writability for non-CC standing quotes
xeno097 Apr 20, 2026
5e31bba
fix(svm): use InvalidArgument for PDA key mismatches
xeno097 Apr 20, 2026
c8b7338
fix(svm): reject wildcard transient quotes for routed modes and fix C…
xeno097 Apr 20, 2026
c95e492
fix(svm): bind CC standing quotes to auth provenance
xeno097 Apr 20, 2026
f29d5ee
refactor(svm): use universal discriminator for GetProgramVersion
xeno097 Apr 20, 2026
88532ec
chore(svm): add fee program to build and SDK scripts
xeno097 Apr 20, 2026
854bb09
fix(svm): PR review fixes — monotonic min_issued_at, transient revoca…
xeno097 Apr 22, 2026
d7d05a6
refactor(sealevel): derive fee owner from init signer
xeno097 Apr 22, 2026
fdcf014
refactor(svm): remove dead system_program account from 5 fee handlers
xeno097 Apr 22, 2026
49e85e8
refactor(svm): deduplicate set/remove route handlers via shared helpers
xeno097 Apr 22, 2026
886177c
chore: sync program bytes
xeno097 Apr 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions rust/sealevel/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions rust/sealevel/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@ members = [
"libraries/interchain-security-module-interface",
"libraries/message-recipient-interface",
"libraries/multisig-ism",
"libraries/package-versioned",
"libraries/quote-verifier",
"libraries/serializable-account-meta",
"libraries/test-transaction-utils",
"libraries/test-utils",
"programs/hyperlane-sealevel-fee",
"programs/hyperlane-sealevel-igp",
"programs/hyperlane-sealevel-igp-test",
"programs/hyperlane-sealevel-token",
Expand Down Expand Up @@ -183,9 +186,15 @@ overflow-checks = true
[profile.release.package.multisig-ism]
overflow-checks = true

[profile.release.package.package-versioned]
overflow-checks = true

[profile.release.package.serializable-account-meta]
overflow-checks = true

[profile.release.package.quote-verifier]
overflow-checks = true

[profile.release.package.hyperlane-test-transaction-utils]
overflow-checks = true

Expand All @@ -195,6 +204,9 @@ overflow-checks = true
[profile.release.package.hyperlane-sealevel-mailbox]
overflow-checks = true

[profile.release.package.hyperlane-sealevel-fee]
overflow-checks = true

[profile.release.package.hyperlane-sealevel-igp]
overflow-checks = true

Expand Down
14 changes: 14 additions & 0 deletions rust/sealevel/libraries/package-versioned/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
cargo-features = ["workspace-inheritance"]

[package]
name = "package-versioned"
version = "0.1.0"
edition = "2021"

[dependencies]
borsh.workspace = true
serializable-account-meta = { path = "../serializable-account-meta" }
solana-program.workspace = true

[lib]
crate-type = ["cdylib", "lib"]
43 changes: 43 additions & 0 deletions rust/sealevel/libraries/package-versioned/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
use serializable_account_meta::SimulationReturnData;
use solana_program::{program::set_return_data, program_error::ProgramError};

/// Single source of truth for all Hyperlane SVM program versions.
/// Compiled into each program's binary — atomic on upgrade, no migration step.
pub const PACKAGE_VERSION: &str = "1.0.0";

/// Trait for programs that expose their version.
/// Programs implement with empty impl block to get the default.
pub trait PackageVersioned {
fn package_version() -> &'static str {
PACKAGE_VERSION
}
}

/// 8-byte discriminator for the `GetProgramVersion` instruction.
/// First 8 bytes of `sha256(b"hyperlane:get-program-version")`.
/// This is independent of any program's instruction enum, allowing
/// universal version queries across all Hyperlane SVM programs.
pub const GET_PROGRAM_VERSION_DISCRIMINATOR: [u8; 8] = [150, 230, 176, 162, 236, 96, 183, 171];

/// Attempts to decode a `GetProgramVersion` instruction from raw instruction data.
/// Returns true if the data matches the discriminator, false otherwise.
pub fn is_get_program_version(instruction_data: &[u8]) -> bool {
instruction_data.len() == GET_PROGRAM_VERSION_DISCRIMINATOR.len()
&& instruction_data == GET_PROGRAM_VERSION_DISCRIMINATOR
}

/// Builds the instruction data for a `GetProgramVersion` call.
pub fn get_program_version_instruction_data() -> Vec<u8> {
GET_PROGRAM_VERSION_DISCRIMINATOR.to_vec()
}

/// Shared handler for the `GetProgramVersion` instruction.
/// Writes the version string as return data wrapped in SimulationReturnData.
pub fn process_get_program_version<T: PackageVersioned>() -> Result<(), ProgramError> {
let version = T::package_version();
set_return_data(
&borsh::to_vec(&SimulationReturnData::new(version.to_string()))
.map_err(|_| ProgramError::BorshIoError)?,
);
Ok(())
}
26 changes: 26 additions & 0 deletions rust/sealevel/libraries/quote-verifier/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
cargo-features = ["workspace-inheritance"]

[package]
name = "quote-verifier"
version = "0.1.0"
edition = "2021"

[dependencies]
borsh.workspace = true
ecdsa-signature = { path = "../ecdsa-signature" }
hyperlane-core = { path = "../../../main/hyperlane-core" }
solana-program.workspace = true
thiserror.workspace = true
# Required to allow dependencies `getrandom` but to preserve determinism required by programs, see
# https://solana.com/news/rust-to-solana
getrandom = { workspace = true, features = ["custom"] }

[dev-dependencies]
k256.workspace = true
rand.workspace = true

[lints]
workspace = true

[lib]
crate-type = ["cdylib", "lib"]
Loading
Loading