Skip to content

Conversation

mablr
Copy link
Contributor

@mablr mablr commented Sep 25, 2025

Motivation

towards #11797

Solution

  • Added anvil_getBlobSidecarsByBlockId endpoint
  • Added primitive Engine REST API

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool, need to think about the regular http GET routes support a bit,

can we limit this pr to just the extra anvil endpoint that returns BlobTransactionSidecar (all blobs in a block)

and think about adding support for GET requests and the beacon route in a followup pr?

Comment on lines 9 to 13
pub fn beacon_router<Beacon: BeaconApiHandler>(beacon: Beacon) -> Router {
Router::new()
.route("/v1/beacon/blob_sidecars/{block_id}", get(get_blob_sidecars_by_block_id::<Beacon>))
.with_state(beacon)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah wait, we do need this because this is a regular get request -.-

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yess it was actually less trivial than I expected 😅

@mablr
Copy link
Contributor Author

mablr commented Sep 25, 2025

no problem i'll split this PR 👌 (...tomorrow morning)

pub fn get_blob_sidecars_by_block_id(
&self,
block_id: BlockId,
) -> Result<Option<Vec<BlobTransactionSidecar>>> {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We return a Vec<BlobTransactionSidecar>, is this what we want? or would it be better to flatten this into a single BlobTransactionSidecar ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's do just BlobTransactionSidecar which is usually the format required

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a basic fold will do the job as we don't have FromIterator impl for BlobTransactionSidecar (could be a follow up in alloy btw)

@mablr mablr marked this pull request as ready for review September 26, 2025 09:50
@mablr mablr changed the title feat(beacon): add support for anvil_getBlobSidecarsByBlockId feat(anvil): add support for anvil_getBlobSidecarsByBlockId Sep 26, 2025
Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

smol nit re response format

once merged we can start with the regular get endpoints

pub fn get_blob_sidecars_by_block_id(
&self,
block_id: BlockId,
) -> Result<Option<Vec<BlobTransactionSidecar>>> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's do just BlobTransactionSidecar which is usually the format required

@mablr mablr requested a review from mattsse September 26, 2025 21:13
Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, pretty cool

@mattsse mattsse merged commit d27e522 into foundry-rs:master Sep 26, 2025
16 checks passed
@github-project-automation github-project-automation bot moved this to Done in Foundry Sep 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants