Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add version compatability #316

Closed
sinui0 opened this issue Sep 4, 2023 · 3 comments
Closed

Add version compatability #316

sinui0 opened this issue Sep 4, 2023 · 3 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@sinui0
Copy link
Member

sinui0 commented Sep 4, 2023

At the beginning of things, the prover and notary should exchange which versions they are running with each other. We can start using semver and both parties can check whether they support their peers' version.

@sinui0 sinui0 added enhancement New feature or request good first issue Good for newcomers labels Sep 4, 2023
@Sicolas-Flamel
Copy link

Prover's Code

prover_version = "1.2.3" # Your software version

Notary's Code

notary_version = "1.2.0" # Notary's software version

Compare versions

def check_compatibility(v1, v2):
major1, minor1, patch1 = map(int, v1.split("."))
major2, minor2, patch2 = map(int, v2.split("."))

if major1 != major2:
    return False
if minor1 < minor2 or (minor1 == minor2 and patch1 < patch2):
    return False
return True

Check compatibility

if check_compatibility(prover_version, notary_version):
print("Versions are compatible. Proceed with verification.")
else:
print("Versions are not compatible. Please update software.")

like this?

@sinui0
Copy link
Member Author

sinui0 commented Sep 5, 2023

For parsing and assertions, I had in mind to use this semver crate.

We would store the cargo package version as a static at build time:

const VERSION: &'static str = env!("CARGO_PKG_VERSION");

Then introduce a new message variant to

#[derive(Debug, Serialize, Deserialize)]
#[allow(missing_docs)]
pub enum TlsnMessage {
/// Contains the merkle root of the merkle tree of the commitments to transcripts
TranscriptCommitmentRoot(MerkleRoot),
/// Contains the session header signed by the notary
SignedSessionHeader(SignedSessionHeader),
/// Contains the session header
SessionHeader(SessionHeader),
}

which is used to exchange configuration information, including VERSION, at the beginning of the protocol.

@yuroitaki
Copy link
Member

Addressed by #513.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants