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

taiga data format and api #222

Merged
merged 6 commits into from
Oct 11, 2023
Merged

taiga data format and api #222

merged 6 commits into from
Oct 11, 2023

Conversation

XuyangSong
Copy link
Collaborator

  • basic taiga data format and layout
  • simplified Taiga APIs for external
  • add hints to the partial transaction
  • add a new partial transaction creation API to support concrete circuit presentation instead of dynamic one.

taiga_halo2/src/circuit/vp_bytecode.rs Show resolved Hide resolved
taiga_halo2/src/circuit/vp_bytecode.rs Outdated Show resolved Hide resolved
ValidityPredicateRepresentation::VampIR(circuit) => {
// TDDO: use the file_name api atm,
// request vamp_ir to provide a api to generate circuit from bytes.
let vamp_ir_circuit_file =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, we are unlikely to use files per se in the normal operation of Anoma

}

impl ShieldedPartialTransaction {
#[cfg(feature = "borsh")]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It feels like this might be ok to have even if borsh feature is not enabled

Copy link
Collaborator Author

@XuyangSong XuyangSong Oct 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It won't compile. TrivialValidityPredicateCircuit uses the borsh to generate the ValidityPredicateByteCode.
Should we set a default serialization feature(serde or borsh) inside Taiga? Adding the feature flag everywhere is annoying if I want to use a serialization underlying.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, ok. I'm not sure if having borsh and/or serde on by default is a better choice than having them behind a feature flag.

@@ -66,12 +69,48 @@ struct ShieldedPartialTransactionProxy {
inputs: Vec<NoteVPVerifyingInfoSet>,
outputs: Vec<NoteVPVerifyingInfoSet>,
binding_sig_r: pallas::Scalar,
hints: Vec<u8>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is hints?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's Jeremy's requirement.
hints describes intents or partial tx to help the solver match. It will be handled outside of Taiga.

@@ -42,6 +42,7 @@ pub struct ShieldedPartialTxBundle(Vec<ShieldedPartialTransaction>);
#[derive(Debug, Clone, PartialEq, Eq)]
#[cfg_attr(feature = "nif", derive(NifStruct))]
#[cfg_attr(feature = "nif", module = "Taiga.Transaction.Result")]
#[cfg_attr(feature = "borsh", derive(BorshSerialize, BorshDeserialize))]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably also should have
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]

Copy link
Contributor

@bazzilic bazzilic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@XuyangSong XuyangSong merged commit fe2e920 into main Oct 11, 2023
7 checks passed
@XuyangSong XuyangSong deleted the xuyang/taiga_api branch November 10, 2023 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants