diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 493ab2a208..6330132c4e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -62,6 +62,28 @@ jobs: - name: Run ledger tests run: make test-ledger + p2p-messages-tests: + timeout-minutes: 20 + runs-on: ubuntu-24.04 + steps: + - name: Git checkout + uses: actions/checkout@v5 + + - name: Setup build dependencies + uses: ./.github/actions/setup-build-deps + + - name: Setup Rust + uses: ./.github/actions/setup-rust + with: + toolchain: nightly + cache-prefix: p2p-messages-v0 + + - name: Download circuits files + uses: ./.github/actions/setup-circuits + + - name: Run mina-p2p-messages + run: make test-p2p-messages + ledger-32x9-tests: runs-on: ubuntu-24.04 steps: diff --git a/Cargo.toml b/Cargo.toml index 8729dbe790..faa3812018 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -66,7 +66,7 @@ mina-node-account = { path = "node/account" } redux = { git = "https://github.com/o1-labs/redux-rs.git", rev = "06c8366", features = [ "serde", ] } -serde = "1.0.190" +serde = { version = "1.0.190", features = ["derive", "rc"] } serde_json = "1.0.107" serde_with = { version = "3.7.0", features = ["hex"] } static_assertions = "1.1.0" diff --git a/Makefile b/Makefile index 38a92cd562..b3dd574c82 100644 --- a/Makefile +++ b/Makefile @@ -255,6 +255,10 @@ test-release: ## Run tests in release mode test-vrf: ## Run VRF tests, requires nightly Rust @cd vrf && cargo +$(NIGHTLY_RUST_VERSION) test --release -- -Z unstable-options --report-time +.PHONY: test-p2p-messages +test-p2p-messages: + cargo test -p mina-p2p-messages --tests --release + .PHONY: nextest nextest: ## Run tests with cargo-nextest for faster execution @cargo nextest run diff --git a/mina-p2p-messages/Cargo.toml b/mina-p2p-messages/Cargo.toml index 988b8c5fa7..62bafbf939 100644 --- a/mina-p2p-messages/Cargo.toml +++ b/mina-p2p-messages/Cargo.toml @@ -16,7 +16,7 @@ derive_more = "0.99.17" hex = "0.4.3" lazy_static = "1.4.0" num-bigint = "0.4.6" -serde = { version = "1.0.142", features = ["derive"] } +serde = { workspace = true } serde_bytes = "0.11" serde_json = { version = "1.0.83" } sha2 = { version = "0.10.2" } diff --git a/mina-p2p-messages/src/bigint.rs b/mina-p2p-messages/src/bigint.rs index 5ae5d73067..2d4b630c9d 100644 --- a/mina-p2p-messages/src/bigint.rs +++ b/mina-p2p-messages/src/bigint.rs @@ -410,7 +410,8 @@ mod tests { #[test] fn from_numeric_string() { - let hex = "075bcd1500000000000000000000000000000000000000000000000000000000"; + // Big endian encoding + let hex = "00000000000000000000000000000000000000000000000000000000075bcd15"; let deser: BigInt = serde_json::from_str(r#""123456789""#).unwrap(); let mut deser = deser.to_bytes(); diff --git a/mina-p2p-messages/src/rpc.rs b/mina-p2p-messages/src/rpc.rs index d0484ced53..4fa7146011 100644 --- a/mina-p2p-messages/src/rpc.rs +++ b/mina-p2p-messages/src/rpc.rs @@ -188,7 +188,7 @@ mina_rpc!(GetEpochLedgerV2, "get_epoch_ledger", 2, LedgerHashV1, RpcResult