Comments (3)
How would state across multiple simulator calls be stored?
@dboehm-avalabs and I chatted about this a bit. You should be able to have a State
struct that implements all the interfaces (mutable, view, etc) that is simply instantiated with a few function pointers. Those function pointers can come from the Rust side of the simulator. I'm pretty sure you can even use a function pointer to a closure, though how to do so soundly is less clear.
In any case, you should essentially be able to inject the state-dependency on instantiation of the cgo wrapper around the runtime.
Does that make sense?
from hypersdk.
gRPC
Should note that shared types are defined in protobufs. You would still need to spin up the server via Rust, but that should almost be trivial.
from hypersdk.
@dboehm-avalabs and I chatted about this a bit. You should be able to have a
State
struct that implements all the interfaces (mutable, view, etc) that is simply instantiated with a few function pointers. Those function pointers can come from the Rust side of the simulator. I'm pretty sure you can even use a function pointer to a closure, though how to do so soundly is less clear.
so essentially you pass in the struct with method pointers through FFI, and then in go you reconstruct that interface by referencing those function pointers.
from hypersdk.
Related Issues (20)
- Write TokenVM parametrized tests
- Refactor Controller + Rule handling behavior
- Remove HRP HOT 1
- The simulator readonly endpoint should not allow changing state
- [x/programs] Public functions that don't mutate state should take a borrowed `Context` as the first argument
- Decompose VM Controller HOT 2
- [x/programs] Create `pairs!` macro that converts tuples of key-value pairs
- Avoid disk re-read on restoring of accepted blocks processing HOT 1
- Simulator Refactor Part 2
- [x/programs] Simulator deploy programs
- The build script should fail if the simulator fails to build HOT 2
- Optimize space of unit variant state keys
- Generalize Transaction Interface + Execution Pipeline
- Bindings should copy the parameter names
- Pass all gas parameter in `ExternalCallContext` HOT 1
- Create test package with test helpers HOT 1
- Generate random address HOT 2
- Remove usage of gomock
- [Discussion] Securely decode transaction binaries in the wallet UI HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hypersdk.