@@ -721,6 +721,7 @@ impl BlobDataConfig {
721721
722722 let challenge_digest_preimage_rlc_specified = & rows. last ( ) . unwrap ( ) . preimage_rlc ;
723723 let challenge_digest_rlc_specified = & rows. last ( ) . unwrap ( ) . digest_rlc ;
724+ let versioned_hash_rlc = & rows. get ( N_ROWS_DIGEST_RLC - 2 ) . unwrap ( ) . digest_rlc ;
724725
725726 // ensure that on the last row of this section the is_boundary is turned on
726727 // which would enable the keccak table lookup for challenge_digest
@@ -793,6 +794,7 @@ impl BlobDataConfig {
793794 . collect :: < Vec < _ > > ( ) ;
794795 for ( i, digest_rlc_specified) in std:: iter:: once ( metadata_digest_rlc_specified)
795796 . chain ( chunk_digest_evm_rlcs)
797+ . chain ( std:: iter:: once ( versioned_hash_rlc) )
796798 . chain ( std:: iter:: once ( challenge_digest_rlc_specified) )
797799 . enumerate ( )
798800 {
@@ -811,7 +813,7 @@ impl BlobDataConfig {
811813
812814 // compute the keccak input RLC:
813815 // we do this only for the metadata and chunks, not for the blob row itself.
814- if i < MAX_AGG_SNARKS + 1 {
816+ if i < MAX_AGG_SNARKS + 1 + 1 {
815817 let digest_keccak_rlc =
816818 rlc_config. rlc ( region, & digest_bytes, & r_keccak, & mut rlc_config_offset) ?;
817819 challenge_digest_preimage_keccak_rlc = rlc_config. mul_add (
@@ -853,16 +855,22 @@ impl BlobDataConfig {
853855 for chunk in chunk_data_digests_bytes. chunks_exact ( N_BYTES_U256 ) {
854856 chunk_data_digests. push ( chunk. to_vec ( ) ) ;
855857 }
858+ let challenge_digest = assigned_rows
859+ . iter ( )
860+ . rev ( )
861+ . take ( N_BYTES_U256 )
862+ . map ( |row| row. byte . clone ( ) )
863+ . collect :: < Vec < AssignedCell < Fr , Fr > > > ( ) ;
856864 let export = AssignedBlobDataExport {
857865 num_valid_chunks,
858866 versioned_hash : assigned_rows
859- . iter ( )
860- . rev ( )
861- . skip ( N_BYTES_U256 )
862- . take ( N_BYTES_U256 )
863- . map ( |row| row. byte . clone ( ) )
864- . rev ( )
865- . collect ( ) ,
867+ . iter ( )
868+ . rev ( )
869+ . skip ( N_BYTES_U256 )
870+ . take ( N_BYTES_U256 )
871+ . map ( |row| row. byte . clone ( ) )
872+ . rev ( )
873+ . collect ( ) ,
866874 chunk_data_digests,
867875 } ;
868876
@@ -881,19 +889,19 @@ impl BlobDataConfig {
881889
882890 let challenge_digest_limb1 = rlc_config. inner_product (
883891 region,
884- & export . challenge_digest [ 0 ..11 ] ,
892+ & challenge_digest[ 0 ..11 ] ,
885893 & pows_of_256,
886894 & mut rlc_config_offset,
887895 ) ?;
888896 let challenge_digest_limb2 = rlc_config. inner_product (
889897 region,
890- & export . challenge_digest [ 11 ..22 ] ,
898+ & challenge_digest[ 11 ..22 ] ,
891899 & pows_of_256,
892900 & mut rlc_config_offset,
893901 ) ?;
894902 let challenge_digest_limb3 = rlc_config. inner_product (
895903 region,
896- & export . challenge_digest [ 22 ..32 ] ,
904+ & challenge_digest[ 22 ..32 ] ,
897905 & pows_of_256[ 0 ..10 ] ,
898906 & mut rlc_config_offset,
899907 ) ?;
0 commit comments