-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add ratelimiting to OpWitness API #12998
feat: Add ratelimiting to OpWitness API #12998
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these are unrelated, please undo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just the pending_block.rs
or also block.rs
and transactions.rs
?
crates/optimism/rpc/src/witness.rs
Outdated
let builder = OpPayloadBuilder::new(evm_config); | ||
let inner = OpDebugWitnessApiInner { provider, builder }; | ||
let inner = OpDebugWitnessApiInner { provider, builder, task_spawner }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good start, we also want to add a new tokio Semaphor for ratelimiting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what would be the number of permits?
and I'm not sure if this is the correct place and way to use it :(
impl<Provider, EvmConfig> OpDebugWitnessApi<Provider, EvmConfig> {
/// Creates a new instance of the `OpDebugWitnessApi`.
pub fn new(
provider: Provider,
evm_config: EvmConfig,
task_spawner: Box<dyn TaskSpawner>,
) -> Self {
let builder = OpPayloadBuilder::new(evm_config);
let semaphore = Arc::new(Semaphore::new(3));
let inner = OpDebugWitnessApiInner { provider, builder, task_spawner, semaphore };
Self { inner: Arc::new(inner) }
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3 seems fine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm,
only did the last few remaining touchups
should close #12871