Skip to content

Commit

Permalink
test: abort signal
Browse files Browse the repository at this point in the history
  • Loading branch information
atanmarko committed Nov 1, 2024
1 parent 78c89db commit e5d51c7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ num-traits = "0.2.19"
nunny = "0.2.1"
once_cell = "1.19.0"
# TODO: update when paladin is released to 0.4.4 with abort signal support
paladin-core = { git = "https://github.com/0xPolygonZero/paladin.git", branch = "feat/abort-signal" }
paladin-core = { git = "https://github.com/0xPolygonZero/paladin.git", branch = "test_abort_signal" }
parking_lot = "0.12.3"
pest = "2.7.10"
pest_derive = "2.7.10"
Expand Down
8 changes: 8 additions & 0 deletions evm_arithmetization/src/prover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ where
{
features_check(&inputs);

tracing::log::info!(">>>>>>>>>>>>>>>>>>> prove {abort_signal:?}");

// Sanity check on the provided config
assert_eq!(DEFAULT_CAP_LEN, 1 << config.fri_config.cap_height);

Expand Down Expand Up @@ -85,6 +87,8 @@ where
let rate_bits = config.fri_config.rate_bits;
let cap_height = config.fri_config.cap_height;

tracing::info!(">>>>>>>>>>>>>>>>>>> PROVE WITH TRACES abort signal {abort_signal:?}");

// For each STARK, we compute the polynomial commitments for the polynomials
// interpolating its trace.
let trace_commitments = timed!(
Expand Down Expand Up @@ -314,6 +318,7 @@ where
C: GenericConfig<D, F = F>,
S: Stark<F, D>,
{
tracing::info!(">>>>>>> PROVING SINGLE TABLE abort signal {abort_signal:?}");
check_abort_signal(abort_signal.clone())?;

// Clear buffered outputs.
Expand Down Expand Up @@ -342,8 +347,10 @@ where
/// the workers, which will result in an early abort for all the other processes
/// involved in the same set of transactions.
pub fn check_abort_signal(abort_signal: Option<Arc<AtomicBool>>) -> Result<()> {
tracing::info!(">>>>>>>>>>>>>>>>>>> check abort signal {abort_signal:?}");
if let Some(signal) = abort_signal {
if signal.load(Ordering::Relaxed) {
tracing::info!(">>>>>>>>>>>>>>>>>>> STOPING JOB WITH ABORT SIGNAL!!!");
return Err(anyhow!("Stopping job from abort signal."));
}
}
Expand Down Expand Up @@ -399,6 +406,7 @@ pub mod testing {
F: RichField + Extendable<D>,
C: GenericConfig<D, F = F>,
{
tracing::log::info!(">>>>>>>>>>>>>>>>>>> prove_all_segments {abort_signal:?}");
let segment_data_iterator = SegmentDataIterator::<F>::new(&inputs, Some(max_cpu_len_log));
let inputs = inputs.trim();
let mut proofs = vec![];
Expand Down

0 comments on commit e5d51c7

Please sign in to comment.