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

feat: Hook up secondary calldata column in dsl #7759

Merged
merged 13 commits into from
Aug 7, 2024
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,29 @@ TEST_F(AcirIntegrationTest, DISABLED_Databus)
EXPECT_TRUE(prove_and_verify_honk<Flavor>(builder));
}

/**
*@brief Test a program that uses two databus calldata columns
*
*/
TEST_F(AcirIntegrationTest, DISABLED_DatabusTwoCalldata)
{
using Flavor = MegaFlavor;
using Builder = Flavor::CircuitBuilder;

std::string test_name = "databus_two_calldata";
info("Test: ", test_name);
acir_format::AcirProgram acir_program = get_program_data_from_test_file(test_name);

// Construct a bberg circuit from the acir representation
Builder builder = acir_format::create_circuit<Builder>(acir_program.constraints, 0, acir_program.witness);

// This prints a summary of the types of gates in the circuit
builder.blocks.summarize();

// Construct and verify Honk proof
EXPECT_TRUE(prove_and_verify_honk<Flavor>(builder));
}

/**
* @brief Ensure that adding gates post-facto to a circuit generated from acir still results in a valid circuit
* @details This is a pattern required by e.g. ClientIvc which appends recursive verifiers to acir-generated circuits
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[package]
name = "databus_two_calldata"
type = "bin"
authors = [""]

[dependencies]
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
idx = "1"
y = [7, 9]
z = [1,2,3,4]
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
fn main(mut idx: u32, y: call_data(0) [u32; 2], z: call_data(1) [u32; 4]) -> return_data u32 {
ledwards2225 marked this conversation as resolved.
Show resolved Hide resolved
let a = y[idx];
let b = z[idx];
a + b
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[package]
name = "databus_two_calldata_simple"
type = "bin"
authors = [""]

[dependencies]
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
idx = "1"
y = 7
z = [1,2,3,4]
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
fn main(mut idx: u32, y: call_data(0) u32, z: call_data(1) [u32; 4]) -> return_data u32 {
ledwards2225 marked this conversation as resolved.
Show resolved Hide resolved
let b = z[idx];
b + y
}
Loading