mirror of
https://github.com/logos-blockchain/logos-execution-zone.git
synced 2026-08-26 03:41:13 +00:00
Introduces a new loader_program/loader_core crate pair implementing a Deploy instruction that claims a program's ProgramData PDA account (image_id, segment_number, update_auth, elf_segment), unifying deployment with ordinary PublicTransaction dispatch instead of the separate ProgramDeploymentTransaction path. Measured against every real program in this repo, computing a program's image_id inside the zkVM costs ~1,400-1,500 cycles per byte of deployed bytecode, pushing real deployments to 500M-900M cycles against the 32M public-execution cap (vs. ~27ms natively, since ProgramDeploymentTransaction's equivalent check runs as a plain host function today). To keep the unified dispatch path viable, Deploy is special-cased in from_public_transaction: calls targeting the reserved RESERVED_DEPLOYMENT_PROGRAM_ACCOUNT_ID run loader_core::execute_deploy natively instead of through the interpreted guest executor, wrapped in catch_unwind since the shared execute_deploy logic validates via assert!/expect() like every other guest program, relying on that boundary instead of the zkVM's own panic-to-Result conversion. The loader guest binary is kept buildable and covered by a test that runs it for real and asserts its output matches the native path exactly, so the two can't silently drift apart.
149 lines
3.8 KiB
TOML
149 lines
3.8 KiB
TOML
[package]
|
|
name = "programs"
|
|
version = "0.1.0"
|
|
edition = "2024"
|
|
license = { workspace = true }
|
|
|
|
[[bin]]
|
|
name = "amm"
|
|
path = "amm/src/main.rs"
|
|
required-features = ["programs"]
|
|
|
|
[[bin]]
|
|
name = "associated_token_account"
|
|
path = "associated_token_account/src/main.rs"
|
|
required-features = ["programs"]
|
|
|
|
[[bin]]
|
|
name = "authenticated_transfer"
|
|
path = "authenticated_transfer/src/main.rs"
|
|
required-features = ["programs"]
|
|
|
|
[[bin]]
|
|
name = "bridge"
|
|
path = "bridge/src/main.rs"
|
|
required-features = ["programs"]
|
|
|
|
[[bin]]
|
|
name = "clock"
|
|
path = "clock/src/main.rs"
|
|
required-features = ["programs"]
|
|
|
|
[[bin]]
|
|
name = "faucet"
|
|
path = "faucet/src/main.rs"
|
|
required-features = ["programs"]
|
|
|
|
[[bin]]
|
|
name = "pinata"
|
|
path = "pinata/src/main.rs"
|
|
required-features = ["programs"]
|
|
|
|
[[bin]]
|
|
name = "pinata_token"
|
|
path = "pinata_token/src/main.rs"
|
|
required-features = ["programs"]
|
|
|
|
[[bin]]
|
|
name = "token"
|
|
path = "token/src/main.rs"
|
|
required-features = ["programs"]
|
|
|
|
[[bin]]
|
|
name = "vault"
|
|
path = "vault/src/main.rs"
|
|
required-features = ["programs"]
|
|
|
|
[[bin]]
|
|
name = "cross_zone_outbox"
|
|
path = "cross_zone_outbox/src/main.rs"
|
|
required-features = ["programs"]
|
|
|
|
[[bin]]
|
|
name = "cross_zone_inbox"
|
|
path = "cross_zone_inbox/src/main.rs"
|
|
required-features = ["programs"]
|
|
|
|
[[bin]]
|
|
name = "ping_sender"
|
|
path = "ping_sender/src/main.rs"
|
|
required-features = ["programs"]
|
|
|
|
[[bin]]
|
|
name = "ping_receiver"
|
|
path = "ping_receiver/src/main.rs"
|
|
required-features = ["programs"]
|
|
|
|
[[bin]]
|
|
name = "bridge_lock"
|
|
path = "bridge_lock/src/main.rs"
|
|
required-features = ["programs"]
|
|
|
|
[[bin]]
|
|
name = "wrapped_token"
|
|
path = "wrapped_token/src/main.rs"
|
|
required-features = ["programs"]
|
|
|
|
[[bin]]
|
|
name = "loader"
|
|
path = "loader/src/main.rs"
|
|
required-features = ["programs"]
|
|
|
|
[features]
|
|
# TODO: Uncomment once https://github.com/risc0/risc0/issues/3772 is resolved.
|
|
# default = ["artifacts"]
|
|
|
|
# This feature is only usable for library target.
|
|
# Activating this will cause library to include built binary artifacts and pack them into `Program` structs.
|
|
artifacts = ["dep:build_utils", "dep:lee"]
|
|
|
|
# Import dependencies required for program binaries.
|
|
# You don't need this if you only want to use the library target.
|
|
programs = [
|
|
"dep:lee_core",
|
|
"dep:risc0-zkvm",
|
|
"dep:amm_program",
|
|
"dep:associated_token_account_program",
|
|
"dep:token_program",
|
|
"dep:amm_core",
|
|
"dep:associated_token_account_core",
|
|
"dep:authenticated_transfer_core",
|
|
"dep:bridge_core",
|
|
"dep:clock_core",
|
|
"dep:faucet_core",
|
|
"dep:token_core",
|
|
"dep:vault_core",
|
|
"dep:cross_zone_inbox_core",
|
|
"dep:cross_zone_outbox_core",
|
|
"dep:bridge_lock_core",
|
|
"dep:wrapped_token_core",
|
|
"dep:ping_core",
|
|
"dep:loader_core",
|
|
]
|
|
|
|
[dependencies]
|
|
lee = { workspace = true, optional = true }
|
|
lee_core = { workspace = true, optional = true }
|
|
risc0-zkvm = { workspace = true, optional = true }
|
|
amm_core = { workspace = true, optional = true }
|
|
associated_token_account_core = { workspace = true, optional = true }
|
|
authenticated_transfer_core = { workspace = true, optional = true }
|
|
bridge_core = { workspace = true, optional = true }
|
|
clock_core = { workspace = true, optional = true }
|
|
faucet_core = { workspace = true, optional = true }
|
|
token_core = { workspace = true, optional = true }
|
|
vault_core = { workspace = true, optional = true }
|
|
cross_zone_inbox_core = { workspace = true, optional = true }
|
|
cross_zone_outbox_core = { workspace = true, optional = true }
|
|
bridge_lock_core = { workspace = true, optional = true }
|
|
wrapped_token_core = { workspace = true, optional = true }
|
|
ping_core = { workspace = true, optional = true }
|
|
loader_core = { workspace = true, optional = true }
|
|
|
|
amm_program = { path = "amm", optional = true }
|
|
associated_token_account_program = { path = "associated_token_account", optional = true }
|
|
token_program = { path = "token", optional = true }
|
|
|
|
[build-dependencies]
|
|
build_utils = { workspace = true, optional = true }
|