Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Maddiaa0 committed Jan 17, 2025
1 parent e1d65f3 commit 8d9bd97
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion scripts/run_native_testnet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ if $L1_CONSENSUS_HOST_URL; then
fi

# If an ethereum url has been provided, do not run the ethereum.sh script
if $ETHEREUM_HOST && $L1_CONSENSUS_HOST_URL; then
if [ -n "$ETHEREUM_HOST" ]; then
ETHEREUM_SCRIPT=""
else
ETHEREUM_SCRIPT="./ethereum.sh"
Expand Down
5 changes: 4 additions & 1 deletion yarn-project/blob-sink/src/client/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,19 @@ export class HttpBlobSinkClient implements BlobSinkClientInterface {
this.log.debug('Getting blob sidecar from blob sink');
const blobs = await this.getBlobSidecarFrom(this.config.blobSinkUrl, blockHash, indices);
if (blobs.length > 0) {
this.log.debug(`Got ${blobs.length} blobs from blob sink`);
return blobs;
}
}

if (this.config.l1ConsensusHostUrl) {
// The beacon api can query by slot number, so we get that first
this.log.debug('Getting slot number from consensus host');
const slotNumber = await this.getSlotNumber(blockHash);
if (slotNumber) {
const blobs = await this.getBlobSidecarFrom(this.config.l1ConsensusHostUrl, slotNumber, indices);
if (blobs.length > 0) {
this.log.debug(`Got ${blobs.length} blobs from consensus host`);
return blobs;
}
}
Expand All @@ -94,6 +97,7 @@ export class HttpBlobSinkClient implements BlobSinkClientInterface {
blockHashOrSlot: string | number,
indices?: number[],
): Promise<Blob[]> {
// TODO(md): right now we assume all blobs are ours, this will not yet work on sepolia
try {
let url = `${hostUrl}/eth/v1/beacon/blob_sidecars/${blockHashOrSlot}`;
if (indices && indices.length > 0) {
Expand All @@ -104,7 +108,6 @@ export class HttpBlobSinkClient implements BlobSinkClientInterface {

if (res.ok) {
const body = await res.json();
this.log.debug(`Blob sidecar for block ${blockHashOrSlot} is ${body}`);
const blobs = body.data.map((b: BlobJson) => Blob.fromJson(b));
return blobs;
}
Expand Down

0 comments on commit 8d9bd97

Please sign in to comment.