Skip to content

Commit

Permalink
fix: enncoding
Browse files Browse the repository at this point in the history
  • Loading branch information
Maddiaa0 committed Jan 17, 2025
1 parent e896fb1 commit 203b2e7
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion yarn-project/archiver/src/archiver/data_retrieval.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ async function getBlockFromRollupTx(
throw new NoBlobBodiesFoundError(Number(l2BlockNum));
}

const blockFields = blobBodies.flatMap(b => b.toFields());
const blockFields = blobBodies.flatMap(b => b.toEncodedFields());

const header = BlockHeader.fromBuffer(Buffer.from(hexToBytes(decodedArgs.header)));
// TODO(#9101): Retreiving the block body from calldata is a temporary soln before we have
Expand Down
10 changes: 10 additions & 0 deletions yarn-project/aztec/src/cli/aztec_start_options.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { type ArchiverConfig, archiverConfigMappings } from '@aztec/archiver/config';
import { faucetConfigMapping } from '@aztec/aztec-faucet/config';
import { sequencerClientConfigMappings } from '@aztec/aztec-node/config';
import { blobSinkConfigMapping } from '@aztec/blob-sink/client';
import { botConfigMappings } from '@aztec/bot/config';
import {
type ConfigMapping,
Expand Down Expand Up @@ -257,6 +258,15 @@ export const aztecStartOptions: { [key: string]: AztecStartOption[] } = {
},
...getOptions('sequencer', sequencerClientConfigMappings),
],
BLOB_SINK: [
{
flag: '--blob-sink',
description: 'Starts Aztec Blob Sink with options',
defaultValue: undefined,
envVar: undefined,
},
...getOptions('blobSink', blobSinkConfigMapping),
],
'PROVER NODE': [
{
flag: '--prover-node',
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/foundation/src/blob/encoding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export function deserializeEncodedBlobFields(blob: BlobBuffer): Fr[] {
const currentField = fieldReader.peekField();

// Stop when we hit a zero field
if (currentField.isZero()) {
if (!currentField || currentField.isZero()) {
break;
}

Expand Down
2 changes: 1 addition & 1 deletion yarn-project/foundation/src/serialize/field_reader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,6 @@ export class FieldReader {
* @returns A bool.
*/
public isFinished(): boolean {
return this.index === this.length;
return this.index >= this.length;
}
}

0 comments on commit 203b2e7

Please sign in to comment.