AntelopeIO / eos-vm

Other
5 stars 8 forks source link

Synthetic - Teaching Item #8

Closed larryk85 closed 1 year ago

larryk85 commented 1 year ago

Compile EOS-VM into a small program of your creation,

The program should do the following:

larryk85 commented 1 year ago

You will also need to look to CDT's EOSIOLIB for how to expose the host functions so that you can call them. Hint, they look a lot like extern "C", an eerie amount like them.

ScottBailey commented 1 year ago

eos-vm

jolly-fellow commented 1 year ago

Does requirement "Total number of memory operations executed." means that all 25 memory instructions should be intercepted and counted?

Answer from @larryk85 : each type of the memory operation should be counted separately.

jolly-fellow commented 1 year ago

Update for the educational task from @larryk85:

For anyone who wants additional work for this.

One thing of note is that you can implement both static and dynamic analysis for this and have your tool produce both. I.e. one that counts the number of memory ops without running the wasm (i.e. static count) and one that is used via extending the interpret_visitor.

An additional task for you and others who want more would be to analyze the running WASM and output a listing of WASM pointers to material addresses (i.e. fully materialized on the native side), additional points if you can output the WASM line number information of those memory operations.

Review what "tail calls" are https://en.wikipedia.org/wiki/Tail_call. Analyze the WASM in the same way that you would write your analyze either statically or dynamically "find" the locations for sites where tail call optimizations would be available.