Audit and refactoring of commitments workflows. Vesper support#204
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #204 +/- ##
========================================
- Coverage 16.8% 16.0% -0.7%
========================================
Files 32 33 +1
Lines 3896 4001 +105
========================================
- Hits 653 642 -11
- Misses 3243 3359 +116
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
|
Hi @dr-orlovsky, I noticed that this change causes an error in the contracts of RGB20 and RGB25: Every time we execute the Because this doesn't happen with RGB21, I assume it's related to !!! Update !!! After some verification, I noticed this change causes the error: https://github.com/RGB-WG/rgb-core/pull/206/files#diff-bc03f4e1f24cc17c9393d8df61c0d41c5801bd6c8b8b8b58f80a37fbf738b028R467-R468 |
|
@crisdut yeah, I see the reason. Will work on fix |
remove their strict encoding
a07dd51 to
7f40c94
Compare
|
@crisdut thank you for finding the source of the issue. In 86fb382 I fixed the code such that it is impossible to call a method returning an invalid commitment value. |
|
I tried transfer with all latest version of the crates and I find a new error:
After investigate, we try commit a unnamed type here (the pub struct TransitionBundle {
pub input_map: Confined<BTreeMap<Vin, OpId>, 1, U16>,
pub known_transitions: Confined<BTreeMap<OpId, Transition>, 1, U16>,
}
impl CommitEncode for TransitionBundle {
type CommitmentId = BundleId;
fn commit_encode(&self, e: &mut CommitEngine) { e.commit_to(&self.input_map); } <------ error here
}The error occurs because // ./strict_enconding/rust/src/embedded.rs:547
impl<K: StrictType + Ord + Hash, V: StrictType, const MIN_LEN: usize, const MAX_LEN: usize>
StrictType for Confined<BTreeMap<K, V>, MIN_LEN, MAX_LEN>
{
const STRICT_LIB_NAME: &'static str = LIB_EMBEDDED;
fn strict_name() -> Option<TypeName> { None }
}While the other types evoke another impl: // ./strict_enconding/rust/src/types.rs:48
pub trait StrictType: Sized {
const STRICT_LIB_NAME: &'static str;
fn strict_name() -> Option<TypeName> {
fn get_ident(path: &str) -> &str {
path.rsplit_once("::")
.map(|(_, n)| n.trim())
.unwrap_or(path)
}
let name = any::type_name::<Self>().replace('&', "");
let mut ident = vec![];
for mut arg in name.split([',', '<', '>', '(', ')']) {
arg = arg.trim();
if arg.is_empty() {
continue;
}
ident.push(get_ident(arg));
}
Some(tn!(ident.join("")))
}
} |
|
@crisdut thanks for reporting the details of the source of the error. Fixed in 1759eab |
Disclose info and hash ids
No description provided.