chore(lib/runtime/wasmer): refactor Exec and exec methods#2686
chore(lib/runtime/wasmer): refactor Exec and exec methods#2686qdm12 merged 9 commits intodevelopmentfrom
Exec and exec methods#2686Conversation
- Fix for bigger than max int32 pointer and data length
ce1e2f5 to
3be46af
Compare
3be46af to
23151bf
Compare
Codecov Report
@@ Coverage Diff @@
## development #2686 +/- ##
===============================================
+ Coverage 63.02% 63.04% +0.02%
===============================================
Files 211 211
Lines 27056 27043 -13
===============================================
- Hits 17052 17050 -2
+ Misses 8455 8450 -5
+ Partials 1549 1543 -6
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
|
Would error -> graceful shutdown be better than panicking? |
| } | ||
|
|
||
| // Store func | ||
| func (in *Instance) store(data []byte, location int32) { |
There was a problem hiding this comment.
why did we want to remove these functions?
There was a problem hiding this comment.
That was me trying to understand everything that was needed in that Exec method, and those tiny methods made it just hard to understand tbh.
And these 1 or 2-lines functions were only used once (in prod code, and once in a test), so I just inlined them.
So I took the EXECUTIVE DECISION to inline them pretty much 😄
jimjbrettj
left a comment
There was a problem hiding this comment.
looks good just few questions
Well in standard Go, panic should really be used only for programming errors. |
I am Quentin Mc Gaw, a software engineer working the Go Polkadot host **Gossamer**. I have been working full time on Gossamer since October 2021, mostly on the state trie and storage. I have also made a [few minor pull requests](https://github.com/w3f/polkadot-spec/pulls?q=is%3Apr+is%3Aclosed+author%3Aqdm12) to the Polkadot specification repository. I am requesting to join the Fellowship at rank 1. ## Main contributions ### Gossamer - Fix memory leaks - Trie encoding buffer pools usage fixed [#2009](ChainSafe/gossamer#2009) - Fix state map of tries memory leak [#2286](ChainSafe/gossamer#2286) - Fix sync benchmark [#2234](ChainSafe/gossamer#2234) - Trie proof fixes ([#2604](ChainSafe/gossamer#2604), [#2661](ChainSafe/gossamer#2661)) - Fix end to end tests orchestration ([#2470](ChainSafe/gossamer#2470), [#2452](ChainSafe/gossamer#2452), [#2385](ChainSafe/gossamer#2385), [#2370](ChainSafe/gossamer#2370)) - State trie statistics ([#2378](ChainSafe/gossamer#2378), [#2310](ChainSafe/gossamer#2310), [#2272](ChainSafe/gossamer#2272)) - State trie fixes and improvements - Only deep copy nodes when mutation is certain [#2352](ChainSafe/gossamer#2352) and [#2223](ChainSafe/gossamer#2223) - Only deep copy necessary fields of a node [#2384](ChainSafe/gossamer#2384) - Use Merkle values for database keys instead of always hash [#2725](ChainSafe/gossamer#2725) - Opportunistic parallel Merkle value commputing [#2081](ChainSafe/gossamer#2081) - Grandpa capped number of tracked messages ([#2490](ChainSafe/gossamer#2490), [#2485](ChainSafe/gossamer#2485)) - Add pprof HTTP service for profiling [#1991](ChainSafe/gossamer#1991) Ongoing work: - State trie lazy loading and caching - State trie v1 support ([#2736](ChainSafe/gossamer#2736), [#2747](ChainSafe/gossamer#2747), [#2687](ChainSafe/gossamer#2687), [#2686](ChainSafe/gossamer#2686), [#2685](ChainSafe/gossamer#2685), [#2673](ChainSafe/gossamer#2673), [#2611](ChainSafe/gossamer#2611), [#2530](ChainSafe/gossamer#2530)) ### Polkadot specification ➡️ [Pull requests from qdm12](https://github.com/w3f/polkadot-spec/pulls?q=is%3Apr+is%3Aclosed+author%3Aqdm12)
|
🎉 This PR is included in version 0.7.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Changes
Simple refactor to adapt
execto be more independent, in order to have an instance-independent check runtime function.Execinstead of both directly wrappingexecexec:malloc,clear,store,loadTests
Issues
#2418
Primary Reviewer
@EclesioMeloJunior