Skip to content

Proxy Module Refactor#141

Merged
0xForerunner merged 14 commits intoflashbots:mainfrom
worldcoin:forerunner/proxy
Mar 28, 2025
Merged

Proxy Module Refactor#141
0xForerunner merged 14 commits intoflashbots:mainfrom
worldcoin:forerunner/proxy

Conversation

@0xForerunner
Copy link
Collaborator

This PR is dependent on #135

You can use this diff to compare directly with that PR

Changes:

  • reorganize client module layout
  • Unify Http/Rpc client layers and authentication
  • Cleanup some tracing/error handling related things
  • Pull out Health Layer for better modularity. Working on another PR for better probe functionality
  • Refactor the rest of the metrics to be auto generated from spans

@vercel
Copy link

vercel bot commented Mar 18, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
rollup-boost ⬜️ Ignored (Inspect) Visit Preview Mar 25, 2025 3:35pm

@0xForerunner 0xForerunner mentioned this pull request Mar 19, 2025

let res = serde_json::from_slice::<RpcResponse>(body_bytes)?;
if let Some(e) = res.error {
bail!("code: {}", e.code);
Copy link
Collaborator

Choose a reason for hiding this comment

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

it'll be helpful to return the error instead and have the calling function log the error, and metrics instrument the error code

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm a little confused. What you're describing is exactly what's happening haha. bail! is just short for return eyre::eyre!("my error"). It's not logging anything.

Copy link
Collaborator

Choose a reason for hiding this comment

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

oh I meant returning the error instead of the error code!


if let Err(e) = parse_response_code(&body_bytes) {
error!(
error = %e,
Copy link
Collaborator

Choose a reason for hiding this comment

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

how does the tracing processor record the error code here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm currently not recording the response code! I'll update this to include the code!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Just addressed this in most recent commit!

let res = self.client.ready().await?.call(req).await?;

let (parts, body) = res.into_parts();
let body_bytes = body.collect().await?.to_bytes().to_vec();
Copy link
Collaborator

Choose a reason for hiding this comment

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

have you tested this against the optimism package? does this handle gzip responses?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes we've run it in the optimism kurtosis devnet and everything seems to work great!

@0xForerunner
Copy link
Collaborator Author

@avalonche I believe all your comments have been address and should be ready for your final OK. TY!

@0xForerunner 0xForerunner merged commit 969b3a2 into flashbots:main Mar 28, 2025
5 checks passed
@0xForerunner 0xForerunner deleted the forerunner/proxy branch March 28, 2025 15:13
theochap pushed a commit to ethereum-optimism/optimism that referenced this pull request Feb 11, 2026
* fix for cloned service

* cleanup process_response

* eyre bail

* remove unnecessary deps

* Update src/client/http.rs

Co-authored-by: shana <avalonche@protonmail.com>

* parse response code

* clippy fix

---------

Co-authored-by: shana <avalonche@protonmail.com>
theochap pushed a commit to ethereum-optimism/optimism that referenced this pull request Feb 13, 2026
* fix for cloned service

* cleanup process_response

* eyre bail

* remove unnecessary deps

* Update src/client/http.rs

Co-authored-by: shana <avalonche@protonmail.com>

* parse response code

* clippy fix

---------

Co-authored-by: shana <avalonche@protonmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants