Skip to content
Merged
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
4 changes: 3 additions & 1 deletion .github/workflows/run-tests-on-push-to-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ jobs:
--package acropolis_module_snapshot_bootstrapper \
--package acropolis_module_spdd_state \
--package acropolis_module_stake_delta_filter \
--package acropolis_module_tx_submitter \
--package acropolis_module_upstream_chain_fetcher \
--package acropolis_module_utxo_state
--package acropolis_module_utxo_state \
--package acropolis_process_tx_submitter_cli

- name: Run Build
run: cargo build --verbose
Expand Down
33 changes: 33 additions & 0 deletions Cargo.lock

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

10 changes: 6 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@ members = [
"modules/historical_accounts_state", # Tracks historical account information
"modules/consensus", # Chooses favoured chain across multiple options
"modules/chain_store", # Tracks historical information about blocks and TXs
"modules/tx_submitter", # Submits TXs to peers

# Process builds
"processes/omnibus", # All-inclusive omnibus process
"processes/replayer", # All-inclusive process to replay messages
"processes/golden_tests", # All-inclusive golden tests process
"processes/omnibus", # All-inclusive omnibus process
"processes/replayer", # All-inclusive process to replay messages
"processes/golden_tests", # All-inclusive golden tests process
"processes/tx_submitter_cli", # CLI wrapper for TX submitter
]
resolver = "2"

Expand All @@ -41,7 +43,7 @@ caryatid_module_clock = "0.12"
caryatid_module_spy = "0.12"
anyhow = "1.0"
chrono = "0.4"
clap = { version = "4.5", features = ["derive"] }
clap = { version = "4.5", features = ["derive", "string"] }
config = "0.15.11"
dashmap = "6.1.0"
hex = "0.4"
Expand Down
1 change: 1 addition & 0 deletions common/src/commands/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub mod transactions;
19 changes: 19 additions & 0 deletions common/src/commands/transactions.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
use serde_with::{hex::Hex, serde_as};

use crate::TxHash;

#[serde_as]
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub enum TransactionsCommand {
Submit {
#[serde_as(as = "Hex")]
cbor: Vec<u8>,
wait_for_ack: bool,
},
}

#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub enum TransactionsCommandResponse {
Submitted { id: TxHash },
Error(String),
}
1 change: 1 addition & 0 deletions common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ pub mod address;
pub mod byte_array;
pub mod calculations;
pub mod cip19;
pub mod commands;
pub mod crypto;
pub mod genesis_values;
pub mod hash;
Expand Down
15 changes: 15 additions & 0 deletions common/src/messages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// We don't use these messages in the acropolis_common crate itself
#![allow(dead_code)]

use crate::commands::transactions::{TransactionsCommand, TransactionsCommandResponse};
use crate::genesis_values::GenesisValues;
use crate::ledger_state::SPOState;
use crate::protocol_params::{NonceHash, ProtocolParams};
Expand Down Expand Up @@ -350,6 +351,10 @@ pub enum Message {
// State query messages
StateQuery(StateQuery),
StateQueryResponse(StateQueryResponse),

// Commands
Command(Command),
CommandResponse(CommandResponse),
}

// Casts from specific Caryatid messages
Expand Down Expand Up @@ -422,3 +427,13 @@ pub enum StateQueryResponse {
UTxOs(UTxOStateQueryResponse),
SPDD(SPDDStateQueryResponse),
}

#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub enum Command {
Transactions(TransactionsCommand),
}

#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub enum CommandResponse {
Transactions(TransactionsCommandResponse),
}
23 changes: 23 additions & 0 deletions modules/tx_submitter/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[package]
name = "acropolis_module_tx_submitter"
version = "0.1.0"
edition = "2024"
authors = ["Simon Gellis <[email protected]>"]
description = "TX submission module for Acropolis"
license = "Apache-2.0"

[dependencies]
acropolis_common = { path = "../../common" }

caryatid_sdk = { workspace = true }

anyhow = { workspace = true }
config = { workspace = true }
futures = "0.3.31"
hex = { workspace = true }
pallas = { workspace = true }
tokio = { workspace = true }
tracing = { workspace = true }

[lib]
path = "src/tx_submitter.rs"
21 changes: 21 additions & 0 deletions modules/tx_submitter/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# TX submission module

The TX submission module implements the TXSubmission node-to-node protocol to submit transactions to a single upstream source.

## Messages

The TX submission module listens for requests to submit transactions on the `cardano.txs.submit` topic. It will send a response once any upstream server has acknowledged the transaction.

## Default configuration

```toml
[module.tx-submitter]

# Upstream node connection
node-address = "backbone.cardano.iog.io:3001"
magic-number = 764824073

# Message topics
subscribe-topic = "cardano.txs.submit"

```
Loading