Skip to content

Commit 459468b

Browse files
authored
Merge pull request #325 from monadicus/deps-canary-3.5.0
chore(aot): update for canary-3.5.0
2 parents e5fc4f6 + ed58ec9 commit 459468b

File tree

8 files changed

+1437
-854
lines changed

8 files changed

+1437
-854
lines changed

Cargo.lock

Lines changed: 1409 additions & 838 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ lto = "thin"
4242
opt-level = 1
4343

4444
[workspace.dependencies]
45-
aleo-std = "0.1.24"
45+
aleo-std = "1.0.1"
4646
axum = { version = "0.7", default-features = false }
4747
# uncomment to enable #[debug_handler] for axum :^)
4848
# axum = { version = "0.7", features = ["macros"], default-features = false }
@@ -144,16 +144,16 @@ snops-common = { path = "./crates/common" }
144144

145145
## Comment to use version-pinned or local dependencies
146146

147-
snarkos-account = { git = "https://github.com/ProvableHQ/snarkOS", rev = "3eea16f" }
148-
snarkos-node = { git = "https://github.com/ProvableHQ/snarkOS", rev = "3eea16f" }
149-
snarkos-node-metrics = { git = "https://github.com/ProvableHQ/snarkOS", rev = "3eea16f" }
147+
snarkos-account = { git = "https://github.com/ProvableHQ/snarkOS", rev = "a1e4a28" }
148+
snarkos-node = { git = "https://github.com/ProvableHQ/snarkOS", rev = "a1e4a28" }
149+
snarkos-node-metrics = { git = "https://github.com/ProvableHQ/snarkOS", rev = "a1e4a28" }
150150
[workspace.dependencies.snarkvm]
151151
## The following anchors are used by the `update_snarkos_dep.sh` script.
152152
## Everything in-between the anchors is copied from the snarkos Cargo.toml
153153
## CODEGEN_START
154154
#path = "../snarkVM"
155155
git = "https://github.com/ProvableHQ/snarkVM.git"
156-
rev = "59776cb"
157-
#version = "=1.3.0"
156+
rev = "a296d35"
157+
#version = "=1.4.0"
158158
## CODEGEN_END
159159
features = ["rocks"]

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,15 @@ credits.aleo
222222
$ snarkos-aot program cost ./example.aleo
223223
2568400
224224
225+
# Calculate the cost of executing a function in a program
226+
$ snarkos-aot program cost ./credits.aleo transfer_public example.aleo 1u64
227+
34060
228+
229+
# Calculate the cost of executing a function in a program for devnets below the cost-v2 height
230+
# Programs that call other programs will be much more expensive with cost-v1
231+
$ snarkos-aot program cost --cost-v1 ./credits.aleo transfer_public example.aleo 1u64
232+
51060
233+
225234
# Get a list of imports for a program (output in a json format with --json)
226235
$ snarkos-aot program imports ./staking_v1.aleo --json
227236
["credits.aleo"]

crates/aot/src/auth/auth_fee.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ pub fn estimate_cost<N: Network>(
190190
.next()
191191
.ok_or(anyhow!("No transitions"))?;
192192
let stack = process.get_stack(transition.program_id())?;
193-
cost_in_microcredits_v2(stack, transition.function_name())?
193+
cost_in_microcredits_v2(&stack, transition.function_name())?
194194
} else {
195195
// Compute the finalize cost in microcredits.
196196
let mut finalize_cost = 0u64;
@@ -200,7 +200,7 @@ pub fn estimate_cost<N: Network>(
200200
// Retrieve the function name, program id, and program.
201201
let function_name = *transition.function_name();
202202
let stack = process.get_stack(transition.program_id())?;
203-
let cost = cost_in_microcredits_v1(stack, &function_name)?;
203+
let cost = cost_in_microcredits_v1(&stack, &function_name)?;
204204

205205
// Accumulate the finalize cost.
206206
if let Some(cost) = finalize_cost.checked_add(cost) {

crates/aot/src/auth/execute.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use aleo_std::StorageMode;
12
use anyhow::{Result, anyhow, bail};
23
use clap::{Args, ValueEnum};
34
use rand::{CryptoRng, Rng};
@@ -95,7 +96,7 @@ pub fn execute_local<R: Rng + CryptoRng, N: Network>(
9596
} else {
9697
let query = query_raw.clone().map(Query::REST);
9798

98-
let store = ConsensusStore::<N, ConsensusMemory<_>>::open(None)?;
99+
let store = ConsensusStore::<N, ConsensusMemory<_>>::open(StorageMode::Production)?;
99100
let vm = MemVM::from(store)?;
100101

101102
match auth {

crates/aot/src/genesis.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ impl<N: Network> Genesis<N> {
346346

347347
// Initialize a new VM.
348348
let vm = snarkvm::synthesizer::VM::from(ConsensusStore::<N, ConsensusMemory<_>>::open(
349-
Some(0),
349+
StorageMode::Development(0),
350350
)?)?;
351351

352352
// region: Genesis Records

crates/aot/src/runner/mod.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,6 @@ impl<N: Network> Runner<N> {
226226
.map_err(|e| e.context("create client"))?,
227227
};
228228

229-
agent.status(SnarkOSStatus::Started);
230-
231229
// only monitor block updates if we have a checkpoint manager or agent status
232230
// API
233231
if manager.is_some() || agent.is_enabled() {
@@ -283,12 +281,12 @@ impl<N: Network> Runner<N> {
283281
/// Check the proposal cache for this address and remove it if it is
284282
/// invalid.
285283
fn check_proposal_cache(addr: Address<N>) {
286-
let proposal_cache_path = proposal_cache_path(N::ID, None);
284+
let proposal_cache_path = proposal_cache_path(N::ID, &StorageMode::Production);
287285
if !proposal_cache_path.exists() {
288286
return;
289287
}
290288

291-
let Err(e) = ProposalCache::<N>::load(addr, None) else {
289+
let Err(e) = ProposalCache::<N>::load(addr, &StorageMode::Production) else {
292290
return;
293291
};
294292

crates/common/src/binaries.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use std::{
55
str::FromStr,
66
};
77

8-
use chrono::DateTime;
8+
use chrono::{DateTime, Utc};
99
use serde::{Deserialize, Deserializer, Serialize};
1010

1111
use crate::{
@@ -90,7 +90,11 @@ impl Display for BinaryEntry {
9090
)?;
9191
if let BinarySource::Path(path) = &self.source {
9292
if let Ok(time) = path.metadata().and_then(|m| m.modified()) {
93-
writeln!(f, "last modified: {}", DateTime::from(time).naive_local())?;
93+
writeln!(
94+
f,
95+
"last modified: {}",
96+
DateTime::<Utc>::from(time).naive_local()
97+
)?;
9498
}
9599
}
96100
Ok(())

0 commit comments

Comments
 (0)