warp: [BUG] Different state result from readState when using JS and Node
Describe the bug Seeing an older state when reading contract from node.
To Reproduce I’ve seen this with several simple contracts (no internal writes). Here’s one on testnet: “t5VFXv-YC4c4U5JhAk6kChQE8XArkj44DIbOh1kCvj8”
Expected behavior
JS Validaties:
"validity": { "IC46XQwIu19jFhsKCsE_q5XUNAnUykCYpbp64Hp6Ueg": false, "rY5HBPNHn2qNEEjT7JTxgCI3RBqEKcicfhXSdzBgs3I": false, "Hg6oXHAJW-0KOArbX4JF2hYr4YC_avAeefEn5W-K5Hs": true, "kWsOfSN4pMBZ1e_dpSSdLI1OYJO7cdlIXPcWb6VzG9I": false, "VtypEh3UsoL0or6oMLs1ZpKJ6HlRxe5wuv4h3rcQZCw": false, "IB_es-lWOM11tdmC8Gk8v9Chh2oqm06PDdtM9SCiJtE": true, "KCLd60lBNScu7W0HdW6cWcTEHRyCHQ3mZGlk87eumm0": true, "kfhpWWU76-RAHOr_ClQFlsVkjxgNiQekKiv7aMwjExQ": true, "ii05XHdVV25PLA2Ab2tDyHE_rTrq1U7Vbq5Bx6Nowt0": true, "_unSjG217YkD92Ca-2plZc758lujjxbdfZ6VFT9lY4w": true, "6npCpEpMg2rde8LdW0zvCxZ5OU6JwyZIolu3Jsr1iKA": true, "lck4dFEV2WMu1z-fNb24McuNuSkN4Wxqzm9c0QjQQSg": true, "IZgRXnlSMnM4lH7NNDF8feJi5-Jl_-BW-EJ4a6o7hiQ": true, "iUuSZ8lV2eQFj_lNNxmW09sUMJKATF61BnSd_0y5hSc": true, "fdr72neBLxgx_9rOEFbgvOHA5u_MXWrZQzEHGZeVOWw": true, "IWVGvXgVhp6dtMCnUfGHYrV-V3R5-b26FlbWrr6nUeo": true, "luFHk0av3roDbMu6Ub7jc3tl43KXkaIeBWE2u2GhNLE": true },
NODE Validities:
"validity": { "IC46XQwIu19jFhsKCsE_q5XUNAnUykCYpbp64Hp6Ueg": false, "rY5HBPNHn2qNEEjT7JTxgCI3RBqEKcicfhXSdzBgs3I": false, "Hg6oXHAJW-0KOArbX4JF2hYr4YC_avAeefEn5W-K5Hs": true, "kWsOfSN4pMBZ1e_dpSSdLI1OYJO7cdlIXPcWb6VzG9I": false, "VtypEh3UsoL0or6oMLs1ZpKJ6HlRxe5wuv4h3rcQZCw": false, "IB_es-lWOM11tdmC8Gk8v9Chh2oqm06PDdtM9SCiJtE": true, "KCLd60lBNScu7W0HdW6cWcTEHRyCHQ3mZGlk87eumm0": true, "kfhpWWU76-RAHOr_ClQFlsVkjxgNiQekKiv7aMwjExQ": true, "ii05XHdVV25PLA2Ab2tDyHE_rTrq1U7Vbq5Bx6Nowt0": true, "_unSjG217YkD92Ca-2plZc758lujjxbdfZ6VFT9lY4w": true, "6npCpEpMg2rde8LdW0zvCxZ5OU6JwyZIolu3Jsr1iKA": true, "lck4dFEV2WMu1z-fNb24McuNuSkN4Wxqzm9c0QjQQSg": true, "fdr72neBLxgx_9rOEFbgvOHA5u_MXWrZQzEHGZeVOWw": true, "IWVGvXgVhp6dtMCnUfGHYrV-V3R5-b26FlbWrr6nUeo": true, "luFHk0av3roDbMu6Ub7jc3tl43KXkaIeBWE2u2GhNLE": true },
As you can see the NODE version is missing 2 interactions.
Desktop (please complete the following information):
- OS: Mac
- Node.js version - 18.16.0
- warp-contracts SDK version - 1.4.17
- warp-contracts plugins being used (+ versions)
- Browser [e.g. chrome, safari] - Same result using Brave and Firefox on the JS side.
Additional Info
Tried various evaluation options. This is what I use on the js side. I’ve tried just the defaults in Node and these as well.
const contract = warp.contract(contractId).setEvaluationOptions({ allowBigInt: true, internalWrites: true, unsafeClient: "skip" });
About this issue
- Original URL
- State: closed
- Created 10 months ago
- Comments: 62 (29 by maintainers)
The srcTxIds are saved here on Github. Note that all the ones that you need are listed together in the first section (array).
I’ve finally been able to figure out what’s going on and have replicated the issue in an MRE. Please see the updated example. The README should have all the information you need. Let me know if you have any questions.
we’re reviewing (and rewriting…) some internals of how the IW are functionining…please give us some time. In the meantime:
Answering your question - the ‘blockchain’ (ie. Arweave) stores only transactions. There’s probably some issue with evaluating them with differnt versions of the SDK / cache options for your contracts/dapp.
As I’ve said - we’re in the process of writing some of the internal parts of the SDK responsible for the internal contracts calls.
Thanks!
Reading your previous message makes me concerned about the architecture here. Basically, these contracts are passing assets back and forth. So, they will be a lot interactions, and this is only a SMALL example. We might have to rethink the architecture if this proves to be too complex. If that’s the case, that concerns me about using this as a transaction system.