Skip to content

Commit

Permalink
Merge pull request #21 from topos-protocol/constants
Browse files Browse the repository at this point in the history
  • Loading branch information
Nashtare authored Feb 6, 2024
2 parents 507a8b9 + 6264580 commit 58e9fa6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
14 changes: 7 additions & 7 deletions plonky_block_proof_gen/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
use core::ops::Range;

/// Default range to be used for the `ArithmeticStark` table.
pub(crate) const DEFAULT_ARITHMETIC_RANGE: Range<usize> = 16..20;
pub(crate) const DEFAULT_ARITHMETIC_RANGE: Range<usize> = 16..28;
/// Default range to be used for the `BytePackingStark` table.
pub(crate) const DEFAULT_BYTE_PACKING_RANGE: Range<usize> = 10..20;
pub(crate) const DEFAULT_BYTE_PACKING_RANGE: Range<usize> = 9..28;
/// Default range to be used for the `CpuStark` table.
pub(crate) const DEFAULT_CPU_RANGE: Range<usize> = 12..22;
pub(crate) const DEFAULT_CPU_RANGE: Range<usize> = 12..28;
/// Default range to be used for the `KeccakStark` table.
pub(crate) const DEFAULT_KECCAK_RANGE: Range<usize> = 14..17;
pub(crate) const DEFAULT_KECCAK_RANGE: Range<usize> = 14..25;
/// Default range to be used for the `KeccakSpongeStark` table.
pub(crate) const DEFAULT_KECCAK_SPONGE_RANGE: Range<usize> = 9..14;
pub(crate) const DEFAULT_KECCAK_SPONGE_RANGE: Range<usize> = 9..25;
/// Default range to be used for the `LogicStark` table.
pub(crate) const DEFAULT_LOGIC_RANGE: Range<usize> = 12..16;
pub(crate) const DEFAULT_LOGIC_RANGE: Range<usize> = 12..28;
/// Default range to be used for the `MemoryStark` table.
pub(crate) const DEFAULT_MEMORY_RANGE: Range<usize> = 17..25;
pub(crate) const DEFAULT_MEMORY_RANGE: Range<usize> = 17..30;
10 changes: 7 additions & 3 deletions plonky_block_proof_gen/src/prover_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,14 @@ pub struct ProverStateBuilder {
}

impl Default for ProverStateBuilder {
/// Generates a new builder from a set of default ranges.
/// These ranges should be sufficient to prove any transaction,
/// but will require a significant amount of RAM (around 30GB).
///
/// Specifying shorter ranges will allow for a lower memory
/// consumption, with the drawback of possibly not being sufficient
/// for some transactions.
fn default() -> Self {
// The default ranges are somewhat arbitrary, but should be enough for testing
// purposes against most transactions.
// Some heavy contract deployments may require bumping these ranges though.
Self {
arithmetic_circuit_size: DEFAULT_ARITHMETIC_RANGE,
byte_packing_circuit_size: DEFAULT_BYTE_PACKING_RANGE,
Expand Down

0 comments on commit 58e9fa6

Please sign in to comment.