Skip to content
This repository was archived by the owner on Jan 12, 2026. It is now read-only.

feat: TIPS Metering RPC #22

Merged
danyalprout merged 2 commits into
base:mainfrom
danyalprout:tips-rpc
Nov 24, 2025
Merged

feat: TIPS Metering RPC #22
danyalprout merged 2 commits into
base:mainfrom
danyalprout:tips-rpc

Conversation

@danyalprout

@danyalprout danyalprout commented Nov 10, 2025

Copy link
Copy Markdown
Collaborator

📝 Summary

RPC's to send metering information to op-rbuilder. To make sure this never blocks the build loop, I did a handful of comparisons between different datastructures/locks:

Approach Avg Time Max Read Time ns Max Read Time ms
Dual Map & Periodic Swap** 239ns 70292ns 0.07 ms
Dashmap ✅ 669ns 93709ns 0.094 ms
HashMap (rwlock) 647ns 1433us 1.43ms
HashMap (mutex) 673ns 1441625ns 1.44ms

** This was a custom implementation and while the fastest, I felt like the additional code wasn't worth it over using a DashMap it also has the downside of not being a live view on the data (whereas dashmap is)

💡 Motivation and Context


✅ I have completed the following steps:

  • Run make lint
  • Run make test
  • Added tests (if applicable)

Comment thread crates/op-rbuilder/src/resource_metering.rs Outdated
@danyalprout
danyalprout marked this pull request as ready for review November 12, 2025 19:41
@danyalprout
danyalprout changed the base branch from release_upstream to main November 20, 2025 15:26
@danyalprout
danyalprout changed the base branch from main to release_upstream November 20, 2025 15:38
@danyalprout
danyalprout changed the base branch from release_upstream to main November 20, 2025 15:47

impl ResourceMetering {
pub(crate) fn insert(&self, tx: TxHash, metering_info: MeterBundleResponse) {
let to_remove = if self.data.lru.is_full() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

nit: do we need to add a metric or log when it's full

@danyalprout
danyalprout merged commit c49949f into base:main Nov 24, 2025
5 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants