Skip to content
Closed
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
c0a78b0
Support leo execute --authorization-only and --skip-proving
d0cd Sep 13, 2025
96a4635
added devnode server code
Roee-87 Oct 31, 2025
9bdaa2e
updated licenses
Roee-87 Oct 31, 2025
2f55dad
added command for advancing blocks
Roee-87 Oct 31, 2025
5a5e5a2
debugging errors
Roee-87 Nov 1, 2025
7b53849
leo devnode compiler
Roee-87 Nov 3, 2025
32be2b6
modifed start.rs to use correct path for genesis block file
Roee-87 Nov 3, 2025
f4eda07
fixed logging for devnode
Roee-87 Nov 3, 2025
8f5dce8
added default block creation to broadcast endpoint
Roee-87 Nov 3, 2025
92f076b
modified create_block handler and advance.rs to advance multiple bloc…
Roee-87 Nov 3, 2025
2e41949
added transaction check logic
Roee-87 Nov 4, 2025
7d1383f
ran cargo fmt
Roee-87 Nov 4, 2025
8c5ff5d
removed deadcode
Roee-87 Nov 4, 2025
82d97ed
ran cargo fmt
Roee-87 Nov 4, 2025
5fa7542
updated to Leo staging and snarkVM staging
Roee-87 Nov 4, 2025
cac897c
added skip-proving feature to execute.rs
Roee-87 Nov 5, 2025
f287986
added endpoint and cv 12
Roee-87 Nov 5, 2025
18facd4
added Operand::BlockTimestamp to cursor_aleo.rs
Roee-87 Nov 5, 2025
758abf2
changed default setting for txn check from false to true
Roee-87 Nov 6, 2025
d38f1fc
enabled confirmed txn endpoint and mapping data endpoint
Roee-87 Nov 6, 2025
0695769
addressed compiler warning
Roee-87 Nov 7, 2025
b7c082a
renamed genesis binary file
Roee-87 Nov 7, 2025
dca6bb5
cleanup
Roee-87 Nov 7, 2025
48bb48d
removed version.rs
Roee-87 Nov 7, 2025
ce5dbdb
updated Cargo.toml
Roee-87 Nov 7, 2025
ef8730a
addressed review comments
Roee-87 Nov 7, 2025
369bb21
replaced private_key fetch method
Roee-87 Nov 7, 2025
4a4e28c
added test_target feature back in
Roee-87 Nov 8, 2025
a6bf938
added unconfirmed txn route + minor refactor in rest mod.rs
Roee-87 Nov 11, 2025
d4a5c39
logging output changed to leo_devnode_*
Roee-87 Nov 11, 2025
ad99794
added flags for devnode start
Roee-87 Nov 11, 2025
7b9b01e
added genesis-path CLI flag
Roee-87 Nov 11, 2025
e759331
added spawn_blocking to ledger methods
Roee-87 Nov 11, 2025
29ca7f1
patch for genesis block path
Roee-87 Nov 12, 2025
97ee933
optional dummy vkeys and certificate for deploy transactions
Roee-87 Nov 14, 2025
3859a89
upgrade proofless
Roee-87 Nov 14, 2025
f10c202
added fast-forward default to latest CV
Roee-87 Nov 24, 2025
218f84e
modified feature flag name for skipping execution proofs
Roee-87 Nov 24, 2025
1aa3b77
ran cargo fmt
Roee-87 Nov 24, 2025
be283b1
minor refactor in routes.rs
Roee-87 Nov 24, 2025
3cbef96
clippy cleanup
Roee-87 Nov 24, 2025
0255866
updated private-key passing and error managment
Roee-87 Nov 24, 2025
5baf94e
refactored private key management to avoid env var dependency
Roee-87 Nov 25, 2025
a78c8aa
Fix a bug where skipped programs did not get added to the VM
eranrund Nov 25, 2025
58553e4
Merge pull request #29006 from eranrund/eran/fix-skip-indentation-bug
Roee-87 Nov 25, 2025
faab636
set fast-forward height to use TEST_CONSENSUS_VERSION_HEIGHTS var
Roee-87 Nov 25, 2025
f6eb08d
docstring and comment cleanup
Roee-87 Nov 25, 2025
865e50d
clippy cleanup
Roee-87 Nov 26, 2025
feb2081
ran cargo fmt
Roee-87 Nov 26, 2025
10763d6
updated to snarkVM 4.4.0
Roee-87 Nov 26, 2025
254d7f5
fixed operand_value method
Roee-87 Nov 26, 2025
9cbd359
fixed logging for execute.rs
Roee-87 Nov 26, 2025
326cef8
fixed cursor_aleo.rs
Roee-87 Nov 26, 2025
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
1,059 changes: 699 additions & 360 deletions Cargo.lock

Large diffs are not rendered by default.

77 changes: 70 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -90,18 +90,31 @@ path = "./test-framework"
version = "=3.3.1"

[workspace.dependencies.aleo-std]
version = "1.0.1"
version = "1.0.3"

[workspace.dependencies.aleo-std-storage]
version = "1.0.3"
default-features = false

[workspace.dependencies.anyhow]
version = "1.0"

[workspace.dependencies.axum]
version = "0.8.0"

[workspace.dependencies.axum-extra]
version = "0.10"
features = ["erased-json", "typed-header"]

[workspace.dependencies.base62]
version = "2.2.1"

[workspace.dependencies.colored]
version = "2.0"

[workspace.dependencies.http]
version = "1"

[workspace.dependencies.indexmap]
version = "2.6"
features = [ "serde" ]
Expand All @@ -112,6 +125,12 @@ version = "0.13.0"
[workspace.dependencies.paste]
version = "1.0"

[workspace.dependencies.is-terminal]
version = "0.4"

[workspace.dependencies.parking_lot]
version = "0.12"

[workspace.dependencies.rand]
version = "0.8"
default-features = false
Expand All @@ -121,11 +140,14 @@ version = "0.3.0"
default-features = false

[workspace.dependencies.rayon]
version = "1.11.0"
version = "0.8"

[workspace.dependencies.regex]
version = "1.11.1"

[workspace.dependencies.reqwest]
version = "0.12.23"

[workspace.dependencies.self_update]
version = "0.41.0"
features = [ "archive-zip", "compression-zip-deflate" ]
Expand All @@ -145,15 +167,30 @@ version = "3.1.1"
version = "0.10.9"

[workspace.dependencies.snarkvm]
version = "4.3.0"
features = [ "test_consensus_heights" ]
git = "https://github.com/ProvableHQ/snarkVM.git"
rev = "f9adcf4"
features = ["dev_skip_checks", "test_consensus_heights", "test_targets"]

[workspace.dependencies.tempfile]
version = "3.13"

[workspace.dependencies.tokio]
version = "1"
features = ["full"]

[workspace.dependencies.tower-http]
version = "0.6.0"

[workspace.dependencies.tower_governor]
version = "0.7"

[workspace.dependencies.tracing]
version = "0.1"

[workspace.dependencies.tracing-subscriber]
version = "0.3"
features = ["env-filter", "fmt"]

[workspace.dependencies.ureq]
version = "3.0.12"

Expand Down Expand Up @@ -207,6 +244,15 @@ workspace = true
[dependencies.aleo-std]
workspace = true

[dependencies.aleo-std-storage]
workspace = true

[dependencies.axum]
workspace = true

[dependencies.axum-extra]
workspace = true

[dependencies.backtrace]
version = "0.3.74"

Expand Down Expand Up @@ -241,6 +287,9 @@ version = "1.0.5"
[dependencies.indexmap]
workspace = true

[dependencies.is-terminal]
version = "0.4"

[dependencies.itertools]
workspace = true

Expand All @@ -265,6 +314,9 @@ workspace = true
[dependencies.regex]
workspace = true

[dependencies.reqwest]
workspace = true

[dependencies.rpassword]
version = "7.4.0"

Expand All @@ -285,20 +337,31 @@ workspace = true

[dependencies.snarkvm]
workspace = true
features = [ "circuit", "console" ]
features = ["circuit", "console"]

[dependencies.sys-info]
version = "0.9.1"

[dependencies.tempfile]
version = "3.20.0"

[dependencies.tokio]
workspace = true
features = ["full", "rt-multi-thread", "macros"]

[dependencies.tower-http]
workspace = true
features = ["cors", "trace"]

[dependencies.tower_governor]
workspace = true

[dependencies.tracing]
workspace = true

[dependencies.tracing-subscriber]
version = "0.3.18"
features = [ "fmt" ]
version = "0.3.0"
features = ["env-filter","fmt"]

[dependencies.ureq]
workspace = true
Expand Down
3 changes: 2 additions & 1 deletion interpreter/src/cursor_aleo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,13 @@ impl Cursor {
} else {
self.signer.clone()
}
}
},
Operand::BlockHeight => self.block_height.into(),
Operand::NetworkID => todo!(),
Operand::Checksum(_) => todo!(),
Operand::Edition(_) => todo!(),
Operand::ProgramOwner(_) => todo!(),
&Operand::BlockTimestamp => todo!(),
}
}

Expand Down
11 changes: 10 additions & 1 deletion leo/cli/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ enum Commands {
#[clap(flatten)]
command: LeoDevnet,
},
#[clap(about = "Run a local devnode")]
Devnode {
#[clap(flatten)]
command: LeoDevnode,
},
#[clap(about = "Query live data from the Aleo network")]
Query {
#[clap(flatten)]
Expand Down Expand Up @@ -148,7 +153,10 @@ pub fn run_with_args(cli: CLI) -> Result<()> {
// Initialize the `.env` file.
dotenvy::dotenv().ok();

if !cli.quiet {
// Skip logger initialization for devnode -- it uses it's own logger.
let is_devnode = matches!(&cli.command, Commands::Devnode { .. });

if !cli.quiet && !is_devnode {
// Init logger with optional debug flag.
logger::init_logger("leo", match cli.debug {
false => 1,
Expand All @@ -175,6 +183,7 @@ pub fn run_with_args(cli: CLI) -> Result<()> {
Commands::Clean { command } => command.try_execute(context),
Commands::Deploy { command } => command.try_execute(context),
Commands::Devnet { command } => command.try_execute(context),
Commands::Devnode { command } => command.try_execute(context),
Commands::Run { command } => command.try_execute(context),
Commands::Test { command } => command.try_execute(context),
Commands::Execute { command } => command.try_execute(context),
Expand Down
4 changes: 2 additions & 2 deletions leo/cli/commands/common/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,7 @@ pub struct EnvOptions {
pub struct FeeOptions {
#[clap(
long,
help = "[UNUSED] Base fees in microcredits, delimited by `|`, and used in order. The fees must either be valid `u64` or `default`. Defaults to automatic calculation.",
hide = true,
help = "Base fees in microcredits, delimited by `|`, and used in order. The fees must either be valid `u64` or `default`. Defaults to automatic calculation.",
value_delimiter = '|',
value_parser = parse_amount
)]
Expand Down Expand Up @@ -316,6 +315,7 @@ pub fn number_to_consensus_version(index: usize) -> ConsensusVersion {
9 => ConsensusVersion::V9,
10 => ConsensusVersion::V10,
11 => ConsensusVersion::V11,
12 => ConsensusVersion::V12,
_ => panic!("Invalid consensus version: {index}"),
}
}
Expand Down
7 changes: 6 additions & 1 deletion leo/cli/commands/deploy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ pub struct LeoDeploy {
pub(crate) skip: Vec<String>,
#[clap(flatten)]
pub(crate) build_options: BuildOptions,
// #[clap(long, help = "Skips proving.")]
// pub(crate) skip_proving: bool,
}

pub struct Task<N: Network> {
Expand All @@ -76,7 +78,7 @@ impl Command for LeoDeploy {
}

fn prelude(&self, context: Context) -> Result<Self::Input> {
LeoBuild {
LeoBuild {
env_override: self.env_override.clone(),
options: {
let mut options = self.build_options.clone();
Expand Down Expand Up @@ -286,6 +288,9 @@ Once it is deployed, it CANNOT be changed.
return Ok(());
}
}
// if command.skip_proving {
// println!("⚠️ Skipping proving for program '{}'.", id.to_string().bold());
// }
println!("📦 Creating deployment transaction for '{}'...\n", id.to_string().bold());
// Generate the transaction.
let transaction =
Expand Down
70 changes: 70 additions & 0 deletions leo/cli/commands/devnode/advance.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
// Copyright (C) 2019-2025 Provable Inc.
// This file is part of the Leo library.

// The Leo library is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// The Leo library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.

use super::*;
use serde_json::json;
use snarkvm::prelude::{PrivateKey, TestnetV0};

// Advance the Devnode ledger by a specified number of blocks. The default value is 1.
#[derive(Parser, Debug)]
pub struct Advance {
#[clap(help = "The number of blocks to advance the ledger by", default_value = "1")]
pub num_blocks: u32,
#[clap(flatten)]
pub(crate) env_override: EnvOptions,
}

impl Command for Advance {
type Input = ();
type Output = ();

fn log_span(&self) -> Span {
tracing::span!(tracing::Level::INFO, "Leo")
}

fn prelude(&self, _context: Context) -> Result<Self::Input> {
Ok(())
}

fn apply(self, _context: Context, _: Self::Input) -> Result<Self::Output> {

tokio::runtime::Runtime::new()
.unwrap()
.block_on(async { handle_advance_devnode::<TestnetV0>(self).await })
}
}

async fn handle_advance_devnode<N: Network>(command: Advance) -> Result<()> {
let private_key: PrivateKey<N> = get_private_key(&command.env_override.private_key)?;

tracing::info!("Advancing the Devnode ledger by {} block(s)", command.num_blocks,);

// Call the REST API to advance the ledger by one block.
let client = reqwest::blocking::Client::new();

let payload = json!({
"private_key": private_key.to_string(),
"num_blocks": command.num_blocks,
});

let _response = client
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we care about reporting errors?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Can you elaborate on this?

.post("http://localhost:3030/testnet/block/create")
.header("Content-Type", "application/json")
.json(&payload)
.send();

Ok(())
}
63 changes: 63 additions & 0 deletions leo/cli/commands/devnode/logger.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// Copyright (C) 2019-2025 Provable Inc.
// This file is part of the Leo library.

// The Leo library is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// The Leo library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.

use is_terminal::IsTerminal;
use std::{io, str::FromStr};
use tracing_subscriber::{EnvFilter, prelude::*};

use super::*;

pub fn initialize_terminal_logger(verbosity: u8) -> Result<()> {
let stdout_filter = parse_log_verbosity(verbosity)?;

// At high verbosity or when there is a custom log filter we show the target
// of the log event, i.e., the file/module where the log message was created.
let show_target = verbosity > 2;

// Initialize tracing.
let _ = tracing_subscriber::registry()
.with(
// Add layer using LogWriter for stdout / terminal
tracing_subscriber::fmt::Layer::default()
.with_ansi(io::stdout().is_terminal())
.with_target(show_target)
// .event_format(DynamicFormatter::new(Arc::new(AtomicBool::new(false))))
.with_filter(stdout_filter),
)
.try_init();

Ok(())
}

fn parse_log_verbosity(verbosity: u8) -> Result<EnvFilter> {
// First, set default log verbosity.
// Note, that this must not be prefixed with `RUST_LOG=`.
let default_log_str = match verbosity {
0 => "info",
1 => "debug",
2.. => "trace",
};
let filter = EnvFilter::from_str(default_log_str).unwrap();


let filter = if verbosity >= 3 {
filter.add_directive("leo_devnode_tcp=trace".parse().unwrap())
} else {
filter.add_directive("leo_devnode_tcp=off".parse().unwrap())
};

Ok(filter)
}
Loading