Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
122 commits
Select commit Hold shift + click to select a range
3a0a1ae
Reject Txns with system as initiator
darthsiroftardis May 12, 2026
965ed93
Address PR feedback
darthsiroftardis May 12, 2026
8d4a8af
Run make format
darthsiroftardis May 12, 2026
e3dacad
Push system initiator checks into txns
darthsiroftardis May 12, 2026
6eb5c62
Run make format
darthsiroftardis May 12, 2026
2eef2f1
Expand checks for txns
darthsiroftardis May 12, 2026
f7b7de6
Run make format
darthsiroftardis May 12, 2026
5aed85c
Address CI issues
darthsiroftardis May 12, 2026
6f8a246
Version bump to 2.2.1
darthsiroftardis May 12, 2026
746c8a9
Address error code tests
darthsiroftardis May 12, 2026
3ec7671
Run make format
darthsiroftardis May 12, 2026
af8eeba
Merge pull request #172 from casper-network/ta-changes-redux
sacherjj May 12, 2026
d273473
Correcting issue with cargo-deb install via fixed fork.
sacherjj May 13, 2026
5e749f0
Merge pull request #173 from casper-network/correct_cargo_deb
sacherjj May 13, 2026
0caafda
Fix issue in tracking validator bridge records
darthsiroftardis May 15, 2026
577be3a
Strengthen bridged validator unbond regression
mpapierski May 15, 2026
e3be349
Fix bridged unbond reward writeback
mpapierski May 15, 2026
3e4aa20
Reject proposals with overly long signatures
darthsiroftardis May 15, 2026
1cd8f14
Run make format
darthsiroftardis May 15, 2026
664a4e7
PR prep
darthsiroftardis May 18, 2026
8c63614
Version bump
darthsiroftardis May 18, 2026
c9e1387
Merge pull request #174 from casper-network/ta-changes-redux
sacherjj May 18, 2026
6bfc3c3
audit-002: add failing regression for ApprovalsHashes length mismatch
mpapierski May 19, 2026
8ee5ecf
audit-002: reject ApprovalsHashes length mismatch before storage
mpapierski May 19, 2026
bf9ad4d
audit-003: add failing regression for Zug nested instance replay
mpapierski May 19, 2026
97d225b
audit-003: bind nested Zug signed messages to current instance
mpapierski May 19, 2026
38dc71c
audit-081: add failing regression for stored vs finalized approvals s…
mpapierski May 19, 2026
b75c3c0
audit-081: apply finalized approvals when building executable block
mpapierski May 19, 2026
0cf0b4d
audit-123: add failing regression for system-key sustain share mint
mpapierski May 19, 2026
4367dad
audit-123: exclude PublicKey::System from sustain-share base
mpapierski May 19, 2026
c8a5ce5
audit-004: add failing regression for ItemsByPrefix DoS gate
mpapierski May 19, 2026
d491194
audit-004: gate ItemsByPrefix behind allow_request_get_all_values
mpapierski May 19, 2026
6000260
audit-005: add failing regression for raw dictionary_read URef bypass
mpapierski May 19, 2026
a0b17a6
audit-005: reject non-dictionary keys in raw casper_dictionary_read
mpapierski May 19, 2026
e927ffd
audit-006: add failing regression for oversized get_named_arg buffer
mpapierski May 19, 2026
775d003
audit-006: stop slicing get_named_arg by caller-supplied output size
mpapierski May 19, 2026
4f85c33
audit-009: add failing regression for raw get_balance unknown URef by…
mpapierski May 19, 2026
41427ea
audit-009: validate purse URef in raw casper_get_balance
mpapierski May 19, 2026
3c6ee64
audit-010: add failing regression for transfer_from_purse balance oracle
mpapierski May 19, 2026
02634b2
audit-010: validate source URef before balance precondition
mpapierski May 19, 2026
c701ae2
audit-013: add failing regression for custom-payment precheck continues
mpapierski May 19, 2026
8c33969
audit-013: stop transaction execution on failed initial-balance precheck
mpapierski May 19, 2026
43ddad8
audit-032: add failing regression for native-burn vs gas-hold mismatch
mpapierski May 19, 2026
b67cfee
audit-032: subtract native burn from total balance, not available
mpapierski May 19, 2026
2735042
audit-035: add failing regression for custom-payment gas overrun
mpapierski May 19, 2026
249e093
audit-035: bound custom-payment gas by the transaction's declared limit
mpapierski May 19, 2026
61b40c6
audit-051: add failing regression for failed custom-payment gas under…
mpapierski May 19, 2026
9edc63b
audit-051: charge failed custom payment for consumed payment gas
mpapierski May 19, 2026
007091a
audit-057: add failing regression for payment-purse subcall persistence
mpapierski May 19, 2026
5c16023
audit-057: propagate payment-purse marker from subcall back to parent
mpapierski May 19, 2026
560ceb2
audit-059: add failing regression for auction spending-limit reset
mpapierski May 19, 2026
4f9eb86
audit-059: propagate auction subcall spending limit back to parent
mpapierski May 19, 2026
ed060ac
audit-061: add failing regression for reservation key rotation
mpapierski May 19, 2026
b563f61
audit-061: migrate reservation bids on validator key rotation
mpapierski May 19, 2026
d1dfa05
audit-064: add failing regression for forced-unbond reservation slot …
mpapierski May 19, 2026
554bcac
audit-064: use cache-aware prefix scan for runtime auction validation
mpapierski May 19, 2026
118ab96
audit-065: add failing regression for system validator key rotation
mpapierski May 19, 2026
efe57d5
audit-065: reject PublicKey::System in change_bid_public_key
mpapierski May 19, 2026
dd2f377
audit-067: add failing regression for zero-amount withdraw_bid unbond
mpapierski May 19, 2026
6e03c5a
audit-067: reject zero-amount withdraw_bid before unbond accounting
mpapierski May 19, 2026
83eb21b
audit-068: add failing regression for bridged validator eviction bypass
mpapierski May 19, 2026
afd65d5
audit-068: deactivate bridged-key evictions in run_auction
mpapierski May 19, 2026
0ad1fd0
audit-072: add failing regression for bridged delegator reward overage
mpapierski May 19, 2026
69d1fec
audit-072: queue bridged delegator reward overage against current key
mpapierski May 19, 2026
6fbfa05
audit-075: add failing regression for split custom-payment penalty
mpapierski May 19, 2026
bb80138
audit-075: sum AddUInt512 transforms when classifying custom payment
mpapierski May 19, 2026
63072fa
audit-077: add failing regression for forced locked-delegator unbond
mpapierski May 19, 2026
859a241
audit-077: reduce locked delegator stake before writing forced unbond
mpapierski May 19, 2026
b483543
audit-080: add failing regression for shared-purse fee drain
mpapierski May 19, 2026
ae21267
audit-080: cap custom-payment available by this transaction's deposit
mpapierski May 19, 2026
47f3bee
audit-082: add failing regression for session payment-purse deposit
mpapierski May 19, 2026
ac42b30
audit-082: gate get_payment_purse by execution phase
mpapierski May 19, 2026
fdffb78
audit-083: add failing regression for burn spending-limit bypass
mpapierski May 19, 2026
9fba57b
audit-083: enforce approved spending limit in mint burn
mpapierski May 19, 2026
8e4a91d
audit-085: add failing regression for custom-payment/session spending…
mpapierski May 19, 2026
445162d
audit-085: forward post-payment spending limit into the session phase
mpapierski May 19, 2026
4a69808
audit-109: add failing regression for forged-initiator fee drain
mpapierski May 19, 2026
78a5968
audit-109: authorize initiator against signers before payment/fee work
mpapierski May 19, 2026
0b55b18
audit-152: skip committing wasm v1 session effects on execution error
mpapierski May 19, 2026
2841fc0
audit-153: accept Write transforms in custom-payment balance check
mpapierski May 19, 2026
5b0f37e
audit-156: include custom-payment overfund in fee/refund finalization
mpapierski May 19, 2026
e1738c4
audit-158: store refund purse with ADD-only access rights
mpapierski May 19, 2026
7fd0cc2
Update Cargo.lock
mpapierski May 19, 2026
21c9c9f
Add audit-156 overfund regression test
mpapierski May 20, 2026
d0e3445
Fix custom-payment overfund finalization
mpapierski May 20, 2026
393bf3c
Make audit-080 regression non-vacuous
mpapierski May 20, 2026
46d78d6
Ignore current rustls-webpki audit blockers
mpapierski May 20, 2026
927679b
Formatting
mpapierski Jun 12, 2026
43da752
Pin cargo-audit to 0.22.1
mpapierski Jun 12, 2026
547f57e
Split CI tests into parallel jobs
mpapierski Jun 12, 2026
38fe6f6
Cache setup tools in CI
mpapierski Jun 12, 2026
01b8249
Require chainspec for contract tests
mpapierski Jun 12, 2026
9b7fd9a
Ensuring CI passes
mpapierski Jun 12, 2026
9ab49c2
Fix transaction scenario signer mismatch
mpapierski Jun 12, 2026
fe66c33
Run test job on ubuntu-latest-big
mpapierski Jun 12, 2026
14bd4ce
Disable LTO for CI test builds
mpapierski Jun 15, 2026
dd4451a
Merge pull request #175 from casper-network/resolving-audit-items
mpapierski Jun 15, 2026
aee6c7b
Initial merge of client/peer flows
darthsiroftardis Jun 3, 2026
3d63562
Remove commented out stuff
darthsiroftardis Jun 3, 2026
9308ee5
merge spillover
darthsiroftardis Jun 3, 2026
5601974
Changing the MetaTransaction code so that it fails when trying to cre…
zajko Jun 15, 2026
1ade89b
Removed the possibility of network halt on vm2 transaction trying to …
zajko Jun 16, 2026
b25ec66
Add proposed txn fetcher
darthsiroftardis Jun 16, 2026
7f44b61
Fixing lint error in meta_transaction_v1.rs
zajko Jun 17, 2026
1e97247
Merge pull request #176 from casper-network/preventing_vm2_transactio…
zajko Jun 17, 2026
f40d176
Fix finalized approvals test
darthsiroftardis Jun 17, 2026
7df2c45
Run make format
darthsiroftardis Jun 17, 2026
c67b703
Extend gossiper to use accepted transaction
darthsiroftardis Jun 17, 2026
761919c
Get tests working again
darthsiroftardis Jun 17, 2026
1a205e3
PR cleanup
darthsiroftardis Jun 17, 2026
2be51b5
Run make format
darthsiroftardis Jun 17, 2026
c1f01ed
Address PR feedback
darthsiroftardis Jun 18, 2026
33d5a2a
Address PR feedback pt.2
darthsiroftardis Jun 18, 2026
f66acff
Run make format
darthsiroftardis Jun 18, 2026
d060d65
Merge pull request #177 from casper-network/fetcher-split-out
darthsiroftardis Jun 18, 2026
79418f1
Updating versions for crates using updated casper-types.
sacherjj Jun 19, 2026
d4becff
Merge pull request #178 from casper-network/2.2.2-version-update
sacherjj Jun 19, 2026
03db27f
Updating network config for release.
sacherjj Jun 30, 2026
bbb2890
Merge pull request #179 from casper-network/2.2.2-configs
sacherjj Jun 30, 2026
b0b5b49
Merge remote-tracking branch 'upstream/release-2.2.2' into merge-rele…
sacherjj Jul 14, 2026
15c8ce9
format pass and lint fixes.
sacherjj Jul 15, 2026
aaac033
Added ignore for RUSTSEC-2026-0194 RUSTSEC-2026-0195 as dev only flam…
sacherjj Jul 15, 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
40 changes: 28 additions & 12 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ lint-smart-contracts:

.PHONY: audit-rs
audit-rs:
$(CARGO) audit --ignore RUSTSEC-2024-0437 --ignore RUSTSEC-2025-0022 --ignore RUSTSEC-2025-0055 --ignore RUSTSEC-2026-0001 --ignore RUSTSEC-2026-0007 --ignore RUSTSEC-2026-0049 --ignore RUSTSEC-2026-0068 --ignore RUSTSEC-2026-0067 --ignore RUSTSEC-2026-0098 --ignore RUSTSEC-2026-0099 --ignore RUSTSEC-2026-0104
$(CARGO) audit --ignore RUSTSEC-2024-0437 --ignore RUSTSEC-2025-0022 --ignore RUSTSEC-2025-0055 --ignore RUSTSEC-2026-0001 --ignore RUSTSEC-2026-0007 --ignore RUSTSEC-2026-0049 --ignore RUSTSEC-2026-0068 --ignore RUSTSEC-2026-0067 --ignore RUSTSEC-2026-0098 --ignore RUSTSEC-2026-0099 --ignore RUSTSEC-2026-0104 --ignore RUSTSEC-2026-0194 --ignore RUSTSEC-2026-0195

.PHONY: audit
audit: audit-rs
Expand Down
4 changes: 2 additions & 2 deletions binary_port/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "casper-binary-port"
version = "1.1.1"
version = "1.2.1"
edition = "2018"
description = "Types for the casper node binary port"
documentation = "https://docs.rs/casper-binary-port"
Expand All @@ -13,7 +13,7 @@ exclude = ["proptest-regressions"]
[dependencies]
bincode = "1.3.3"
bytes = "1.0.1"
casper-types = { version = "7.0.0", path = "../types", features = ["datasize", "json-schema", "std"] }
casper-types = { version = "7.1.1", path = "../types", features = ["datasize", "json-schema", "std"] }
num-derive = { workspace = true }
num-traits = { workspace = true }
once_cell = { version = "1.5.2" }
Expand Down
4 changes: 4 additions & 0 deletions binary_port/src/error_code.rs
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,8 @@ pub enum ErrorCode {
InvalidDelegationAmount = 116,
#[error("the transaction invocation target is unsupported under V2 runtime")]
UnsupportedInvocationTarget = 117,
#[error("the transaction contained an invalid initiator")]
InvalidInitiator,
}

impl TryFrom<u16> for ErrorCode {
Expand Down Expand Up @@ -454,6 +456,7 @@ impl From<InvalidDeploy> for ErrorCode {
}
InvalidDeploy::InvalidPaymentAmount => ErrorCode::InvalidDeployInvalidPaymentAmount,
InvalidDeploy::PricingModeNotSupported => ErrorCode::PricingModeNotSupported,
InvalidDeploy::InvalidInitiator => ErrorCode::InvalidInitiator,
_ => ErrorCode::InvalidDeployUnspecified,
}
}
Expand Down Expand Up @@ -571,6 +574,7 @@ impl From<InvalidTransactionV1> for ErrorCode {
InvalidTransactionV1::UnsupportedInvocationTarget { .. } => {
ErrorCode::UnsupportedInvocationTarget
}
InvalidTransactionV1::InvalidInitiator => ErrorCode::InvalidInitiator,
_other => ErrorCode::InvalidTransactionUnspecified,
}
}
Expand Down
6 changes: 3 additions & 3 deletions execution_engine/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "casper-execution-engine"
version = "9.0.0" # when updating, also update 'html_root_url' in lib.rs
version = "9.0.1" # when updating, also update 'html_root_url' in lib.rs
authors = ["Henry Till <henrytill@gmail.com>", "Ed Hastings <ed@casperlabs.io>", "Michał Papierski <michal@casper.network>"]
edition = "2021"
description = "Casper execution engine crates."
Expand All @@ -17,8 +17,8 @@ bincode = "1.3.1"
blake2 = { version = "0.10.6", default-features = false }
blake3 = { version = "1.5.0", default-features = false, features = ["pure"] }
sha2 = { version = "0.10.8", default-features = false }
casper-storage = { version = "5.0.0", path = "../storage", default-features = true }
casper-types = { version = "7.0.0", path = "../types", default-features = false, features = ["datasize", "gens", "json-schema", "std"] }
casper-storage = { version = "5.0.1", path = "../storage", default-features = true }
casper-types = { version = "7.1.1", path = "../types", default-features = false, features = ["datasize", "gens", "json-schema", "std"] }
casper-wasm = { version = "1.0.0", default-features = false, features = ["sign_ext", "call_indirect_overlong"] }
casper-wasm-utils = { version = "4.0.0", default-features = false, features = ["sign_ext", "call_indirect_overlong"] }
casper-wasmi = { version = "1.0.0", features = ["sign_ext", "call_indirect_overlong"] }
Expand Down
65 changes: 58 additions & 7 deletions execution_engine/src/engine_state/wasm_v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,11 @@ pub struct WasmV1Result {
ret: Option<CLValue>,
/// Tracking copy cache captured during execution.
cache: Option<TrackingCopyCache>,
/// Remaining approved spending limit on the caller's main purse at the end of execution, if
/// the runtime context produced one. Used to forward the leftover budget from a
/// custom-payment Wasm into the following session phase so a transaction cannot reset its
/// approved spending limit twice.
remaining_spending_limit: Option<U512>,
}

impl WasmV1Result {
Expand All @@ -520,9 +525,21 @@ impl WasmV1Result {
error,
ret,
cache,
remaining_spending_limit: None,
}
}

/// Sets the post-execution remaining spending limit. Builder-style.
pub fn with_remaining_spending_limit(mut self, remaining: U512) -> Self {
self.remaining_spending_limit = Some(remaining);
self
}

/// Returns the post-execution remaining approved spending limit, if captured.
pub fn remaining_spending_limit(&self) -> Option<U512> {
self.remaining_spending_limit
}

/// Error, if any.
pub fn error(&self) -> Option<&EngineError> {
self.error.as_ref()
Expand Down Expand Up @@ -574,6 +591,7 @@ impl WasmV1Result {
error: Some(EngineError::RootNotFound(state_hash)),
ret: None,
cache: None,
remaining_spending_limit: None,
}
}

Expand All @@ -588,6 +606,7 @@ impl WasmV1Result {
error: Some(error),
ret: None,
cache: None,
remaining_spending_limit: None,
}
}

Expand All @@ -602,6 +621,7 @@ impl WasmV1Result {
error: Some(EngineError::InvalidExecutableItem(error)),
ret: None,
cache: None,
remaining_spending_limit: None,
}
}

Expand Down Expand Up @@ -633,6 +653,7 @@ impl WasmV1Result {
error: None,
ret: None,
cache: Some(cache),
remaining_spending_limit: None,
}),
TransferResult::Failure(te) => {
Some(WasmV1Result {
Expand All @@ -644,25 +665,55 @@ impl WasmV1Result {
error: Some(EngineError::Transfer(te)),
ret: None,
cache: None,
remaining_spending_limit: None,
})
}
}
}

/// Checks effects for an AddUInt512 transform to a balance at imputed addr
/// and for exactly the imputed amount.
/// Returns true if the effects on the balance at `addr` leave its value at >= `amount`.
pub fn balance_increased_by_amount(&self, addr: URefAddr, amount: U512) -> bool {
match self.balance_after_effects(addr) {
Some(total) => total >= amount,
None => false,
}
}

/// Returns the running balance value the effects leave at `addr`, folding `AddUInt512` and
/// `Write(CLValue<U512>)` transforms in execution order. Returns `None` if no balance-shape
/// effect on this key is observed.
///
/// - The payment purse starts each transaction empty (system invariant maintained by
/// audit-082's `Phase::Session` guard on `get_payment_purse`);
/// - `mint::transfer` writes the new total balance via `write_balance`, producing a `Write`
/// transform whose CLValue contains the post-transfer purse balance;
/// - `mint`'s `add_balance` path produces `AddUInt512`.
pub fn balance_after_effects(&self, addr: URefAddr) -> Option<U512> {
if self.effects.is_empty() || self.effects.transforms().is_empty() {
return false;
return None;
}

let key = Key::Balance(addr);
if let Some(transform) = self.effects.transforms().iter().find(|x| x.key() == &key) {
if let TransformKindV2::AddUInt512(added) = transform.kind() {
return *added == amount;
let mut total = U512::zero();
let mut saw_balance_effect = false;
for transform in self.effects.transforms().iter().filter(|x| x.key() == &key) {
match transform.kind() {
TransformKindV2::AddUInt512(added) => {
saw_balance_effect = true;
total = total.saturating_add(*added);
}
TransformKindV2::Write(stored) => {
if let Some(cl_value) = stored.as_cl_value() {
if let Ok(written) = cl_value.clone().into_t::<U512>() {
saw_balance_effect = true;
total = written;
}
}
}
_ => {}
}
}
false
saw_balance_effect.then_some(total)
}
}

Expand Down
7 changes: 5 additions & 2 deletions execution_engine/src/execution/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ impl Executor {
stack,
),
};
let remaining_spending_limit = runtime.context().remaining_spending_limit();
match result {
Ok(ret) => WasmV1Result::new(
gas_limit,
Expand All @@ -160,7 +161,8 @@ impl Executor {
None,
Some(ret),
Some(runtime.context().cache()),
),
)
.with_remaining_spending_limit(remaining_spending_limit),
Err(error) => WasmV1Result::new(
gas_limit,
runtime.context().gas_counter(),
Expand All @@ -170,7 +172,8 @@ impl Executor {
Some(error.into()),
None,
None,
),
)
.with_remaining_spending_limit(remaining_spending_limit),
}
}

Expand Down
2 changes: 1 addition & 1 deletion execution_engine/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! The engine which executes smart contracts on the Casper network.

#![doc(html_root_url = "https://docs.rs/casper-execution-engine/9.0.0")]
#![doc(html_root_url = "https://docs.rs/casper-execution-engine/9.0.1")]
#![doc(
html_favicon_url = "https://raw.githubusercontent.com/casper-network/casper-node/blob/dev/images/Casper_Logo_Favicon_48.png",
html_logo_url = "https://raw.githubusercontent.com/casper-network/casper-node/blob/dev/images/Casper_Logo_Favicon.png",
Expand Down
Loading
Loading