Skip to content

Commit 7d3bbd1

Browse files
committed
Merge mimblewimble staging into staging
2 parents cf6d559 + 62fe977 commit 7d3bbd1

17 files changed

Lines changed: 870 additions & 648 deletions

File tree

Cargo.lock

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

Cargo.toml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "grin"
3-
version = "5.4.1"
3+
version = "5.5.1-alpha.0"
44
authors = ["Grin Developers <mimblewimble@lists.launchpad.net>"]
55
description = "Simple, private and scalable cryptocurrency implementation based on the Mimblewimble chain format."
66
license = "Apache-2.0"
@@ -34,15 +34,15 @@ serde_json = "1"
3434
log = "0.4"
3535
term = "0.6"
3636

37-
grin_api = { path = "./api", version = "5.4.1" }
38-
grin_config = { path = "./config", version = "5.4.1" }
39-
grin_chain = { path = "./chain", version = "5.4.1" }
40-
grin_core = { path = "./core", version = "5.4.1" }
41-
grin_keychain = { path = "./keychain", version = "5.4.1" }
42-
grin_p2p = { path = "./p2p", version = "5.4.1" }
43-
grin_servers = { path = "./servers", version = "5.4.1" }
44-
grin_util = { path = "./util", version = "5.4.1" }
45-
grin_store = { path = "./store", version = "5.4.1" }
37+
grin_api = { path = "./api", version = "5.5.1-alpha.0" }
38+
grin_config = { path = "./config", version = "5.5.1-alpha.0" }
39+
grin_chain = { path = "./chain", version = "5.5.1-alpha.0" }
40+
grin_core = { path = "./core", version = "5.5.1-alpha.0" }
41+
grin_keychain = { path = "./keychain", version = "5.5.1-alpha.0" }
42+
grin_p2p = { path = "./p2p", version = "5.5.1-alpha.0" }
43+
grin_servers = { path = "./servers", version = "5.5.1-alpha.0" }
44+
grin_util = { path = "./util", version = "5.5.1-alpha.0" }
45+
grin_store = { path = "./store", version = "5.5.1-alpha.0" }
4646

4747
[dependencies.cursive]
4848
version = "0.21"
@@ -53,5 +53,5 @@ features = ["pancurses-backend"]
5353
built = { version = "0.8.0", features = ["git2"]}
5454

5555
[dev-dependencies]
56-
grin_chain = { path = "./chain", version = "5.4.1" }
57-
grin_store = { path = "./store", version = "5.4.1" }
56+
grin_chain = { path = "./chain", version = "5.5.1-alpha.0" }
57+
grin_store = { path = "./store", version = "5.5.1-alpha.0" }

api/Cargo.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "grin_api"
3-
version = "5.4.1"
3+
version = "5.5.1-alpha.0"
44
authors = ["Grin Developers <mimblewimble@lists.launchpad.net>"]
55
description = "APIs for grin, a simple, private and scalable cryptocurrency implementation based on the Mimblewimble chain format."
66
license = "Apache-2.0"
@@ -32,9 +32,9 @@ async-stream = "0.3"
3232
url = "2.1"
3333
bytes = "1"
3434

35-
grin_core = { path = "../core", version = "5.4.1" }
36-
grin_chain = { path = "../chain", version = "5.4.1" }
37-
grin_p2p = { path = "../p2p", version = "5.4.1" }
38-
grin_pool = { path = "../pool", version = "5.4.1" }
39-
grin_store = { path = "../store", version = "5.4.1" }
40-
grin_util = { path = "../util", version = "5.4.1" }
35+
grin_core = { path = "../core", version = "5.5.1-alpha.0" }
36+
grin_chain = { path = "../chain", version = "5.5.1-alpha.0" }
37+
grin_p2p = { path = "../p2p", version = "5.5.1-alpha.0" }
38+
grin_pool = { path = "../pool", version = "5.5.1-alpha.0" }
39+
grin_store = { path = "../store", version = "5.5.1-alpha.0" }
40+
grin_util = { path = "../util", version = "5.5.1-alpha.0" }

chain/Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "grin_chain"
3-
version = "5.4.1"
3+
version = "5.5.1-alpha.0"
44
authors = ["Grin Developers <mimblewimble@lists.launchpad.net>"]
55
description = "Chain implementation for grin, a simple, private and scalable cryptocurrency implementation based on the Mimblewimble chain format."
66
license = "Apache-2.0"
@@ -23,10 +23,10 @@ chrono = "0.4.11"
2323
lru-cache = "0.1"
2424
lazy_static = "1"
2525

26-
grin_core = { path = "../core", version = "5.4.1" }
27-
grin_keychain = { path = "../keychain", version = "5.4.1" }
28-
grin_store = { path = "../store", version = "5.4.1" }
29-
grin_util = { path = "../util", version = "5.4.1" }
26+
grin_core = { path = "../core", version = "5.5.1-alpha.0" }
27+
grin_keychain = { path = "../keychain", version = "5.5.1-alpha.0" }
28+
grin_store = { path = "../store", version = "5.5.1-alpha.0" }
29+
grin_util = { path = "../util", version = "5.5.1-alpha.0" }
3030

3131
[dev-dependencies]
3232
env_logger = "0.7"

chain/src/txhashset/bitmap_accumulator.rs

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,11 @@ impl Readable for BitmapBlock {
551551
let mut inner = BitVec::from_elem(n_bits, false);
552552
let n = reader.read_u16()?;
553553
for _ in 0..n {
554-
inner.set(reader.read_u16()? as usize, true);
554+
let pos = reader.read_u16()? as usize;
555+
if pos >= n_bits {
556+
return Err(ser::Error::CorruptedData);
557+
}
558+
inner.set(pos, true);
555559
}
556560
inner
557561
}
@@ -560,7 +564,11 @@ impl Readable for BitmapBlock {
560564
let mut inner = BitVec::from_elem(n_bits, true);
561565
let n = reader.read_u16()?;
562566
for _ in 0..n {
563-
inner.set(reader.read_u16()? as usize, false);
567+
let pos = reader.read_u16()? as usize;
568+
if pos >= n_bits {
569+
return Err(ser::Error::CorruptedData);
570+
}
571+
inner.set(pos, false);
564572
}
565573
inner
566574
}
@@ -680,4 +688,18 @@ mod tests {
680688
thread_rng().gen_range(BitmapChunk::LEN_BITS, BitmapBlock::NBITS as usize / 16);
681689
test_roundtrip(entries, true, 2, 4 + 2 * entries, 61);
682690
}
691+
692+
#[test]
693+
fn block_ser_rejects_bad_indices() {
694+
for mode in [1, 2] {
695+
let mut cursor = Cursor::new(vec![1, mode, 0, 1, 4, 0]);
696+
let mut reader = BinReader::new(
697+
&mut cursor,
698+
ProtocolVersion(1),
699+
DeserializationMode::default(),
700+
);
701+
let res: Result<BitmapBlock, _> = Readable::read(&mut reader);
702+
assert!(matches!(res, Err(ser::Error::CorruptedData)));
703+
}
704+
}
683705
}

config/Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "grin_config"
3-
version = "5.4.1"
3+
version = "5.5.1-alpha.0"
44
authors = ["Grin Developers <mimblewimble@lists.launchpad.net>"]
55
description = "Configuration for grin, a simple, private and scalable cryptocurrency implementation based on the Mimblewimble chain format."
66
license = "Apache-2.0"
@@ -16,10 +16,10 @@ serde_derive = "1"
1616
toml = "0.5"
1717
dirs = "2.0"
1818

19-
grin_core = { path = "../core", version = "5.4.1" }
20-
grin_servers = { path = "../servers", version = "5.4.1" }
21-
grin_p2p = { path = "../p2p", version = "5.4.1" }
22-
grin_util = { path = "../util", version = "5.4.1" }
19+
grin_core = { path = "../core", version = "5.5.1-alpha.0" }
20+
grin_servers = { path = "../servers", version = "5.5.1-alpha.0" }
21+
grin_p2p = { path = "../p2p", version = "5.5.1-alpha.0" }
22+
grin_util = { path = "../util", version = "5.5.1-alpha.0" }
2323

2424
[dev-dependencies]
2525
pretty_assertions = "0.6.1"

core/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "grin_core"
3-
version = "5.4.1"
3+
version = "5.5.1-alpha.0"
44
authors = ["Grin Developers <mimblewimble@lists.launchpad.net>"]
55
description = "Chain implementation for grin, a simple, private and scalable cryptocurrency implementation based on the Mimblewimble chain format."
66
license = "Apache-2.0"
@@ -28,8 +28,8 @@ chrono = { version = "0.4.11", features = ["serde"] }
2828
zeroize = { version = "1.1", features =["zeroize_derive"] }
2929
bytes = "0.5"
3030

31-
keychain = { package = "grin_keychain", path = "../keychain", version = "5.4.1" }
32-
util = { package = "grin_util", path = "../util", version = "5.4.1" }
31+
keychain = { package = "grin_keychain", path = "../keychain", version = "5.5.1-alpha.0" }
32+
util = { package = "grin_util", path = "../util", version = "5.5.1-alpha.0" }
3333

3434
[dev-dependencies]
3535
serde_json = "1"

keychain/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "grin_keychain"
3-
version = "5.4.1"
3+
version = "5.5.1-alpha.0"
44
authors = ["Grin Developers <mimblewimble@lists.launchpad.net>"]
55
description = "Chain implementation for grin, a simple, private and scalable cryptocurrency implementation based on the Mimblewimble chain format."
66
license = "Apache-2.0"
@@ -26,4 +26,4 @@ ripemd160 = "0.9"
2626
sha2 = "0.9"
2727
pbkdf2 = "0.8"
2828

29-
grin_util = { path = "../util", version = "5.4.1" }
29+
grin_util = { path = "../util", version = "5.5.1-alpha.0" }

p2p/Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "grin_p2p"
3-
version = "5.4.1"
3+
version = "5.5.1-alpha.0"
44
authors = ["Grin Developers <mimblewimble@lists.launchpad.net>"]
55
description = "Chain implementation for grin, a simple, private and scalable cryptocurrency implementation based on the Mimblewimble chain format."
66
license = "Apache-2.0"
@@ -23,13 +23,13 @@ log = "0.4"
2323
chrono = { version = "0.4.11", features = ["serde"] }
2424
bytes = "0.5"
2525

26-
grin_core = { path = "../core", version = "5.4.1" }
27-
grin_store = { path = "../store", version = "5.4.1" }
28-
grin_util = { path = "../util", version = "5.4.1" }
29-
grin_chain = { path = "../chain", version = "5.4.1" }
26+
grin_core = { path = "../core", version = "5.5.1-alpha.0" }
27+
grin_store = { path = "../store", version = "5.5.1-alpha.0" }
28+
grin_util = { path = "../util", version = "5.5.1-alpha.0" }
29+
grin_chain = { path = "../chain", version = "5.5.1-alpha.0" }
3030

3131
[dev-dependencies]
32-
grin_pool = { path = "../pool", version = "5.4.1" }
32+
grin_pool = { path = "../pool", version = "5.5.1-alpha.0" }
3333

3434
[build-dependencies]
3535
built = { version = "0.8.0", features = ["git2"]}

pool/Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "grin_pool"
3-
version = "5.4.1"
3+
version = "5.5.1-alpha.0"
44
authors = ["Grin Developers <mimblewimble@lists.launchpad.net>"]
55
description = "Chain implementation for grin, a simple, private and scalable cryptocurrency implementation based on the Mimblewimble chain format."
66
license = "Apache-2.0"
@@ -18,9 +18,9 @@ thiserror = "1"
1818
log = "0.4"
1919
chrono = "0.4.11"
2020

21-
grin_core = { path = "../core", version = "5.4.1" }
22-
grin_keychain = { path = "../keychain", version = "5.4.1" }
23-
grin_util = { path = "../util", version = "5.4.1" }
21+
grin_core = { path = "../core", version = "5.5.1-alpha.0" }
22+
grin_keychain = { path = "../keychain", version = "5.5.1-alpha.0" }
23+
grin_util = { path = "../util", version = "5.5.1-alpha.0" }
2424

2525
[dev-dependencies]
26-
grin_chain = { path = "../chain", version = "5.4.1" }
26+
grin_chain = { path = "../chain", version = "5.5.1-alpha.0" }

0 commit comments

Comments
 (0)