@@ -44,9 +44,9 @@ async function getBlockNumber(blockHash: string, chainName: string): Promise<num
4444 const api = await initialize ( CHAIN_TO_WS_ENDPOINT . get ( chainName . toLowerCase ( ) ) as string ) ;
4545 const rpc : any = api . rpc ;
4646 try {
47- const block = await rpc . chain . getBlock ( blockHash ) ;
47+ const header = await rpc . chain . getHeader ( blockHash ) ;
4848 await disconnect ( ) ;
49- return block . block . header . number . toNumber ( ) ;
49+ return header . number . toNumber ( ) ;
5050 } catch ( error ) {
5151 console . log ( error ) ;
5252 }
@@ -370,6 +370,8 @@ export async function GET(req: NextRequest) {
370370 error : 'Getting the block range covered by the VectorX contract failed!'
371371 } ) ;
372372 }
373+
374+ console . log ( 'Block range: ' + blockRange . start + ' - ' + blockRange . end ) ;
373375
374376 if ( requestedBlock < blockRange . start || requestedBlock > blockRange . end ) {
375377 return NextResponse . json ( {
@@ -387,6 +389,9 @@ export async function GET(req: NextRequest) {
387389
388390 let [ requestedBlockHash , dataCommitmentRange ] = await Promise . all ( promises ) ;
389391
392+ console . log ( 'Requested block hash: ' + requestedBlockHash ) ;
393+ console . log ( 'Data commitment range: ' + dataCommitmentRange ) ;
394+
390395 if ( dataCommitmentRange === null ) {
391396 return NextResponse . json ( {
392397 success : false ,
@@ -404,6 +409,8 @@ export async function GET(req: NextRequest) {
404409 chainName !
405410 ) ;
406411
412+ console . log ( 'Got data roots: ' + dataRoots . length ) ;
413+
407414 // Extend the header array to commitmentTreeSize (fill with empty bytes).
408415 if ( dataRoots . length < commitmentTreeSize ) {
409416 const additionalRoots = new Array ( commitmentTreeSize - dataRoots . length ) . fill ( new Uint8Array ( 32 ) ) ;
0 commit comments