Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
d24d23a
chore(svm-sdk): [DROPPABLE] inject fee program bytes from xeno/sealev…
xeno097 Apr 21, 2026
aca9374
feat(svm-sdk): add fee program PDA derivation functions
xeno097 Apr 21, 2026
9b97c67
feat(svm-sdk): add fee SDK types, constants, and signer helpers
xeno097 Apr 21, 2026
a9aa7e1
feat(svm-sdk): add fee codec types and Borsh encoding functions
xeno097 Apr 21, 2026
43cb049
feat(svm-sdk): add fee account decoders and i64 codec support
xeno097 Apr 21, 2026
2e26b77
feat(svm-sdk): add fee instruction builders for Leaf management
xeno097 Apr 21, 2026
4cd180c
feat(svm-sdk): add fee account query helpers and type detection
xeno097 Apr 21, 2026
ff9f367
feat(svm-sdk): add linear fee reader and writer
xeno097 Apr 21, 2026
07b041a
feat(svm-sdk): add linear fee E2E tests
xeno097 Apr 21, 2026
5b205ee
feat(svm-sdk): extract leaf fee base and add regressive fee reader/wr…
xeno097 Apr 21, 2026
fef07e8
feat(svm-sdk): add shared leaf fee test suite and regressive fee E2E …
xeno097 Apr 21, 2026
1a8515a
feat(svm-sdk): add progressive fee reader/writer and E2E tests
xeno097 Apr 21, 2026
0410f41
feat(svm-sdk): add AddQuoteSigner and RemoveQuoteSigner instruction b…
xeno097 Apr 21, 2026
3f76710
feat(svm-sdk): add offchainQuotedLinear fee reader and writer
xeno097 Apr 21, 2026
a5ec941
feat(svm-sdk): add offchainQuotedLinear fee E2E tests
xeno097 Apr 21, 2026
d8cc8bd
feat(svm-sdk): add SetRoute, RemoveRoute, and SetWildcardQuoteSigners…
xeno097 Apr 21, 2026
088d6b8
feat(svm-sdk): add fetchRouteDomain query helper
xeno097 Apr 21, 2026
dd22e00
feat(svm-sdk): add routing fee reader and writer
xeno097 Apr 21, 2026
3947b12
feat(svm-sdk): add routing fee E2E tests
xeno097 Apr 21, 2026
128c08d
feat(svm-sdk): add SetCrossCollateralRoute and RemoveCrossCollateralR…
xeno097 Apr 21, 2026
1817fa1
feat(svm-sdk): add fetchCrossCollateralRoute query helper
xeno097 Apr 21, 2026
e67c833
feat(svm-sdk): add cross-collateral routing fee reader/writer and ext…
xeno097 Apr 21, 2026
18304a2
feat(svm-sdk): add cross-collateral routing fee E2E tests
xeno097 Apr 21, 2026
7e1630f
feat(svm-sdk): add runtime fee instruction builders
xeno097 Apr 21, 2026
a728d74
feat(svm-sdk): add SvmFeeArtifactManager
xeno097 Apr 21, 2026
ffd4f0c
feat(svm-sdk): wire SvmFeeArtifactManager into protocol provider and …
xeno097 Apr 21, 2026
dece6a6
feat(svm-sdk): add fee stress tests to discover on-chain limits
xeno097 Apr 21, 2026
0598a74
feat(svm-sdk): add fee stress tests to discover on-chain limits
xeno097 Apr 21, 2026
709a33f
fix(svm-sdk): address code review findings on fee SDK
xeno097 Apr 21, 2026
c4f3efe
fix(provider-sdk, deploy-sdk, svm-sdk): thread FeeReadContext through…
xeno097 Apr 21, 2026
769eab2
chore: add changeset for SVM fee SDK support
xeno097 Apr 21, 2026
ed0247b
test(svm-sdk): add test for removing last signer preserving offchainQ…
xeno097 Apr 21, 2026
ac0459c
ci: add fee E2E tests to SVM SDK CI matrix
xeno097 Apr 21, 2026
22a40cd
fix(svm-sdk): address PR review comments
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
20 changes: 20 additions & 0 deletions .changeset/svm-fee-sdk-support.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
'@hyperlane-xyz/provider-sdk': major
'@hyperlane-xyz/deploy-sdk': major
'@hyperlane-xyz/sealevel-sdk': minor
'@hyperlane-xyz/aleo-sdk': patch
'@hyperlane-xyz/cosmos-sdk': patch
'@hyperlane-xyz/radix-sdk': patch
'@hyperlane-xyz/starknet-core': patch
'@hyperlane-xyz/tron-sdk': patch
---

SVM fee program SDK support was added, enabling deployment and management of all 6 fee types (linear, regressive, progressive, offchainQuotedLinear, routing, crossCollateralRouting) on Solana/SVM chains.

**Breaking change:** `ProtocolProvider.createFeeArtifactManager()` now requires a `FeeReadContext` parameter. This ensures routed fee types (routing, CC routing) receive the domain/router context needed to discover non-enumerable route PDAs. All protocol SDK implementations were updated.

The SVM fee SDK includes:
- Readers and writers for all 6 fee types with full create/update support.
- Instruction builders for all 18 fee program instructions including runtime operations (QuoteFee, SubmitQuote, etc.).
- PDA derivation, Borsh codecs, and account decoders for the fee program's on-chain state.
- SvmFeeArtifactManager implementing IRawFeeArtifactManager, wired into SvmProtocolProvider.
6 changes: 6 additions & 0 deletions .github/workflows/test-sdk-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,12 @@ jobs:
- cross-collateral-token
- provider
- read-token
- fee-linear
- fee-regressive
- fee-progressive
- fee-offchain-quoted-linear
- fee-routing
- fee-cross-collateral-routing
include:
- test: read-token
continue-on-error: true
Expand Down
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

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

6 changes: 5 additions & 1 deletion typescript/aleo-sdk/src/clients/protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ import {
type TxReceipt,
} from '@hyperlane-xyz/provider-sdk/module';
import { type IRawWarpArtifactManager } from '@hyperlane-xyz/provider-sdk/warp';
import { type IRawFeeArtifactManager } from '@hyperlane-xyz/provider-sdk/fee';
import {
type FeeReadContext,
type IRawFeeArtifactManager,
} from '@hyperlane-xyz/provider-sdk/fee';
import { type IRawValidatorAnnounceArtifactManager } from '@hyperlane-xyz/provider-sdk/validator-announce';
import { assert } from '@hyperlane-xyz/utils';

Expand Down Expand Up @@ -193,6 +196,7 @@ export class AleoProtocolProvider implements ProtocolProvider {

createFeeArtifactManager(
_chainMetadata: ChainMetadataForAltVM,
_context: FeeReadContext,
): IRawFeeArtifactManager | null {
return null;
}
Expand Down
6 changes: 5 additions & 1 deletion typescript/cosmos-sdk/src/clients/protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ import {
type TxReceipt,
} from '@hyperlane-xyz/provider-sdk/module';
import { type IRawWarpArtifactManager } from '@hyperlane-xyz/provider-sdk/warp';
import { type IRawFeeArtifactManager } from '@hyperlane-xyz/provider-sdk/fee';
import {
type FeeReadContext,
type IRawFeeArtifactManager,
} from '@hyperlane-xyz/provider-sdk/fee';
import { type IRawValidatorAnnounceArtifactManager } from '@hyperlane-xyz/provider-sdk/validator-announce';
import { assert } from '@hyperlane-xyz/utils';

Expand Down Expand Up @@ -121,6 +124,7 @@ export class CosmosNativeProtocolProvider implements ProtocolProvider {

createFeeArtifactManager(
_chainMetadata: ChainMetadataForAltVM,
_context: FeeReadContext,
): IRawFeeArtifactManager | null {
return null;
}
Expand Down
2 changes: 1 addition & 1 deletion typescript/deploy-sdk/src/fee/fee-reader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function createFeeReader(
): FeeReader | null {
const protocolProvider = getProtocolProvider(chainMetadata.protocol);
const artifactManager: IRawFeeArtifactManager | null =
protocolProvider.createFeeArtifactManager(chainMetadata);
protocolProvider.createFeeArtifactManager(chainMetadata, context);

if (!artifactManager) {
return null;
Expand Down
2 changes: 1 addition & 1 deletion typescript/deploy-sdk/src/fee/fee-writer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function createFeeWriter(
): FeeWriter | null {
const protocolProvider = getProtocolProvider(chainMetadata.protocol);
const artifactManager: IRawFeeArtifactManager | null =
protocolProvider.createFeeArtifactManager(chainMetadata);
protocolProvider.createFeeArtifactManager(chainMetadata, context);

if (!artifactManager) {
return null;
Expand Down
4 changes: 3 additions & 1 deletion typescript/provider-sdk/src/protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
JsonRpcSubmitterConfig,
TransactionSubmitterConfig,
} from './submitter.js';
import { IRawFeeArtifactManager } from './fee.js';
import { type FeeReadContext, IRawFeeArtifactManager } from './fee.js';
import { IRawWarpArtifactManager } from './warp.js';
import { IRawValidatorAnnounceArtifactManager } from './validator-announce.js';

Expand Down Expand Up @@ -112,10 +112,12 @@ export interface ProtocolProvider {
* Not all protocols support fee programs.
*
* @param chainMetadata Chain metadata for the target chain
* @param context Fee read context with known domains and routers for non-enumerable route discovery
* @returns A protocol-specific Fee artifact manager, or null if not supported
*/
createFeeArtifactManager(
chainMetadata: ChainMetadataForAltVM,
context: FeeReadContext,
): IRawFeeArtifactManager | null;

getMinGas(): MinimumRequiredGasByAction;
Expand Down
6 changes: 5 additions & 1 deletion typescript/radix-sdk/src/clients/protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ import { IRawHookArtifactManager } from '@hyperlane-xyz/provider-sdk/hook';
import { IRawIsmArtifactManager } from '@hyperlane-xyz/provider-sdk/ism';
import { IRawMailboxArtifactManager } from '@hyperlane-xyz/provider-sdk/mailbox';
import { AnnotatedTx, TxReceipt } from '@hyperlane-xyz/provider-sdk/module';
import { IRawFeeArtifactManager } from '@hyperlane-xyz/provider-sdk/fee';
import {
FeeReadContext,
IRawFeeArtifactManager,
} from '@hyperlane-xyz/provider-sdk/fee';
import { IRawValidatorAnnounceArtifactManager } from '@hyperlane-xyz/provider-sdk/validator-announce';
import { IRawWarpArtifactManager } from '@hyperlane-xyz/provider-sdk/warp';
import { assert } from '@hyperlane-xyz/utils';
Expand Down Expand Up @@ -114,6 +117,7 @@ export class RadixProtocolProvider implements ProtocolProvider {

createFeeArtifactManager(
_chainMetadata: ChainMetadataForAltVM,
_context: FeeReadContext,
): IRawFeeArtifactManager | null {
return null;
}
Expand Down
6 changes: 5 additions & 1 deletion typescript/starknet-sdk/src/clients/protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ import { IRawHookArtifactManager } from '@hyperlane-xyz/provider-sdk/hook';
import { IRawIsmArtifactManager } from '@hyperlane-xyz/provider-sdk/ism';
import { IRawMailboxArtifactManager } from '@hyperlane-xyz/provider-sdk/mailbox';
import { AnnotatedTx, TxReceipt } from '@hyperlane-xyz/provider-sdk/module';
import { IRawFeeArtifactManager } from '@hyperlane-xyz/provider-sdk/fee';
import {
FeeReadContext,
IRawFeeArtifactManager,
} from '@hyperlane-xyz/provider-sdk/fee';
import { IRawValidatorAnnounceArtifactManager } from '@hyperlane-xyz/provider-sdk/validator-announce';
import { IRawWarpArtifactManager } from '@hyperlane-xyz/provider-sdk/warp';
import { assert } from '@hyperlane-xyz/utils';
Expand Down Expand Up @@ -93,6 +96,7 @@ export class StarknetProtocolProvider implements ProtocolProvider {

createFeeArtifactManager(
_chainMetadata: ChainMetadataForAltVM,
_context: FeeReadContext,
): IRawFeeArtifactManager | null {
return null;
}
Expand Down
1 change: 1 addition & 0 deletions typescript/svm-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
},
"devDependencies": {
"@hyperlane-xyz/tsconfig": "workspace:^",
"@noble/curves": "^1.7.0",
"@types/chai": "^4.3.14",
"@types/chai-as-promised": "catalog:",
"@types/mocha": "^10.0.6",
Expand Down
20 changes: 14 additions & 6 deletions typescript/svm-sdk/scripts/generate-program-bytes.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);

const PROGRAMS_DIR = join(__dirname, '../../../rust/sealevel/target/deploy');
const LOCAL_SO_DIR = join(__dirname, '../so-binaries');
const OUTPUT_FILE = join(__dirname, '../src/hyperlane/program-bytes.ts');

/** All Sealevel programs — keys match PROGRAM_BINARIES in testing/setup.ts. */
Expand All @@ -24,22 +25,29 @@ const PROGRAMS = {
tokenNative: 'hyperlane_sealevel_token_native.so',
tokenCollateral: 'hyperlane_sealevel_token_collateral.so',
tokenCrossCollateral: 'hyperlane_sealevel_token_cross_collateral.so',
tokenFee: 'hyperlane_sealevel_fee.so',
};

console.log('🔧 Generating program bytes from .so files...\n');

const programBytes = {};

for (const [key, filename] of Object.entries(PROGRAMS)) {
const path = join(PROGRAMS_DIR, filename);
const primaryPath = join(PROGRAMS_DIR, filename);
const fallbackPath = join(LOCAL_SO_DIR, filename);
let bytes;
try {
const bytes = readFileSync(path);
programBytes[key] = Array.from(bytes);
console.log(` ✅ ${key}: ${bytes.length.toLocaleString()} bytes`);
bytes = readFileSync(primaryPath);
} catch {
console.error(` ❌ ${key}: required .so file not found at ${path}`);
process.exit(1);
try {
bytes = readFileSync(fallbackPath);
} catch {
console.error(` ❌ ${key}: .so not found at ${primaryPath} or ${fallbackPath}`);
process.exit(1);
}
}
Comment on lines +36 to 48
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚩 Fee program binary added to program-bytes generator with fallback path mechanism

In scripts/generate-program-bytes.mjs, the new tokenFee entry was added at line 28, and lines 36-48 introduce a fallback mechanism that checks LOCAL_SO_DIR (so-binaries/) when the primary path (rust/sealevel/target/deploy/) doesn't have the binary. This is a deviation from the existing pattern where all programs came from the same build directory. The fallback could mask build issues if a stale local binary is used instead of a freshly compiled one. The check-program-bytes-hash.mjs script should catch staleness via the source hash, but only if it covers the fee program sources.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

programBytes[key] = Array.from(bytes);
console.log(` ✅ ${key}: ${bytes.length.toLocaleString()} bytes`);
}

const sourceHash = computeSealevelSourceHash();
Expand Down
Binary file not shown.
Loading
Loading