Skip to content

Conversation

@ss-es
Copy link
Contributor

@ss-es ss-es commented Jan 9, 2026

No description provided.

@@ -0,0 +1,3 @@
[route.total_minted_supply]
PATH = ["total_minted_supply"]
DOC = "Get the total supply of the espresso token, counting only tokens that have been minted. Notably, this does not include unminted tokens from (for example) unclaimed rewards, or other sources."
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add a comment about the caching to make it clear that this doesn't always reflect the exact on-chain value immediately?

Copy link
Collaborator

Choose a reason for hiding this comment

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

And mention it's in token units with an example like "123.123"?

impl<N: ConnectedNetwork<PubKey>, V: Versions, P: SequencerPersistence> TokenDataSource<SeqTypes>
for ApiState<N, P, V>
{
async fn get_total_supply(&self) -> anyhow::Result<U256> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think the naming could be a bit more descriptive to make it clearer that this is the total supply on L1 and distinguish it from the total supply in Espresso. For example by adding an "l1" suffix.

Copy link
Collaborator

@sveitser sveitser left a comment

Choose a reason for hiding this comment

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

Code LGTM but there are no tests.

There are a bunch of requirements we should test.

  1. Returns the correct values
  2. Caching / does not always call the provider.

If we don't add a test for caching at least a comment as to why we're caching would be nice.

@@ -0,0 +1,3 @@
[route.total_minted_supply]
PATH = ["total_minted_supply"]
DOC = "Get the total supply of the espresso token, counting only tokens that have been minted. Notably, this does not include unminted tokens from (for example) unclaimed rewards, or other sources."
Copy link
Collaborator

@sveitser sveitser Jan 13, 2026

Choose a reason for hiding this comment

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

Suggested change
DOC = "Get the total supply of the espresso token, counting only tokens that have been minted. Notably, this does not include unminted tokens from (for example) unclaimed rewards, or other sources."
DOC = "Get the total supply of the espresso token, counting only tokens that have been minted on Ethereum. Notably, this does not include unminted tokens from (for example) unclaimed rewards, or other sources."

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.

3 participants