Skip to content
This repository has been archived by the owner on Mar 14, 2023. It is now read-only.

It should not be possible to change blockhash before agreement point #75

Open
evanlinjin opened this issue Dec 6, 2022 · 1 comment
Labels
bug Something isn't working needs further discussion Needs further discussion

Comments

@evanlinjin
Copy link
Collaborator

The following should not be possible.

#[test]
fn fix_blockhash_before_agreement_point() {
let chain1 = chain!([0, h!("im-wrong")], [1, h!("we-agree")]);
let chain2 = chain!([0, h!("fix")], [1, h!("we-agree")]);
assert_eq!(
chain1.determine_changeset(&chain2),
Ok(changeset! {
checkpoints: [(0, Some(h!("fix")))],
txids: []
})
)
}

@evanlinjin evanlinjin added the bug Something isn't working label Dec 6, 2022
@LLFourn
Copy link
Owner

LLFourn commented Dec 6, 2022

It should not be possible but is it actually desirable to detect and prevent this? It is a "sparse chain" after all. We cannot make guarantees about everything -- for that use a full chain!

@evanlinjin evanlinjin added the needs further discussion Needs further discussion label Jan 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working needs further discussion Needs further discussion
Projects
Status: No status
Development

No branches or pull requests

2 participants