feat(tip-1034): derive channel ids from open tx hash#3779
feat(tip-1034): derive channel ids from open tx hash#3779legion2002 wants to merge 14 commits intotanishk/tip-1034-implfrom
Conversation
Adds the native TIP-20 channel escrow precompile, wires T4 activation and payment-lane classification, and introduces the packed U96 storage primitive needed for the single-slot channel state. Amp-Thread-ID: https://ampcode.com/threads/T-019db9e6-a988-765a-ad31-301b7b72fc95
Adds the T5 hardfork, moves channel escrow deployment and precompile registration behind that fork, and makes payment-lane classification explicitly hardfork-aware across consensus, pool, and payload-building paths. Amp-Thread-ID: https://ampcode.com/threads/T-019db9e6-a988-765a-ad31-301b7b72fc95
Makes TIP-20 channel escrow stateless on close by including the opening transaction hash in channelId derivation and deleting terminal state instead of keeping a tombstone. Threads the top-level tx hash through the revm/precompile execution path, updates the TIP-1034 spec and reference Solidity artifacts, and adds regression coverage for reopen and tx-hash scoping behavior. Amp-Thread-ID: https://ampcode.com/threads/T-019ddf4c-e3f2-722f-b6a9-5b822be31d91
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a462b9d1b2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let open_tx_hash = self.storage.tx_hash().ok_or_else(|| { | ||
| crate::error::TempoPrecompileError::Fatal("current tx hash unavailable".into()) | ||
| })?; |
There was a problem hiding this comment.
Handle missing tx hash in channel open
open now hard-fails when StorageCtx::tx_hash() is unset, returning a fatal error. This breaks any execution path that runs TIP-20 escrow from a raw/simulated TxEnv without a recovered top-level hash (for example, transaction simulation flows that construct TempoTxEnv via default/raw conversion), so open cannot be dry-run or gas-estimated in those contexts. Because the error is fatal rather than a typed revert, clients cannot recover gracefully and wallets/services may fail to build channel-open transactions.
Useful? React with 👍 / 👎.
Stores the current top-level tx hash in TIP-20 channel escrow transient storage and seeds it from the handler, mirroring the existing tx.origin pattern used by account keychain. Removes the generic StorageCtx tx-hash thread-local path and updates escrow tests to seed the precompile-local context explicitly. Amp-Thread-ID: https://ampcode.com/threads/T-019ddf4c-e3f2-722f-b6a9-5b822be31d91
00f91cc to
30b5ee6
Compare
30b5ee6 to
1f4c838
Compare
Makes TIP-20 channel escrow stateless on close by including the opening transaction hash in channel ID derivation and deleting terminal state instead of keeping a tombstone.
This threads the top-level tx hash through revm and the precompile storage context, updates the TIP-1034 spec and Solidity reference artifacts, and adds regression coverage for channel reopen and tx-hash scoping behavior.
Verification: