Skip to content

Fix gas estimation for roflmarket.InstanceTopUp#673

Merged
ptrus merged 1 commit into
masterfrom
ptrus/feature/gas-estimate-instancetopup
Jan 9, 2026
Merged

Fix gas estimation for roflmarket.InstanceTopUp#673
ptrus merged 1 commit into
masterfrom
ptrus/feature/gas-estimate-instancetopup

Conversation

@ptrus
Copy link
Copy Markdown
Member

@ptrus ptrus commented Jan 9, 2026

Fixes #611

The runtime's gas estimation for roflmarket.InstanceTopUp underestimates the required gas because the handler returns early in simulation mode: https://github.com/oasisprotocol/oasis-sdk/blob/18fa39523a241cb15476b0184bc2e49a871b10e7/runtime-sdk/modules/rofl-market/src/lib.rs#L454-L456
skipping storage operations like instance updates and payment transfers. The standard 20% buffer wasn't sufficient to always cover this gap. This adds a higher gas buffer (50%) specifically for this method.

This was the simplest fix.

Possible alternative:

  • Oasis-sdk: add explicit storage gas charge in the early exit path: would require runtime changes.

@netlify
Copy link
Copy Markdown

netlify Bot commented Jan 9, 2026

Deploy Preview for oasisprotocol-cli canceled.

Name Link
🔨 Latest commit 91aa647
🔍 Latest deploy log https://app.netlify.com/projects/oasisprotocol-cli/deploys/6960d8615263b70008c00a95

@ptrus ptrus requested a review from kostko January 9, 2026 09:27
Comment thread cmd/common/transaction.go Outdated
@ptrus ptrus force-pushed the ptrus/feature/gas-estimate-instancetopup branch from d437c83 to 79d37d6 Compare January 9, 2026 10:28
@ptrus ptrus force-pushed the ptrus/feature/gas-estimate-instancetopup branch from 79d37d6 to 91aa647 Compare January 9, 2026 10:28
@ptrus ptrus enabled auto-merge January 9, 2026 10:29
@ptrus ptrus merged commit e9a6062 into master Jan 9, 2026
5 checks passed
@ptrus ptrus deleted the ptrus/feature/gas-estimate-instancetopup branch January 9, 2026 10:31
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.

rofl machine top-up fails with out of gas error

3 participants