From c226c7053e9f48d649b725a3488aa1e8fa5113a5 Mon Sep 17 00:00:00 2001 From: Martin Schere Date: Fri, 24 Jan 2025 10:19:49 +0100 Subject: [PATCH 1/3] fix: dependency list --- Cargo.lock | 152 +++++++++++++++++++++++++++++------------------------ Cargo.toml | 4 +- 2 files changed, 85 insertions(+), 71 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 927872f..f4de8b1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4565,17 +4565,18 @@ dependencies = [ [[package]] name = "pallas" -version = "0.31.0" -source = "git+https://github.com/txpipe/pallas#3a614d2c919ad0483caa41d1ea7373355d37b11b" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6092359c94e86cfc1047b4b5da8284d6d2ee22e4bf0eaa6d9ee8158fb8f1c5b" dependencies = [ - "pallas-addresses 0.31.0", - "pallas-codec 0.31.0", + "pallas-addresses 0.32.0", + "pallas-codec 0.32.0", "pallas-configs", - "pallas-crypto 0.31.0", - "pallas-hardano 0.31.0", - "pallas-network 0.31.0", - "pallas-primitives 0.31.0", - "pallas-traverse 0.31.0", + "pallas-crypto 0.32.0", + "pallas-hardano 0.32.0", + "pallas-network 0.32.0", + "pallas-primitives 0.32.0", + "pallas-traverse 0.32.0", "pallas-txbuilder", "pallas-utxorpc", ] @@ -4598,30 +4599,33 @@ dependencies = [ [[package]] name = "pallas-addresses" -version = "0.31.0" -source = "git+https://github.com/txpipe/pallas#3a614d2c919ad0483caa41d1ea7373355d37b11b" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7bd039d7f1618d12ff348dd03eebe38c5d2a010325750e5341526c419b0f8e0" dependencies = [ "base58", "bech32 0.9.1", "crc", "cryptoxide", "hex", - "pallas-codec 0.31.0", - "pallas-crypto 0.31.0", + "pallas-codec 0.32.0", + "pallas-crypto 0.32.0", "thiserror 1.0.69", ] [[package]] name = "pallas-applying" -version = "0.31.0" -source = "git+https://github.com/txpipe/pallas#3a614d2c919ad0483caa41d1ea7373355d37b11b" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15e103c84957d01753f2103c9d2e8f845638309af54d899c1c857e0b0d45cbcf" dependencies = [ + "chrono", "hex", - "pallas-addresses 0.31.0", - "pallas-codec 0.31.0", - "pallas-crypto 0.31.0", - "pallas-primitives 0.31.0", - "pallas-traverse 0.31.0", + "pallas-addresses 0.32.0", + "pallas-codec 0.32.0", + "pallas-crypto 0.32.0", + "pallas-primitives 0.32.0", + "pallas-traverse 0.32.0", "rand", ] @@ -4639,8 +4643,9 @@ dependencies = [ [[package]] name = "pallas-codec" -version = "0.31.0" -source = "git+https://github.com/txpipe/pallas#3a614d2c919ad0483caa41d1ea7373355d37b11b" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1584d615857c0a44058fb612e892e9e0cc47b56c3c82cdf7347b5c1d1193598c" dependencies = [ "hex", "minicbor 0.25.1", @@ -4650,16 +4655,17 @@ dependencies = [ [[package]] name = "pallas-configs" -version = "0.31.0" -source = "git+https://github.com/txpipe/pallas#3a614d2c919ad0483caa41d1ea7373355d37b11b" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d374a71a037f0801a5feef6521216439f2db31156ca20d53cf8dc4c1af4de17" dependencies = [ "base64 0.22.1", "hex", "num-rational", - "pallas-addresses 0.31.0", - "pallas-codec 0.31.0", - "pallas-crypto 0.31.0", - "pallas-primitives 0.31.0", + "pallas-addresses 0.32.0", + "pallas-codec 0.32.0", + "pallas-crypto 0.32.0", + "pallas-primitives 0.32.0", "serde", "serde_json", "serde_with 3.11.0", @@ -4681,12 +4687,13 @@ dependencies = [ [[package]] name = "pallas-crypto" -version = "0.31.0" -source = "git+https://github.com/txpipe/pallas#3a614d2c919ad0483caa41d1ea7373355d37b11b" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37c1d642326ce402eb9191aeacc3dd0bf2b499848e97a56396c978a6eb9dd31a" dependencies = [ "cryptoxide", "hex", - "pallas-codec 0.31.0", + "pallas-codec 0.32.0", "rand_core 0.6.4", "serde", "thiserror 1.0.69", @@ -4709,12 +4716,13 @@ dependencies = [ [[package]] name = "pallas-hardano" -version = "0.31.0" -source = "git+https://github.com/txpipe/pallas#3a614d2c919ad0483caa41d1ea7373355d37b11b" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "641f1ce6df44330bbf8a707aeffd04b97d7f52cc50284ffe8e73fabf1c91582a" dependencies = [ "binary-layout", - "pallas-network 0.31.0", - "pallas-traverse 0.31.0", + "pallas-network 0.32.0", + "pallas-traverse 0.32.0", "tap", "thiserror 1.0.69", "tracing", @@ -4740,14 +4748,15 @@ dependencies = [ [[package]] name = "pallas-network" -version = "0.31.0" -source = "git+https://github.com/txpipe/pallas#3a614d2c919ad0483caa41d1ea7373355d37b11b" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6e44dd876dc70cbbfc865bb9143131f57edab2c45e873d915732b81982ddb67" dependencies = [ "byteorder", "hex", "itertools 0.13.0", - "pallas-codec 0.31.0", - "pallas-crypto 0.31.0", + "pallas-codec 0.32.0", + "pallas-crypto 0.32.0", "rand", "socket2 0.5.8", "thiserror 1.0.69", @@ -4773,15 +4782,16 @@ dependencies = [ [[package]] name = "pallas-primitives" -version = "0.31.0" -source = "git+https://github.com/txpipe/pallas#3a614d2c919ad0483caa41d1ea7373355d37b11b" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d30f5053073554d016a9f009c077f9a84275951a611cce54230de6c54d34d9b" dependencies = [ "base58", "bech32 0.9.1", "hex", "log", - "pallas-codec 0.31.0", - "pallas-crypto 0.31.0", + "pallas-codec 0.32.0", + "pallas-crypto 0.32.0", "serde", "serde_json", ] @@ -4805,15 +4815,16 @@ dependencies = [ [[package]] name = "pallas-traverse" -version = "0.31.0" -source = "git+https://github.com/txpipe/pallas#3a614d2c919ad0483caa41d1ea7373355d37b11b" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02d2572d316883fe866ae648bc3c5357e70cbbe8de5d78b1246f6109520fa52f" dependencies = [ "hex", "itertools 0.13.0", - "pallas-addresses 0.31.0", - "pallas-codec 0.31.0", - "pallas-crypto 0.31.0", - "pallas-primitives 0.31.0", + "pallas-addresses 0.32.0", + "pallas-codec 0.32.0", + "pallas-crypto 0.32.0", + "pallas-primitives 0.32.0", "paste", "serde", "thiserror 1.0.69", @@ -4821,15 +4832,16 @@ dependencies = [ [[package]] name = "pallas-txbuilder" -version = "0.31.0" -source = "git+https://github.com/txpipe/pallas#3a614d2c919ad0483caa41d1ea7373355d37b11b" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b126cd2f387af2478f9b0f6b422c613f74024350600cf5bd7c31e2c85c3c7062" dependencies = [ "hex", - "pallas-addresses 0.31.0", - "pallas-codec 0.31.0", - "pallas-crypto 0.31.0", - "pallas-primitives 0.31.0", - "pallas-traverse 0.31.0", + "pallas-addresses 0.32.0", + "pallas-codec 0.32.0", + "pallas-crypto 0.32.0", + "pallas-primitives 0.32.0", + "pallas-traverse 0.32.0", "pallas-wallet", "serde", "serde_json", @@ -4838,28 +4850,30 @@ dependencies = [ [[package]] name = "pallas-utxorpc" -version = "0.31.0" -source = "git+https://github.com/txpipe/pallas#3a614d2c919ad0483caa41d1ea7373355d37b11b" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "609f39f3f9b8ff0e8593bfc3e6e3c53a14dd3ed41e1dfac24a41541fc7cab620" dependencies = [ "pallas-applying", - "pallas-codec 0.31.0", - "pallas-crypto 0.31.0", - "pallas-primitives 0.31.0", - "pallas-traverse 0.31.0", + "pallas-codec 0.32.0", + "pallas-crypto 0.32.0", + "pallas-primitives 0.32.0", + "pallas-traverse 0.32.0", "prost-types 0.13.4", "utxorpc-spec", ] [[package]] name = "pallas-wallet" -version = "0.31.0" -source = "git+https://github.com/txpipe/pallas#3a614d2c919ad0483caa41d1ea7373355d37b11b" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "812859b4571cb53182d34094ae3ec391a25d50b0c586be5876d4d86e4eb124bc" dependencies = [ "bech32 0.9.1", "bip39", "cryptoxide", "ed25519-bip32", - "pallas-crypto 0.31.0", + "pallas-crypto 0.32.0", "rand", "thiserror 1.0.69", ] @@ -7641,9 +7655,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "utxorpc" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d187c6e63d23957062f2f6cb173c4d668524cde5d96c97334c8d023a0945740b" +checksum = "bea8f520897c0d0b8048413a2ad72044cc5cbc00c98219a750f048be616f3d7f" dependencies = [ "bytes", "thiserror 1.0.69", @@ -7654,9 +7668,9 @@ dependencies = [ [[package]] name = "utxorpc-spec" -version = "0.14.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7446f5225f26b0e7bf4dfd1712d86caad8cdff14f805d0fa9ff32c65e4fa577b" +checksum = "a9c73cb3e15766a14cbc99fbd6dbbee04496fc9c64b47b088ae1d7698d43e357" dependencies = [ "bytes", "futures-core", diff --git a/Cargo.toml b/Cargo.toml index 6f8a577..d64d92b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,7 +24,7 @@ mithril = ["mithril-client"] [dependencies] # pallas = { version = "0.31", features = ["hardano"] } # pallas = { path = "../pallas/pallas", features = ["hardano"] } -pallas = { git = "https://github.com/txpipe/pallas", features = ["hardano"] } +pallas = { version = "0.32.0", features = ["hardano"] } gasket = { version = "^0.7", features = ["derive"] } gasket-prometheus = { version = "^0.7" } @@ -76,4 +76,4 @@ mithril-client = { version = "^0.8", optional = true, features = ["fs"] } miette = { version = "7.2.0", features = ["fancy"] } itertools = "0.12.1" redis = { version = "0.27.6", optional = true } -utxorpc = { version = "0.9.0", optional = true } +utxorpc = { version = "0.10.0", optional = true } From c8b5a0c981db09b8601619f56ee3a542368bfcfa Mon Sep 17 00:00:00 2001 From: Martin Schere Date: Wed, 19 Feb 2025 14:10:27 +0100 Subject: [PATCH 2/3] fix: daemon --- src/bin/oura/run_daemon.rs | 6 ++--- src/daemon/mod.rs | 21 +++++++++-------- src/sinks/mod.rs | 46 +++++++++++++++++++++++++++++++++----- 3 files changed, 55 insertions(+), 18 deletions(-) diff --git a/src/bin/oura/run_daemon.rs b/src/bin/oura/run_daemon.rs index d0c67b0..40ad071 100644 --- a/src/bin/oura/run_daemon.rs +++ b/src/bin/oura/run_daemon.rs @@ -1,9 +1,9 @@ use gasket::daemon::Daemon; -use oura::framework::*; +use oura::daemon::{run_daemon, ConfigRoot, MetricsConfig}; +use oura::{framework::*, sinks::DummySink}; use std::net::SocketAddr; use std::sync::Arc; use tracing::info; -use oura::daemon::{run_daemon, ConfigRoot, MetricsConfig}; use crate::console; @@ -42,7 +42,7 @@ pub fn run(args: &Args) -> Result<(), Error> { setup_tracing(); } - let config = ConfigRoot::new(&args.config).map_err(Error::config)?; + let config: ConfigRoot = ConfigRoot::new(&args.config).map_err(Error::config)?; let metrics = config.metrics.clone(); let daemon = run_daemon(config)?; diff --git a/src/daemon/mod.rs b/src/daemon/mod.rs index 3634c11..569fe83 100644 --- a/src/daemon/mod.rs +++ b/src/daemon/mod.rs @@ -1,6 +1,10 @@ - +use crate::{ + cursor, filters, + framework::*, + sinks::{self, Sink}, + sources, +}; use gasket::daemon::Daemon; -use crate::{cursor, filters, framework::*, sinks, sources}; use serde::{Deserialize, Serialize}; use std::time::Duration; @@ -10,10 +14,10 @@ pub struct MetricsConfig { } #[derive(Deserialize)] -pub struct ConfigRoot { +pub struct ConfigRoot { pub source: sources::Config, pub filters: Option>, - pub sink: sinks::Config, + pub sink: sinks::Config, pub intersect: IntersectConfig, pub finalize: Option, pub chain: Option, @@ -22,7 +26,7 @@ pub struct ConfigRoot { pub metrics: Option, } -impl ConfigRoot { +impl Deserialize<'de>> ConfigRoot { pub fn new(explicit_file: &Option) -> Result { let mut s = config::Config::builder(); @@ -61,10 +65,10 @@ fn define_gasket_policy(config: Option<&gasket::retries::Policy>) -> gasket::run } } -fn connect_stages( +fn connect_stages( mut source: sources::Bootstrapper, mut filters: Vec, - mut sink: sinks::Bootstrapper, + mut sink: sinks::Bootstrapper, mut cursor: cursor::Bootstrapper, policy: gasket::runtime::Policy, ) -> Result { @@ -91,7 +95,7 @@ fn connect_stages( Ok(runtime) } -pub fn run_daemon(config: ConfigRoot) -> Result { +pub fn run_daemon(config: ConfigRoot) -> Result { let chain = config.chain.unwrap_or_default(); let intersect = config.intersect; let finalize = config.finalize; @@ -118,4 +122,3 @@ pub fn run_daemon(config: ConfigRoot) -> Result { let daemon = connect_stages(source, filters, sink, cursor, retries)?; Ok(daemon) } - diff --git a/src/sinks/mod.rs b/src/sinks/mod.rs index db7719b..5675e36 100644 --- a/src/sinks/mod.rs +++ b/src/sinks/mod.rs @@ -1,4 +1,9 @@ -use gasket::runtime::Tether; +use gasket::{ + framework::Stage, + messaging::{InputPort, OutputPort}, + runtime::Tether, +}; +use pallas::network::miniprotocols::Point; use serde::Deserialize; use crate::framework::*; @@ -41,13 +46,37 @@ mod elasticsearch; #[cfg(feature = "sql")] mod sql_db; -pub enum Bootstrapper { +pub trait Sink { + fn get_input(&mut self) -> &mut InputPort; + fn get_cursor(&mut self) -> &mut OutputPort; + fn spawn(self, policy: gasket::runtime::Policy) -> Tether; +} + +#[derive(Debug, Deserialize)] +pub struct DummySink {} + +impl Sink for DummySink { + fn get_input(&mut self) -> &mut InputPort { + todo!() + } + + fn get_cursor(&mut self) -> &mut OutputPort { + todo!() + } + + fn spawn(self, policy: gasket::runtime::Policy) -> Tether { + todo!() + } +} + +pub enum Bootstrapper { Terminal(terminal::Stage), Stdout(stdout::Stage), Noop(noop::Stage), Assert(assert::Stage), FileRotate(file_rotate::Stage), WebHook(webhook::Stage), + Custom(S), #[cfg(feature = "rabbitmq")] Rabbitmq(rabbitmq::Stage), @@ -80,7 +109,7 @@ pub enum Bootstrapper { SqlDb(sql_db::Stage), } -impl Bootstrapper { +impl Bootstrapper { pub fn borrow_input(&mut self) -> &mut SinkInputPort { match self { Bootstrapper::Terminal(p) => &mut p.input, @@ -89,6 +118,7 @@ impl Bootstrapper { Bootstrapper::Assert(p) => &mut p.input, Bootstrapper::FileRotate(p) => &mut p.input, Bootstrapper::WebHook(p) => &mut p.input, + Bootstrapper::Custom(p) => p.get_input(), #[cfg(feature = "rabbitmq")] Bootstrapper::Rabbitmq(p) => &mut p.input, @@ -130,6 +160,7 @@ impl Bootstrapper { Bootstrapper::Assert(p) => &mut p.cursor, Bootstrapper::FileRotate(p) => &mut p.cursor, Bootstrapper::WebHook(p) => &mut p.cursor, + Bootstrapper::Custom(p) => p.get_cursor(), #[cfg(feature = "rabbitmq")] Bootstrapper::Rabbitmq(p) => &mut p.cursor, @@ -171,6 +202,7 @@ impl Bootstrapper { Bootstrapper::Assert(x) => gasket::runtime::spawn_stage(x, policy), Bootstrapper::FileRotate(x) => gasket::runtime::spawn_stage(x, policy), Bootstrapper::WebHook(x) => gasket::runtime::spawn_stage(x, policy), + Bootstrapper::Custom(x) => x.spawn(policy), #[cfg(feature = "rabbitmq")] Bootstrapper::Rabbitmq(x) => gasket::runtime::spawn_stage(x, policy), @@ -207,13 +239,14 @@ impl Bootstrapper { #[derive(Deserialize)] #[serde(tag = "type")] -pub enum Config { +pub enum Config { Terminal(terminal::Config), Stdout(stdout::Config), Noop(noop::Config), Assert(assert::Config), FileRotate(file_rotate::Config), WebHook(webhook::Config), + Custom(S), #[cfg(feature = "rabbitmq")] Rabbitmq(rabbitmq::Config), @@ -246,8 +279,8 @@ pub enum Config { SqlDb(sql_db::Config), } -impl Config { - pub fn bootstrapper(self, ctx: &Context) -> Result { +impl Config { + pub fn bootstrapper(self, ctx: &Context) -> Result, Error> { match self { Config::Terminal(c) => Ok(Bootstrapper::Terminal(c.bootstrapper(ctx)?)), Config::Stdout(c) => Ok(Bootstrapper::Stdout(c.bootstrapper(ctx)?)), @@ -255,6 +288,7 @@ impl Config { Config::Assert(c) => Ok(Bootstrapper::Assert(c.bootstrapper(ctx)?)), Config::FileRotate(c) => Ok(Bootstrapper::FileRotate(c.bootstrapper(ctx)?)), Config::WebHook(c) => Ok(Bootstrapper::WebHook(c.bootstrapper(ctx)?)), + Config::Custom(c) => Ok(Bootstrapper::Custom(c)), #[cfg(feature = "rabbitmq")] Config::Rabbitmq(c) => Ok(Bootstrapper::Rabbitmq(c.bootstrapper(ctx)?)), From 706138c392f3786e3f70dacbaf8e4aaa1fce85a4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 19 Feb 2025 13:12:19 +0000 Subject: [PATCH 3/3] chore(deps): bump actions/download-artifact in /.github/workflows Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 3 to 4. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3f4bb97..47ddd6b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -175,7 +175,7 @@ jobs: go-version: "1.16" - name: Setup | Artifacts - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 - name: Setup | Checksums run: for file in oura-*/oura-*; do openssl dgst -sha256 -r "$file" | awk '{print $1}' > "${file}.sha256"; done