Skip to content

Commit 17f78b0

Browse files
authored
feat: Update Proven Transaction Submission with TX Inputs (0xMiden#1421)
1 parent d8f56fe commit 17f78b0

File tree

13 files changed

+85
-32
lines changed

13 files changed

+85
-32
lines changed

.github/workflows/msrv.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ jobs:
2626
with:
2727
targets: wasm32-unknown-unknown
2828
- uses: Swatinem/rust-cache@v2
29+
- name: Ensure stable toolchain is installed
30+
run: rustup toolchain install stable --profile minimal
2931
- name: Install cargo-msrv
3032
run: cargo install cargo-msrv
3133
- name: Check MSRV for each workspace member

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@
1515
* Implemented shared source manager for better error reporting ([#1275](https://github.com/0xMiden/miden-client/pull/1275)).
1616
* Added `getMapEntries` method to `AccountStorage` in web client for iterating storage map entries ([#1323](https://github.com/0xMiden/miden-client/pull/1323)).
1717
* Refactored code into their own files and added `ProvenTransaction` and `TransactionStoreUpdate` bindings for the WebClient ([#1408](https://github.com/0xMiden/miden-client/pull/1408)).
18-
* Added `NoteFile` type, used for exporting and importing `Notes`([#1378](https://github.com/0xMiden/miden-client/pull/1383))
18+
* Added `NoteFile` type, used for exporting and importing `Notes` ([#1378](https://github.com/0xMiden/miden-client/pull/1383)).
1919
* Build `IndexedDB` code from a `build.rs` instead of pushing artifacts to the repo ([#1409](https://github.com/0xMiden/miden-client/pull/1409)).
2020
* Implemented missing RPC endpoints: `/SyncStorageMaps`, `/SyncAccountVault` & `/SyncTransactions` ([#1362](https://github.com/0xMiden/miden-client/pull/1362)).
21+
* Updated `submit_proven_transaction()` to include `TransactionInputs` for validator ([#1421](https://github.com/0xMiden/miden-client/pull/1421)).
2122

2223
### Changes
2324

Cargo.lock

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

bin/integration-tests/src/tests/client.rs

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,23 +104,41 @@ pub async fn test_multiple_tx_on_same_block(client_config: ClientConfig) -> Resu
104104
let transaction_id_1 = transaction_execution_result_1.executed_transaction().id();
105105
let tx_prove_1 =
106106
client.testing_prove_transaction(&transaction_execution_result_1).await.unwrap();
107-
client.testing_apply_transaction(transaction_execution_result_1).await.unwrap();
107+
client
108+
.testing_apply_transaction(transaction_execution_result_1.clone())
109+
.await
110+
.unwrap();
108111

109112
let transaction_execution_result_2 =
110113
client.new_transaction(from_account_id, tx_request_2).await.unwrap();
111114
let transaction_id_2 = transaction_execution_result_2.executed_transaction().id();
112115
let tx_prove_2 =
113116
client.testing_prove_transaction(&transaction_execution_result_2).await.unwrap();
114-
client.testing_apply_transaction(transaction_execution_result_2).await.unwrap();
117+
client
118+
.testing_apply_transaction(transaction_execution_result_2.clone())
119+
.await
120+
.unwrap();
115121

116122
client.sync_state().await.unwrap();
117123

118124
// wait for 1 block
119125
wait_for_blocks(&mut client, 1).await;
120126

121127
// Submit the proven transactions
122-
client.testing_submit_proven_transaction(tx_prove_1).await.unwrap();
123-
client.testing_submit_proven_transaction(tx_prove_2).await.unwrap();
128+
client
129+
.testing_submit_proven_transaction(
130+
tx_prove_1,
131+
transaction_execution_result_1.executed_transaction().tx_inputs().clone(),
132+
)
133+
.await
134+
.unwrap();
135+
client
136+
.testing_submit_proven_transaction(
137+
tx_prove_2,
138+
transaction_execution_result_2.executed_transaction().tx_inputs().clone(),
139+
)
140+
.await
141+
.unwrap();
124142

125143
// wait for 1 block
126144
wait_for_tx(&mut client, transaction_id_1).await?;

bin/integration-tests/src/tests/network_transaction.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,18 @@ pub async fn test_recall_note_before_ntx_consumes_it(client_config: ClientConfig
210210
let consume_proof = client.testing_prove_transaction(&consume_transaction).await?;
211211

212212
// Submit both transactions
213-
client.testing_submit_proven_transaction(bump_proof).await?;
214-
client.testing_submit_proven_transaction(consume_proof).await?;
213+
client
214+
.testing_submit_proven_transaction(
215+
bump_proof,
216+
bump_transaction.executed_transaction().tx_inputs().clone(),
217+
)
218+
.await?;
219+
client
220+
.testing_submit_proven_transaction(
221+
consume_proof,
222+
consume_transaction.executed_transaction().tx_inputs().clone(),
223+
)
224+
.await?;
215225

216226
client.testing_apply_transaction(consume_transaction).await?;
217227

crates/rust-client/src/rpc/generated/nostd/rpc_store.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ pub struct SyncTransactionsResponse {
457457
/// Represents a transaction record.
458458
#[derive(Clone, PartialEq, ::prost::Message)]
459459
pub struct TransactionRecord {
460-
/// Block number in which the transaction was executed.
460+
/// Block number in which the transaction was included.
461461
#[prost(fixed32, tag = "1")]
462462
pub block_num: u32,
463463
/// A transaction header.

crates/rust-client/src/rpc/generated/nostd/transaction.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ pub struct ProvenTransaction {
66
/// \[miden_objects::transaction::proven_tx::ProvenTransaction\].
77
#[prost(bytes = "vec", tag = "1")]
88
pub transaction: ::prost::alloc::vec::Vec<u8>,
9+
/// Transaction inputs encoded using \[winter_utils::Serializable\] implementation for
10+
/// \[miden_objects::transaction::TransactionInputs\].
11+
#[prost(bytes = "vec", optional, tag = "2")]
12+
pub transaction_inputs: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
913
}
1014
#[derive(Clone, PartialEq, ::prost::Message)]
1115
pub struct ProvenTransactionBatch {

crates/rust-client/src/rpc/generated/std/rpc_store.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ pub struct SyncTransactionsResponse {
457457
/// Represents a transaction record.
458458
#[derive(Clone, PartialEq, ::prost::Message)]
459459
pub struct TransactionRecord {
460-
/// Block number in which the transaction was executed.
460+
/// Block number in which the transaction was included.
461461
#[prost(fixed32, tag = "1")]
462462
pub block_num: u32,
463463
/// A transaction header.

crates/rust-client/src/rpc/generated/std/transaction.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ pub struct ProvenTransaction {
66
/// \[miden_objects::transaction::proven_tx::ProvenTransaction\].
77
#[prost(bytes = "vec", tag = "1")]
88
pub transaction: ::prost::alloc::vec::Vec<u8>,
9+
/// Transaction inputs encoded using \[winter_utils::Serializable\] implementation for
10+
/// \[miden_objects::transaction::TransactionInputs\].
11+
#[prost(bytes = "vec", optional, tag = "2")]
12+
pub transaction_inputs: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
913
}
1014
#[derive(Clone, PartialEq, ::prost::Message)]
1115
pub struct ProvenTransactionBatch {

crates/rust-client/src/rpc/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ use miden_objects::account::{Account, AccountCode, AccountHeader, AccountId};
5555
use miden_objects::block::{BlockHeader, BlockNumber, ProvenBlock};
5656
use miden_objects::crypto::merkle::{MmrProof, SmtProof};
5757
use miden_objects::note::{NoteId, NoteScript, NoteTag, Nullifier};
58-
use miden_objects::transaction::ProvenTransaction;
58+
use miden_objects::transaction::{ProvenTransaction, TransactionInputs};
5959

6060
/// Contains domain types related to RPC requests and responses, as well as utility functions
6161
/// for dealing with them.
@@ -105,6 +105,7 @@ pub trait NodeRpcClient: Send + Sync {
105105
async fn submit_proven_transaction(
106106
&self,
107107
proven_transaction: ProvenTransaction,
108+
transaction_inputs: TransactionInputs,
108109
) -> Result<BlockNumber, RpcError>;
109110

110111
/// Given a block number, fetches the block header corresponding to that height from the node

0 commit comments

Comments
 (0)