Incompatible Value binary serialization format
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Reproduce the issue using the Value::Confidential example and both bincode serialization options shown in the report. Compare the current behavior with v0.16 and inspect the Value serialization changes in PRs 98 and 96. Done means the compatibility problem is resolved and the resulting bytes are verified against the reported v0.16 format.
Written by the indexing model from the issue text.
Description
It appears that the bincode value fix resulted in a different serialization format compared to before the regression (v0.16).
With current master (fe3e9469618a479de02f8ececf92f9d456fc4c38), the following code:
let commitment = PedersenCommitment::from_slice(&Vec::from_hex("09b88680778d3d5530785ff12bb62e6ac98c7be5a8b9b0ea392e166bf61ea77ee4").unwrap()).unwrap();
let value = Value::Confidential(commitment);
println!("BE bytes: {}", bincode::serialize(&value).unwrap().to_hex());
println!("LE bytes: {}", bincode::DefaultOptions::default().with_little_endian()
.serialize(&value).unwrap().to_hex());
Results in the following serialization:
BE bytes: 020000000000000002210000000000000009b88680778d3d5530785ff12bb62e6ac98c7be5a8b9b0ea392e166bf61ea77ee4
LE bytes: 02022109b88680778d3d5530785ff12bb62e6ac98c7be5a8b9b0ea392e166bf61ea77ee4
While with v0.16, the following code:
let value = Value::from_commitment(&Vec::from_hex("09b88680778d3d5530785ff12bb62e6ac98c7be5a8b9b0ea392e166bf61ea77ee4").unwrap()).unwrap();
println!("BE bytes: {}", bincode::serialize(&value).unwrap().to_hex());
println!("LE bytes: {}", bincode::DefaultOptions::default().with_little_endian()
.serialize(&value).unwrap().to_hex());
Results in the following serialization:
BE bytes: 020000000000000009b88680778d3d5530785ff12bb62e6ac98c7be5a8b9b0ea392e166bf61ea77ee4
LE bytes: 0209b88680778d3d5530785ff12bb62e6ac98c7be5a8b9b0ea392e166bf61ea77ee4
- Dominant language
- Rust
- Stars
- 57
- Forks
- 40
- Avg merge
- 11h 58m
- Merged PRs (30d)
- 1
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ElementsProject/rust-elements
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
ElementsProject/rust-elements#290 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
ElementsProject/rust-elements#277 ·
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
ElementsProject/rust-elements#273 · 3 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
ElementsProject/rust-elements#268 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 52/100
ElementsProject/rust-elements#262 · 2 comments · 1 reaction ·
All issues in ElementsProject/rust-elements
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
gitbutlerapp/gitbutler#15998 · 1 comment ·
-
bug triage:deciding
Difficulty 1/5 Under an hour Newbie friendliness 88/100
open-telemetry/otel-arrow#4132 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100