Skip to content
This repository was archived by the owner on Apr 18, 2025. It is now read-only.

Conversation

roynalnaruto
Copy link

Description

The SNARK protocol of chunk-level SNARKs, i.e. layer-2 SNARKs was previously a constant because the route taken in the proving stack was fixed: super_circuit -> compression -> compression.

In order to allow more than one routes, specifically:

  • super_circuit -> compression -> compression
  • sp1 compressed proof -> halo2-backend -> compression

we must allow the SNARK protocol to instead be a witness. The expected values for those protocols are picked from file descriptors under prover::consts module.

The SNARK protocol comprises of the transcript's initial state and commitments to a set of preprocessed polynomials. We apply the following constraints:

# for each layer-2 SNARK's transcript initial state and preprocessed polynomials
# together known as the SNARK protocol
for init_state, preprocessed_polys in zip(transcript_init_states, preprocessed_polys_set):
	# each preprocessed polynomial
	route_check_halo2 = 1
	for i, poly in enumerate(preprocessed_polys):
		# belongs to either the halo2-route or the sp1-route 
		assert(poly in [POLY_HALO2[i], POLY_SP1[i]])
		# is this SNARK from the halo2-route?
		route_check_halo2 = route_check_halo2 * (poly == POLY_HALO2[i])
	
	# if the SNARK is from the halo2-route
	if route_check_halo2:
		assert(init_state == INIT_STATE_HALO2)
	else:
		assert(init_state == INIT_STATE_SP1)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

@roynalnaruto
Copy link
Author

Closing due to error with managing conflicts, will re-open after fix

@roynalnaruto roynalnaruto deleted the feat/upgrade-5 branch November 5, 2024 13:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant