Repository navigation
Remove Context-Free Actions - #754
Conversation
A transaction may not carry context-free actions, which leaves it no context-free data either, and `check_transaction_authorization` rejects such a transaction too. The `context_free_actions` and `context_free_data` fields stay in the transaction format, so signing digests and transaction ids are unchanged. Contracts can no longer send context-free inline actions or read context-free data: the `send_context_free_inline` and `get_context_free_data` intrinsics are removed, with the context-free execution path and the preconditions that told context-free and context-aware intrinsics apart. Action traces lose `context_free`, in the trace API and in SHiP. The OC code cache header and codegen version move to 2, because the intrinsic table changed. `chain_config` drops `context_free_discount_net_usage_num` and `context_free_discount_net_usage_den`, and the ids above them shift down by two. That changes the genesis and so the chain id, the SHiP `chain_config`, and `sysio.system`'s `setparams`. Every system and test contract is rebuilt with the matching wire-cdt. The deep-mind log, the snapshot compatibility files, the consensus blockchain data and the sys-util snapshot info expectations are regenerated. Change-Id: Ibc528e4dd4249ba21f0ddcee863f643d7811497d
|
[P2] Preserve the nonce when custom actions are rebuilt In With the default Preserve or reappend the nonce after rebuilding the custom actions, and add coverage using Validated at head |
trx_generator rebuilds a transaction's actions on every re-sign, which dropped the sysio.noop nonce action, so the first re-sign threw. It now appends a new nonce action after the rebuilt actions. The base generator still gives its nonce action new data in place. Change-Id: Ic18646b3173f858e1b604b584a96181dc33f6e54
|
Fixed in 4937bab. |
huangminghuang
left a comment
There was a problem hiding this comment.
Re-reviewed head 4937bab and the complete PR diff. The previously reported nonce regression is fixed: custom action generation appends a new nonce after rebuilding actions, while the base generator refreshes its existing nonce. No remaining actionable code findings.
Validation: compiled the updated transaction generator and its tests against available prebuilt dependencies. All four focused nonce tests pass: noop_nonce_action_is_optional, noop_nonce_on_custom_actions, noop_nonce_off_requires_acct_per_trx, and noop_nonce_off_substitutes_nested_placeholders. The new regression test exercises two re-signs without losing or accumulating nonce actions.
Full node build and test suite were not run locally. Current-head Linux and macOS workflows report failure before any build/test job is listed, so full CI validation remains outstanding.
Draft, for discussion. Wire charges NET for every byte of a transaction and never prunes context-free data, so a context-free action has nothing to offer over a regular one. This removes the feature and keeps only the transaction fields.
check_transaction_authorizationrejects such a transaction the same way. Thecontext_free_actionsandcontext_free_datafields stay, so signing digests, transaction ids and every client serializer are unchanged.send_context_free_inlineandget_context_free_dataare removed from the host, the genesis intrinsic list, the OC intrinsic table, the signature registry and the native-module exports. The context-free precondition and its context-aware counterpart go too, so every intrinsic registers through the same two macros. The OC code cache header (SYSVMOC2) and codegen version (2) move, because the intrinsic ordinals changed.apply_contextandtransaction_contextlose the context-free flag, the context-free inline queue and the context-free billing branch.action_tracelosescontext_free, in the trace API, in SHiP'saction_trace_v0/v1and in deep mind.context_free_discount_net_usage_numand_denare removed fromchain_config, the genesis, SHiP andsysio.system'ssetparams. The ids above them shift down by two, as in thebase_per_transaction_net_usageremoval. The genesis changes, so the chain id does too.Tests that ran code in a context-free context are removed, or now use regular actions: the light-validation restart test, the state-history split-log test, the checktime nonce and trx_generator's nonce (now a regular
sysio.noop::nonceaction with no authorization). New tests cover the input rejection with and without data, authorizations, payers and large entries, and thecheck_transaction_authorizationrejection.The deep-mind log, the snapshot compatibility files, the consensus blockchain data and the sys-util snapshot info expectations are regenerated.
Pairs with Wire-Network/wire-cdt#130, which removes the API from CDT. Merge them together; wire-cdt needs a release before the next wire-sysio tag. When this lands, wire-libraries-ts drops
context_freefrom sdk-core'sTransactionTraceand regeneratesSysioContractTypes, and wire-tools-ts drops the two parameters from its genesis renderer anddocs/production-bootstrap.md.