Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
2a09d1f
sml work
QuantumExplorer Feb 14, 2025
f3eaabd
sml work
QuantumExplorer Feb 14, 2025
bbe12ca
sml work
QuantumExplorer Feb 14, 2025
0cdee9d
sml work
QuantumExplorer Feb 14, 2025
5c2088c
sml work
QuantumExplorer Feb 14, 2025
f1406c5
sml work
QuantumExplorer Feb 14, 2025
1cd1725
more work on validation
QuantumExplorer Feb 15, 2025
5afc8d5
more work on validation
QuantumExplorer Feb 15, 2025
7ced8ad
more work on validation
QuantumExplorer Feb 15, 2025
0c83dfb
more work on validation
QuantumExplorer Feb 15, 2025
3ee8fbd
more work on validation
QuantumExplorer Feb 15, 2025
46b69fd
more work on validation
QuantumExplorer Feb 15, 2025
cb3d0e8
more work on validation
QuantumExplorer Feb 15, 2025
7d14e72
more work on validation
QuantumExplorer Feb 16, 2025
4fd09c0
more work on validation
QuantumExplorer Feb 16, 2025
a544950
more work on validation
QuantumExplorer Feb 16, 2025
5626c7d
more work on validation
QuantumExplorer Feb 16, 2025
5b9e6e8
more work on validation
QuantumExplorer Feb 16, 2025
e0cd362
trial
QuantumExplorer Feb 16, 2025
ecfc3c2
trial
QuantumExplorer Feb 16, 2025
31c71ca
trial
QuantumExplorer Feb 16, 2025
66331f3
trial
QuantumExplorer Feb 16, 2025
4c57e29
trial
QuantumExplorer Feb 16, 2025
01292ba
trial
QuantumExplorer Feb 16, 2025
a6f83a1
bincode serialization
QuantumExplorer Feb 16, 2025
5d0493d
bincode serialization
QuantumExplorer Feb 16, 2025
ae0f3b8
bincode serialization
QuantumExplorer Feb 16, 2025
9245c02
bincode serialization
QuantumExplorer Feb 16, 2025
7183a88
bincode serialization
QuantumExplorer Feb 16, 2025
a0dde41
bincode serialization
QuantumExplorer Feb 16, 2025
a1dd13c
bincode serialization
QuantumExplorer Feb 17, 2025
5c4b87e
bincode serialization
QuantumExplorer Feb 17, 2025
d59fac4
bincode serialization
QuantumExplorer Feb 17, 2025
7d56b83
bincode serialization
QuantumExplorer Feb 17, 2025
b421f80
bincode serialization
QuantumExplorer Feb 17, 2025
cbc9795
got things working
QuantumExplorer Feb 17, 2025
366550f
got things working
QuantumExplorer Feb 17, 2025
6bad92b
got things working
QuantumExplorer Feb 17, 2025
81a809f
fixes
QuantumExplorer Feb 17, 2025
ff6873c
fixes
QuantumExplorer Feb 18, 2025
d6be845
quorum info message
QuantumExplorer Feb 18, 2025
fa73e8e
more work on rotation
QuantumExplorer Feb 18, 2025
ec197ed
more work on rotation
QuantumExplorer Feb 19, 2025
fd3e191
more work
QuantumExplorer Feb 21, 2025
fba0e8c
more work
QuantumExplorer Feb 23, 2025
8746c84
more work
QuantumExplorer Feb 23, 2025
cc6eb4d
more work
QuantumExplorer Feb 23, 2025
9c9cc7a
more work
QuantumExplorer Feb 24, 2025
c7f2c30
more work
QuantumExplorer Feb 24, 2025
7dc6a7c
more work
QuantumExplorer Feb 24, 2025
3a1894b
documentation comments
QuantumExplorer Feb 24, 2025
d344b08
more work
QuantumExplorer Feb 24, 2025
2b56fa2
working
QuantumExplorer Feb 24, 2025
d43e7e1
working
QuantumExplorer Feb 24, 2025
820cd52
working
QuantumExplorer Feb 24, 2025
ee3acac
fmt
QuantumExplorer Feb 24, 2025
03cafda
get user tests working
QuantumExplorer Feb 24, 2025
7d46bc3
more fixes
QuantumExplorer Feb 24, 2025
e15137a
optimization
QuantumExplorer Feb 24, 2025
a1423be
optimization
QuantumExplorer Feb 24, 2025
842763e
optimization
QuantumExplorer Feb 24, 2025
295c92d
optimization
QuantumExplorer Feb 24, 2025
128ecc7
added bincode to many types
QuantumExplorer Feb 24, 2025
9e16c5f
fixes for encoding
QuantumExplorer Feb 24, 2025
fef63dc
update rust version
QuantumExplorer Feb 24, 2025
022dca4
update actions
QuantumExplorer Feb 24, 2025
1c7ef06
more fixes
QuantumExplorer Feb 24, 2025
4952631
more fixes
QuantumExplorer Feb 24, 2025
bdd60ee
small improvements
QuantumExplorer Feb 25, 2025
b43c5dd
update of versions
QuantumExplorer Feb 25, 2025
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
12 changes: 6 additions & 6 deletions .github/workflows/fuzz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ jobs:
steps:
- name: Install test dependencies
run: sudo apt-get update -y && sudo apt-get install -y binutils-dev libunwind8-dev libcurl4-openssl-dev libelf-dev libdw-dev cmake gcc libiberty-dev
- uses: actions/checkout@v2
- uses: actions/cache@v2
- uses: actions/checkout@v4
- uses: actions/cache@v4
id: cache-fuzz
with:
path: |
Expand All @@ -50,13 +50,13 @@ jobs:
key: cache-${{ matrix.target }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.65
toolchain: 1.80
override: true
profile: minimal
- name: fuzz
run: cd fuzz && ./fuzz.sh "${{ matrix.fuzz_target }}"
- run: echo "${{ matrix.fuzz_target }}" >executed_${{ matrix.fuzz_target }}
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: executed_${{ matrix.fuzz_target }}
path: executed_${{ matrix.fuzz_target }}
Expand All @@ -66,8 +66,8 @@ jobs:
needs: fuzz
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
- name: Display structure of downloaded files
run: ls -R
- run: find executed_* -type f -exec cat {} + | sort > executed
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ jobs:
AS_DEPENDENCY: true
DO_NO_STD: false
DO_DOCS: true
- rust: 1.65.0
- rust: 1.80.0
env:
AS_DEPENDENCY: true
steps:
- name: Checkout Crate
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Checkout Toolchain
uses: actions-rs/toolchain@v1
with:
Expand Down
83 changes: 75 additions & 8 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[workspace]
members = ["dash", "hashes", "internals", "fuzz"]
resolver = "2"

[patch.crates-io.dashcore_hashes]
path = "hashes"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ architectural mismatches.

## Minimum Supported Rust Version (MSRV)

This library should always compile with any combination of features on **Rust 1.60**.
This library should always compile with any combination of features on **Rust 1.80**.

## Installing Rust

Expand Down
11 changes: 8 additions & 3 deletions dash/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "dashcore"
version = "0.35.0"
version = "0.36.0"
authors = [
"Samuel Westrich <sam@dash.org>",
"Anton Suprunchuk <anton@dash.org>",
Expand All @@ -19,7 +19,7 @@ edition = "2021"

# Please don't forget to add relevant features to docs.rs below
[features]
default = [ "std", "secp-recovery", "core-block-hash-use-x11" ]
default = [ "std", "secp-recovery", "bincode", "quorum_validation" ]
base64 = [ "base64-compat" ]
rand-std = ["secp256k1/rand"]
rand = ["secp256k1/rand"]
Expand All @@ -30,6 +30,8 @@ signer = ["secp-recovery", "rand"]
core-block-hash-use-x11 = ["dashcore_hashes/x11"]
bls = ["blsful"]
eddsa = ["ed25519-dalek"]
quorum_validation = ["bls"]
bincode = [ "dep:bincode", "dashcore_hashes/bincode" ]

# At least one of std, no-std must be enabled.
#
Expand Down Expand Up @@ -61,11 +63,14 @@ anyhow = { version= "1.0" }
hex = { version= "0.4" }
bincode = { version= "2.0.0-rc.3", optional = true }
bitflags = "2.6.0"
blsful = { version = "3.0.0-pre8", optional = true }
blsful = { version = "3.0.0-pre6", optional = true }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did we downgrade blsful?

serde_repr = "0.1.19"
strum = { version = "0.26", features = ["derive"] }
lazy_static = "1.5.0"
ed25519-dalek = { version = "2.1", features = ["rand_core"], optional = true }
blake3 = "1.5"
thiserror = "1"
bls-signatures = { git = "https://github.com/dashpay/bls-signatures", branch = "develop" }

[dev-dependencies]
serde_json = "1.0.96"
Expand Down
3 changes: 3 additions & 0 deletions dash/src/blockdata/script/owned.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#[cfg(doc)]
use core::ops::Deref;

#[cfg(feature = "bincode")]
use bincode::{Decode, Encode};
use hashes::hex;
use secp256k1::{Secp256k1, Verification};

Expand All @@ -26,6 +28,7 @@ use crate::taproot::TapNodeHash;
///
/// [deref coercions]: https://doc.rust-lang.org/std/ops/trait.Deref.html#more-on-deref-coercion
#[derive(Default, Clone, PartialOrd, Ord, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "bincode", derive(Encode, Decode))]
pub struct ScriptBuf(pub Vec<u8>);

impl ScriptBuf {
Expand Down
17 changes: 17 additions & 0 deletions dash/src/blockdata/transaction/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ pub mod txout;

use core::default::Default;

#[cfg(feature = "bincode")]
use bincode::{Decode, Encode};
use hashes::{Hash, sha256d};

use crate::blockdata::constants::WITNESS_SCALE_FACTOR;
Expand Down Expand Up @@ -158,6 +160,7 @@ impl<E> EncodeSigningDataResult<E> {
/// We therefore deviate from the spec by always using the Segwit witness encoding
/// for 0-input transactions, which results in unambiguously parseable transactions.
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Debug, Hash)]
#[cfg_attr(feature = "bincode", derive(Encode, Decode))]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(crate = "actual_serde"))]
pub struct Transaction {
Expand Down Expand Up @@ -911,6 +914,8 @@ mod tests {
use crate::blockdata::constants::WITNESS_SCALE_FACTOR;
use crate::consensus::encode::{deserialize, serialize};
use crate::internal_macros::hex;
use crate::network::message::{NetworkMessage, RawNetworkMessage};
use crate::network::message_sml::MnListDiff;

#[test]
fn test_is_coinbase() {
Expand Down Expand Up @@ -1253,6 +1258,18 @@ mod tests {
assert_eq!(data.len(), 20);
assert_eq!(&data, &pk_data.as_slice());
}

#[test]
fn deserialize_serialize_coinbase_transaction_in_dml() {
let block_hex = include_str!("../../../tests/data/test_DML_diffs/DML_0_2221605.hex");
let data = hex::decode(block_hex).expect("decode hex");
let mn_list_diff: RawNetworkMessage = deserialize(&data).expect("deserialize MnListDiff");
if let NetworkMessage::MnListDiff(diff) = mn_list_diff.payload {
let serialized = serialize(&diff.coinbase_tx);
let deserialized: Transaction =
deserialize(serialized.as_slice()).expect("expected to deserialize");
}
}
}

#[cfg(all(test, feature = "unstable"))]
Expand Down
3 changes: 3 additions & 0 deletions dash/src/blockdata/transaction/outpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ use core::fmt;
#[cfg(feature = "std")]
use std::error;

#[cfg(feature = "bincode")]
use bincode::{Decode, Encode};
use hashes::{self, Hash};

use crate::consensus::{Decodable, Encodable, deserialize, encode};
Expand All @@ -32,6 +34,7 @@ use crate::io;

/// A reference to a transaction output.
#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq, PartialOrd, Ord)]
#[cfg_attr(feature = "bincode", derive(Encode, Decode))]
pub struct OutPoint {
/// The referenced transaction's txid.
pub txid: Txid,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
//!
//! The special transaction type used for AssetLockTx Transactions is 8.

#[cfg(feature = "bincode")]
use bincode::{Decode, Encode};

use crate::consensus::{Decodable, Encodable, encode};
use crate::prelude::*;
use crate::transaction::txout::TxOut;
Expand All @@ -35,6 +38,7 @@ use crate::{VarInt, io};
/// Each TxOut refers to a funding of an Identity.
///
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Debug, Hash)]
#[cfg_attr(feature = "bincode", derive(Encode, Decode))]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(crate = "actual_serde"))]
pub struct AssetLockPayload {
Expand Down
Loading
Loading