Skip to content

Gas payment refactor#411

Merged
wilfreddenton merged 13 commits into
mainfrom
gas-payment-refactor
May 13, 2026
Merged

Gas payment refactor#411
wilfreddenton merged 13 commits into
mainfrom
gas-payment-refactor

Conversation

@wilfreddenton
Copy link
Copy Markdown
Contributor

@wilfreddenton wilfreddenton commented May 12, 2026

Note

High Risk
High risk because it refactors gas metering/payment accounting across execution, introduces a new sponsorship mode for BLS aggregates, and changes the DB schema/results API to track payers, all of which affect consensus-critical execution and billing.

Overview
Refactors gas handling so Publish/Call ops carry an explicit Payment (payer signer_id + gas_limit) derived from a signed PaymentIntent on each Inst, replacing the prior direct gas_limit field and removing runtime-global set_gas_limit usage.

Adds BLS-aggregate sponsorship: AggregateInfo now includes optional publisher_sponsorship (validated non-zero), and aggregate ops can declare PaymentIntent::Sponsored which resolves to publisher-paid gas via a per-bulk PublisherOffer; direct (non-aggregate) Sponsored intents are rejected.

Persists and exposes gas payer attribution by adding payer_signer_id to contract_results (schema + queries + TS bindings) and wiring runtime hold/release + result insertion to charge/release tokens against the resolved payer. Updates API/test/macro code paths to pass payment through Runtime::execute/publish, adds execute_api for core-paid native API wrappers, and introduces a new regtest e2e test verifying publisher-paid sponsored ops.

Reviewed by Cursor Bugbot for commit 39974ac. Bugbot is set up for automated code reviews on this repo. Configure here.

Comment thread core/testlib/src/lib.rs
Comment thread core/indexer/src/block.rs Outdated
Comment thread core/indexer/src/block.rs Outdated
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default mode and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 1117345. Configure here.

Comment thread core/indexer/src/block.rs
@wilfreddenton wilfreddenton merged commit 4512b40 into main May 13, 2026
7 checks passed
@wilfreddenton wilfreddenton deleted the gas-payment-refactor branch May 13, 2026 13:16
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.

1 participant