Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## v0.16.0 (TBD)

### Changes
- [Added] `min_fill_amount` field to `PswapNoteStorage` to prevent very small partial fills (#3235)

- [BREAKING] Replaced the owner-only transfer allowlist/blocklist admin components (`AllowlistOwnerControlled` / `BlocklistOwnerControlled`) with authority-gated `AllowlistManager` / `BlocklistManager` ([#3277](https://github.com/0xMiden/protocol/pull/3277)).

Expand Down
3 changes: 1 addition & 2 deletions bin/bench-note-checker/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ use miden_protocol::asset::FungibleAsset;
use miden_protocol::crypto::rand::RandomCoin;
use miden_protocol::note::{Note, NoteType};
use miden_protocol::testing::account_id::{
ACCOUNT_ID_REGULAR_PUBLIC_ACCOUNT_IMMUTABLE_CODE,
ACCOUNT_ID_SENDER,
ACCOUNT_ID_REGULAR_PUBLIC_ACCOUNT_IMMUTABLE_CODE, ACCOUNT_ID_SENDER,
};
use miden_standards::testing::note::NoteBuilder;
use miden_testing::{Auth, MockChain, TxContextInput};
Expand Down
12 changes: 2 additions & 10 deletions bin/bench-transaction/src/context_setups.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
use anyhow::Result;
pub use miden_agglayer::testing::ClaimDataSource;
use miden_agglayer::{
AggLayerBridge,
B2AggNote,
ClaimNote,
ClaimNoteStorage,
ConfigAggBridgeNote,
ConversionMetadata,
EthAddress,
MetadataHash,
UpdateGerNote,
create_existing_agglayer_faucet,
AggLayerBridge, B2AggNote, ClaimNote, ClaimNoteStorage, ConfigAggBridgeNote,
ConversionMetadata, EthAddress, MetadataHash, UpdateGerNote, create_existing_agglayer_faucet,
create_existing_bridge_account,
};
use miden_protocol::account::auth::AuthScheme;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@ use miden_processor::trace::{TraceLenSummary, build_trace};
use miden_protocol::transaction::{TransactionInputs, TransactionKernel, TransactionMeasurements};
use miden_testing::TransactionContext;
use miden_tx::{
AccountProcedureIndexMap,
ExecutionOptions,
ScriptMastForestStore,
TransactionMastStore,
AccountProcedureIndexMap, ExecutionOptions, ScriptMastForestStore, TransactionMastStore,
TransactionProverHost,
};

Expand Down
13 changes: 4 additions & 9 deletions bin/bench-transaction/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,10 @@ use anyhow::{Context, Result};

mod context_setups;
use context_setups::{
ClaimDataSource,
tx_consume_b2agg_note,
tx_consume_claim_note,
tx_consume_single_p2id_note_ecdsa,
tx_consume_single_p2id_note_falcon,
tx_consume_two_p2id_notes_ecdsa,
tx_consume_two_p2id_notes_falcon,
tx_create_single_p2id_note_ecdsa,
tx_create_single_p2id_note_falcon,
ClaimDataSource, tx_consume_b2agg_note, tx_consume_claim_note,
tx_consume_single_p2id_note_ecdsa, tx_consume_single_p2id_note_falcon,
tx_consume_two_p2id_notes_ecdsa, tx_consume_two_p2id_notes_falcon,
tx_create_single_p2id_note_ecdsa, tx_create_single_p2id_note_falcon,
};

mod cycle_counting_benchmarks;
Expand Down
10 changes: 3 additions & 7 deletions bin/bench-transaction/src/time_counting_benchmarks/prove.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,9 @@ use std::time::{Duration, Instant};

use anyhow::Result;
use bench_transaction::context_setups::{
ClaimDataSource,
tx_consume_b2agg_note,
tx_consume_claim_note,
tx_consume_single_p2id_note_ecdsa,
tx_consume_single_p2id_note_falcon,
tx_consume_two_p2id_notes_ecdsa,
tx_consume_two_p2id_notes_falcon,
ClaimDataSource, tx_consume_b2agg_note, tx_consume_claim_note,
tx_consume_single_p2id_note_ecdsa, tx_consume_single_p2id_note_falcon,
tx_consume_two_p2id_notes_ecdsa, tx_consume_two_p2id_notes_falcon,
};
use criterion::{BatchSize, Bencher, Criterion, SamplingMode, criterion_group, criterion_main};
use miden_protocol::transaction::{ExecutedTransaction, ProvenTransaction};
Expand Down
13 changes: 2 additions & 11 deletions crates/miden-agglayer/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,7 @@ use std::sync::Arc;
use fs_err as fs;
use miden_assembly::diagnostics::{IntoDiagnostic, Result, WrapErr};
use miden_assembly::{
Assembler,
Linkage,
ModuleParser,
Path as MasmPath,
Report,
SourceManager,
ast,
Assembler, Linkage, ModuleParser, Path as MasmPath, Report, SourceManager, ast,
};
use miden_assembly_syntax::Parse;
use miden_core::Word;
Expand All @@ -25,10 +19,7 @@ use miden_protocol::transaction::TransactionKernel;
use miden_standards::account::access::Authority;
use miden_standards::account::auth::AuthNetworkAccount;
use miden_standards::account::policies::{
BurnPolicy,
MintPolicy,
TokenPolicyManager,
TransferPolicy,
BurnPolicy, MintPolicy, TokenPolicyManager, TransferPolicy,
};
use regex::Regex;

Expand Down
12 changes: 2 additions & 10 deletions crates/miden-agglayer/src/b2agg_note.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,8 @@ use miden_protocol::assembly::Library;
use miden_protocol::crypto::rand::FeltRng;
use miden_protocol::errors::NoteError;
use miden_protocol::note::{
Note,
NoteAssets,
NoteAttachment,
NoteAttachments,
NoteRecipient,
NoteScript,
NoteScriptRoot,
NoteStorage,
NoteType,
PartialNoteMetadata,
Note, NoteAssets, NoteAttachment, NoteAttachments, NoteRecipient, NoteScript, NoteScriptRoot,
NoteStorage, NoteType, PartialNoteMetadata,
};
use miden_protocol::utils::serde::Deserializable;
use miden_standards::note::{NetworkAccountTarget, NoteExecutionHint};
Expand Down
28 changes: 4 additions & 24 deletions crates/miden-agglayer/src/bridge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,7 @@ use alloc::vec::Vec;
use miden_core::{Felt, ONE, Word, ZERO};
use miden_protocol::account::component::AccountComponentMetadata;
use miden_protocol::account::{
Account,
AccountComponent,
AccountId,
StorageMapKey,
StorageSlot,
StorageSlotName,
Account, AccountComponent, AccountId, StorageMapKey, StorageSlot, StorageSlotName,
};
use miden_protocol::block::account_tree::AccountIdKey;
use miden_protocol::crypto::hash::poseidon2::Poseidon2;
Expand All @@ -27,24 +22,9 @@ use crate::utils::Keccak256Output;
/// Removed-GER hash chain representation (32-byte Keccak256 hash)
pub type RemovedGerHashChain = Keccak256Output;
pub use crate::{
B2AggNote,
ClaimNote,
ClaimNoteStorage,
ConfigAggBridgeNote,
DeregisterAggFaucetNote,
EthAddress,
EthAmount,
EthAmountError,
EthEmbeddedAccountId,
ExitRoot,
GlobalIndex,
GlobalIndexError,
LeafData,
MetadataHash,
ProofData,
RemoveGerNote,
SmtNode,
UpdateGerNote,
B2AggNote, ClaimNote, ClaimNoteStorage, ConfigAggBridgeNote, DeregisterAggFaucetNote,
EthAddress, EthAmount, EthAmountError, EthEmbeddedAccountId, ExitRoot, GlobalIndex,
GlobalIndexError, LeafData, MetadataHash, ProofData, RemoveGerNote, SmtNode, UpdateGerNote,
};

// CONSTANTS
Expand Down
12 changes: 2 additions & 10 deletions crates/miden-agglayer/src/claim_note.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,8 @@ use miden_protocol::crypto::SequentialCommit;
use miden_protocol::crypto::rand::FeltRng;
use miden_protocol::errors::NoteError;
use miden_protocol::note::{
Note,
NoteAssets,
NoteAttachment,
NoteAttachments,
NoteRecipient,
NoteScript,
NoteScriptRoot,
NoteStorage,
NoteType,
PartialNoteMetadata,
Note, NoteAssets, NoteAttachment, NoteAttachments, NoteRecipient, NoteScript, NoteScriptRoot,
NoteStorage, NoteType, PartialNoteMetadata,
};
use miden_protocol::utils::serde::Deserializable;
use miden_standards::note::{NetworkAccountTarget, NoteExecutionHint};
Expand Down
12 changes: 2 additions & 10 deletions crates/miden-agglayer/src/config_note.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,8 @@ use miden_protocol::assembly::Library;
use miden_protocol::crypto::rand::FeltRng;
use miden_protocol::errors::NoteError;
use miden_protocol::note::{
Note,
NoteAssets,
NoteAttachment,
NoteAttachments,
NoteRecipient,
NoteScript,
NoteScriptRoot,
NoteStorage,
NoteType,
PartialNoteMetadata,
Note, NoteAssets, NoteAttachment, NoteAttachments, NoteRecipient, NoteScript, NoteScriptRoot,
NoteStorage, NoteType, PartialNoteMetadata,
};
use miden_protocol::utils::serde::Deserializable;
use miden_standards::note::{NetworkAccountTarget, NoteExecutionHint};
Expand Down
12 changes: 2 additions & 10 deletions crates/miden-agglayer/src/deregister_note.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,8 @@ use miden_protocol::assembly::Library;
use miden_protocol::crypto::rand::FeltRng;
use miden_protocol::errors::NoteError;
use miden_protocol::note::{
Note,
NoteAssets,
NoteAttachment,
NoteAttachments,
NoteRecipient,
NoteScript,
NoteScriptRoot,
NoteStorage,
NoteType,
PartialNoteMetadata,
Note, NoteAssets, NoteAttachment, NoteAttachments, NoteRecipient, NoteScript, NoteScriptRoot,
NoteStorage, NoteType, PartialNoteMetadata,
};
use miden_protocol::utils::serde::Deserializable;
use miden_standards::note::{NetworkAccountTarget, NoteExecutionHint};
Expand Down
19 changes: 3 additions & 16 deletions crates/miden-agglayer/src/faucet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,9 @@ use thiserror::Error;

use super::agglayer_faucet_component_library;
pub use crate::{
AggLayerBridge,
B2AggNote,
ClaimNoteStorage,
ConfigAggBridgeNote,
EthAddress,
EthAmount,
EthAmountError,
EthEmbeddedAccountId,
ExitRoot,
GlobalIndex,
GlobalIndexError,
LeafData,
MetadataHash,
ProofData,
SmtNode,
UpdateGerNote,
AggLayerBridge, B2AggNote, ClaimNoteStorage, ConfigAggBridgeNote, EthAddress, EthAmount,
EthAmountError, EthEmbeddedAccountId, ExitRoot, GlobalIndex, GlobalIndexError, LeafData,
MetadataHash, ProofData, SmtNode, UpdateGerNote,
};

// CONSTANTS
Expand Down
11 changes: 2 additions & 9 deletions crates/miden-agglayer/src/ger_note.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,8 @@ use miden_protocol::account::AccountId;
use miden_protocol::crypto::rand::FeltRng;
use miden_protocol::errors::NoteError;
use miden_protocol::note::{
Note,
NoteAssets,
NoteAttachment,
NoteAttachments,
NoteRecipient,
NoteScript,
NoteStorage,
NoteType,
PartialNoteMetadata,
Note, NoteAssets, NoteAttachment, NoteAttachments, NoteRecipient, NoteScript, NoteStorage,
NoteType, PartialNoteMetadata,
};
use miden_standards::note::{NetworkAccountTarget, NoteExecutionHint};

Expand Down
22 changes: 3 additions & 19 deletions crates/miden-agglayer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@ use miden_protocol::utils::serde::Deserializable;
use miden_standards::account::access::{Authority, Ownable2Step};
use miden_standards::account::auth::AuthNetworkAccount;
use miden_standards::account::policies::{
BurnAllowAll,
BurnPolicy,
MintPolicy,
TokenPolicyManager,
TransferPolicy,
BurnAllowAll, BurnPolicy, MintPolicy, TokenPolicyManager, TransferPolicy,
};
use miden_utils_sync::LazyLock;

Expand All @@ -36,26 +32,14 @@ pub mod utils;
pub use b2agg_note::B2AggNote;
pub use bridge::{AggLayerBridge, AgglayerBridgeError, RemovedGerHashChain};
pub use claim_note::{
CgiChainHash,
ClaimNote,
ClaimNoteStorage,
ExitRoot,
LeafData,
LeafValue,
ProofData,
SmtNode,
CgiChainHash, ClaimNote, ClaimNoteStorage, ExitRoot, LeafData, LeafValue, ProofData, SmtNode,
};
pub use config_note::{ConfigAggBridgeNote, ConversionMetadata};
pub use deregister_note::DeregisterAggFaucetNote;
#[cfg(any(test, feature = "testing"))]
pub use eth_types::GlobalIndexExt;
pub use eth_types::{
EthAddress,
EthAmount,
EthAmountError,
EthEmbeddedAccountId,
GlobalIndex,
GlobalIndexError,
EthAddress, EthAmount, EthAmountError, EthEmbeddedAccountId, GlobalIndex, GlobalIndexError,
MetadataHash,
};
pub use faucet::{AggLayerFaucet, AgglayerFaucetError};
Expand Down
6 changes: 1 addition & 5 deletions crates/miden-protocol/src/account/account_id/id_prefix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@ use crate::account::account_id::AccountIdPrefixV1;
use crate::account::{AccountIdVersion, AccountType, AssetCallbackFlag};
use crate::errors::AccountIdError;
use crate::utils::serde::{
ByteReader,
ByteWriter,
Deserializable,
DeserializationError,
Serializable,
ByteReader, ByteWriter, Deserializable, DeserializationError, Serializable,
};

// ACCOUNT ID PREFIX
Expand Down
19 changes: 5 additions & 14 deletions crates/miden-protocol/src/account/account_id/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,7 @@ use crate::Word;
use crate::address::NetworkId;
use crate::errors::{AccountError, AccountIdError};
use crate::utils::serde::{
ByteReader,
ByteWriter,
Deserializable,
DeserializationError,
Serializable,
ByteReader, ByteWriter, Deserializable, DeserializationError, Serializable,
};

/// The identifier of an [`Account`](crate::account::Account).
Expand Down Expand Up @@ -496,15 +492,10 @@ mod tests {
use crate::address::{AddressType, CustomNetworkId};
use crate::errors::Bech32Error;
use crate::testing::account_id::{
ACCOUNT_ID_MAX_ZEROES,
ACCOUNT_ID_PRIVATE_NON_FUNGIBLE_FAUCET,
ACCOUNT_ID_PRIVATE_SENDER,
ACCOUNT_ID_PUBLIC_FUNGIBLE_FAUCET,
ACCOUNT_ID_PUBLIC_FUNGIBLE_FAUCET_WITH_CALLBACKS,
ACCOUNT_ID_PUBLIC_NON_FUNGIBLE_FAUCET,
ACCOUNT_ID_REGULAR_PRIVATE_ACCOUNT_UPDATABLE_CODE,
ACCOUNT_ID_REGULAR_PUBLIC_ACCOUNT_IMMUTABLE_CODE,
AccountIdBuilder,
ACCOUNT_ID_MAX_ZEROES, ACCOUNT_ID_PRIVATE_NON_FUNGIBLE_FAUCET, ACCOUNT_ID_PRIVATE_SENDER,
ACCOUNT_ID_PUBLIC_FUNGIBLE_FAUCET, ACCOUNT_ID_PUBLIC_FUNGIBLE_FAUCET_WITH_CALLBACKS,
ACCOUNT_ID_PUBLIC_NON_FUNGIBLE_FAUCET, ACCOUNT_ID_REGULAR_PRIVATE_ACCOUNT_UPDATABLE_CODE,
ACCOUNT_ID_REGULAR_PUBLIC_ACCOUNT_IMMUTABLE_CODE, AccountIdBuilder,
};

#[test]
Expand Down
4 changes: 1 addition & 3 deletions crates/miden-protocol/src/account/account_id/seed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ use alloc::vec::Vec;

use crate::account::account_id::AccountIdVersion;
use crate::account::account_id::v1::{
compute_digest,
extract_asset_callback_flag,
validate_prefix,
compute_digest, extract_asset_callback_flag, validate_prefix,
};
use crate::account::{AccountIdV1, AccountType, AssetCallbackFlag};
use crate::errors::AccountError;
Expand Down
12 changes: 3 additions & 9 deletions crates/miden-protocol/src/account/account_id/v1/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@ use crate::account::{AccountIdVersion, AccountType, AssetCallbackFlag};
use crate::address::AddressType;
use crate::errors::{AccountError, AccountIdError, Bech32Error};
use crate::utils::serde::{
ByteReader,
ByteWriter,
Deserializable,
DeserializationError,
Serializable,
ByteReader, ByteWriter, Deserializable, DeserializationError, Serializable,
};
use crate::{EMPTY_WORD, Felt, Hasher, Word};

Expand Down Expand Up @@ -524,10 +520,8 @@ mod tests {
use super::*;
use crate::account::AccountIdPrefix;
use crate::testing::account_id::{
ACCOUNT_ID_PRIVATE_NON_FUNGIBLE_FAUCET,
ACCOUNT_ID_PRIVATE_SENDER,
ACCOUNT_ID_PUBLIC_FUNGIBLE_FAUCET,
ACCOUNT_ID_REGULAR_PRIVATE_ACCOUNT_UPDATABLE_CODE,
ACCOUNT_ID_PRIVATE_NON_FUNGIBLE_FAUCET, ACCOUNT_ID_PRIVATE_SENDER,
ACCOUNT_ID_PUBLIC_FUNGIBLE_FAUCET, ACCOUNT_ID_REGULAR_PRIVATE_ACCOUNT_UPDATABLE_CODE,
ACCOUNT_ID_REGULAR_PUBLIC_ACCOUNT_IMMUTABLE_CODE,
};

Expand Down
Loading