Skip to content

doc(gas-keys): add gas key documentation#15075

Draft
darioush wants to merge 1 commit intonear:masterfrom
darioush:gaskeys-docs
Draft

doc(gas-keys): add gas key documentation#15075
darioush wants to merge 1 commit intonear:masterfrom
darioush:gaskeys-docs

Conversation

@darioush
Copy link
Contributor

@darioush darioush commented Feb 12, 2026

Update docs for gas keys.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Comment on lines +77 to +78
- [TransferToGasKey](/RuntimeSpec/Actions.md#transfertogaskeyaction) and [WithdrawFromGasKey](/RuntimeSpec/Actions.md#withdrawfromgaskeyaction) fees are not yet finalized (currently zero)
- [AddKey](/RuntimeSpec/Actions.md#addkeyaction) with `GasKeyFullAccess` or `GasKeyFunctionCall` permission: fees are not yet finalized (currently zero). Per-nonce fees will be charged based on the `num_nonces` value.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

needs updating after merge

- **Gas cost** = gas burned (send fees) + gas remaining (execution fees), converted to tokens at the current gas price. This is deducted from the **gas key balance**.
- **Deposit cost** = sum of all deposits in the transaction's actions (`Transfer.deposit`, `FunctionCall.deposit`, `TransferToGasKey.deposit`, etc.). This is deducted from the **account balance**.

Both checks are performed independently. If the gas key has sufficient balance but the account does not have enough for deposits, the transaction enters the `DepositFailed` state where gas is charged but actions are not executed.
Copy link
Contributor Author

@darioush darioush Feb 12, 2026

Choose a reason for hiding this comment

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

Suggested change
Both checks are performed independently. If the gas key has sufficient balance but the account does not have enough for deposits, the transaction enters the `DepositFailed` state where gas is charged but actions are not executed.
Both checks are performed independently. If the gas key has sufficient balance but the account does not have enough for deposits, the transaction enters the `DepositFailed` state where gas is charged but actions are not executed.
Generally, honest chunk producers will prevent this from occurring for ordinary use. This is added as a protection against malicious contract behavior intending to add transactions to chunks without paying gas.


#### DepositFailed verdict

If the gas key has sufficient balance for gas costs but the account lacks balance for deposits, the transaction enters the `DepositFailed` state: gas is charged from the gas key (and the nonce is incremented), but the transaction actions are not executed. This prevents free transaction attempts using gas keys.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
If the gas key has sufficient balance for gas costs but the account lacks balance for deposits, the transaction enters the `DepositFailed` state: gas is charged from the gas key (and the nonce is incremented), but the transaction actions are not executed. This prevents free transaction attempts using gas keys.
If the gas key has sufficient balance for gas costs but the account lacks balance for deposits, the transaction enters the `DepositFailed` state: gas is charged from the gas key (and the nonce is incremented), but the transaction actions are not executed. This prevents malicious contract behavior intending to add transactions to chunks without paying gas.

@codecov
Copy link

codecov bot commented Feb 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.92%. Comparing base (9b04f16) to head (72a347e).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #15075   +/-   ##
=======================================
  Coverage   68.91%   68.92%           
=======================================
  Files         921      921           
  Lines      204003   204023   +20     
  Branches   204003   204023   +20     
=======================================
+ Hits       140587   140616   +29     
+ Misses      57488    57480    -8     
+ Partials     5928     5927    -1     
Flag Coverage Δ
pytests-nightly 1.29% <ø> (-0.01%) ⬇️
unittests 68.55% <ø> (+<0.01%) ⬆️
unittests-nightly 68.46% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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