@@ -69,35 +69,17 @@ use tracing::Span;
6969
7070pub const POW_CHECKER_HEIGHT : usize = 32 ;
7171
72- const HARDCODED_CHILD_VK_DIGEST_LIMBS : [ [ u32 ; D_EF ] ; VK_DIGEST_LEN ] = [
73- [ 1913846913 , 1134794404 , 302722344 , 1619176295 ] ,
74- [ 604679097 , 1699744227 , 1924255980 , 872496957 ] ,
75- ] ;
76-
77- fn hardcoded_child_vk_digest ( ) -> [ RecursionField ; VK_DIGEST_LEN ] {
78- HARDCODED_CHILD_VK_DIGEST_LIMBS . map ( |limbs| {
79- RecursionField :: from_basis_coefficients_slice ( & limbs. map ( F :: from_u32) )
80- . expect ( "hardcoded VK digest limbs must match RecursionField degree" )
81- } )
82- }
83-
8472pub ( crate ) fn child_vk_digest ( child_vk : & RecursionVk ) -> [ RecursionField ; VK_DIGEST_LEN ] {
85- if std:: env:: var_os ( "CENO_REC_V2_REAL_VK_DIGEST" ) . is_none ( ) {
86- // TODO(recursion-v2): remove this fixture-specific bypass once VK digest
87- // binding is cheap enough for the debug loop. The real digest path below
88- // spends ~89s absorbing the current 95,043,872-byte imported VK through
89- // Poseidon. These constants are the native digest for that fixture.
90- return hardcoded_child_vk_digest ( ) ;
91- }
92-
9373 static CACHE : OnceLock <
9474 Mutex < std:: collections:: HashMap < usize , [ RecursionField ; VK_DIGEST_LEN ] > > ,
9575 > = OnceLock :: new ( ) ;
76+
9677 let key = child_vk as * const RecursionVk as usize ;
9778 let cache = CACHE . get_or_init ( || Mutex :: new ( std:: collections:: HashMap :: new ( ) ) ) ;
9879 if let Some ( digest) = cache. lock ( ) . unwrap ( ) . get ( & key) . copied ( ) {
9980 return digest;
10081 }
82+
10183 let digest = child_vk. compute_digest ( ) ;
10284 cache. lock ( ) . unwrap ( ) . insert ( key, digest) ;
10385 digest
0 commit comments