Skip to content

Account for published blobs in the resource at the end of transaction execution rather than upfront.#3995

Merged
deuszx merged 5 commits intomainfrom
charge-blob-publish-when-it-happens
May 23, 2025
Merged

Account for published blobs in the resource at the end of transaction execution rather than upfront.#3995
deuszx merged 5 commits intomainfrom
charge-blob-publish-when-it-happens

Conversation

@deuszx
Copy link
Contributor

@deuszx deuszx commented May 22, 2025

Motivation

We are charging for all published blobs before we execute any operation in the block. This is wrong b/c we want the incoming grant to be able to cover the fees. The grants are processed during operation processing only so they are not taken into account at the beginning of the block processing.

Proposal

Move the published blobs' resources tracking to the end of processing a transaction that published it. At this point any incoming grant is already processed. In order to do so, we track blob IDs referenced during transaction execution via TransactionTracker.published_blobs and consume it in BlockExecutionTracker::process_txn_outcome.

Also, charge for publishing user-created blobs only. BlobType::Committee is not accounted for.

Test Plan

CI.

Release Plan

  • Nothing to do / These changes follow the usual release cycle.

Links

@deuszx deuszx force-pushed the charge-blob-publish-when-it-happens branch 2 times, most recently from 8d5a306 to 8308dea Compare May 22, 2025 17:06
@deuszx deuszx marked this pull request as ready for review May 22, 2025 17:06
@deuszx deuszx requested a review from afck May 22, 2025 17:06
@deuszx deuszx force-pushed the charge-blob-publish-when-it-happens branch from 8308dea to dea2047 Compare May 22, 2025 17:07
@deuszx deuszx force-pushed the charge-blob-publish-when-it-happens branch from dea2047 to 19ed9e9 Compare May 22, 2025 17:08
@deuszx deuszx force-pushed the charge-blob-publish-when-it-happens branch from c9563c9 to 1fdebe0 Compare May 23, 2025 10:07
@deuszx deuszx requested review from afck and ma2bd May 23, 2025 10:33
Copy link
Contributor

@afck afck left a comment

Choose a reason for hiding this comment

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

No blockers from my side!

}

/// Returns whether the blob is a "user blob".
pub fn is_user_blob(&self) -> bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we should do the opposite, is_committee_blob? That's more specific… and I don't like using quotes in comments—that sounds like it's not the correct technical term.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@deuszx deuszx force-pushed the charge-blob-publish-when-it-happens branch from 671e4d1 to 6e43053 Compare May 23, 2025 12:03
@deuszx deuszx merged commit ebcf07c into main May 23, 2025
24 checks passed
@deuszx deuszx deleted the charge-blob-publish-when-it-happens branch May 23, 2025 12:33
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