Skip to content

ResourceBoundsMapping internal repr #201

@tdelabro

Description

@tdelabro

ResourceBoundsMapping only contains two values for now, L1Gas and L2Gas.

First of all, why is it represented as a BTreeMap? It could just be a struct with two ResourceBounds fields. Is it to be future-proof? That's an unnecessary worry and it comes with performance cost.

Even if we keep it like this, could we at least implement some getters function on ResourceBoundsMapping:

fn l1_gas(&self) -> &ResourceBounds;
fn l2_gas(&self) -> &ResourceBounds;

It can also return an Option<ResourceBounds> if a tx without one or both values is deemed valid.

I would avoid having to write this

self.resource_bound.0.get(resource)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions