filecoin-project / oni

👹 (DEPRECATED; see README) Project Oni | Network Validation
https://docs.google.com/document/d/16jYL--EWYpJhxT9bakYq7ZBGLQ9SB940Wd1lTDOAbNE
7 stars 5 forks source link

unified `tvx` tool; end-to-end MVP for extracting+running msg-class vectors #177

Closed raulk closed 4 years ago

raulk commented 4 years ago

tvx is the test vector management tool. This PR contains a bunch of refactor, and it's an MVP of and end to end message-class vector extraction, and running through lotus.

Example extracting a message from calibration net:

$ ./tvx extract-message --api=TOKEN:/ip4/127.0.0.1/tcp/1234 --cid=bafy2bzacebkvtxozbfybzokygoeyjkdeiqxlfrkqornfuvraaxnbijrxjdlzc --file vector2.json
2020/08/04 18:56:14 calculating accessed actors during execution of message: bafy2bzacebkvtxozbfybzokygoeyjkdeiqxlfrkqornfuvraaxnbijrxjdlzc
accessed actors:
     t023889
     t3wnrdur7ncpqusak336jwzh3aiu75k5ja6fkmxz55olwijz5ztifwrtbkflae3mh3bq2vmt4cuobfjeslvksq
     t05
     t04
     t02
getting the _before_ filtered state tree
2020/08/04 18:56:18 loading the init actor for tipset: {bafy2bzacedfmwfnjboyfnxjeojtu6cf46pldrv3fy4ujqkhxfvixrtgeteplc,bafy2bzacec2qwk5m4ifd62rj7h4lmnmov3byznzh273hmmp6eu5zkzqlwvesa}
2020/08/04 18:56:18 loaded init actor state: &{AddressMap:bafy2bzaceacgm4vgco2nk77rrftw5fbtkf7vkl6p7qnfzijaixjrd2jq3tp5s NextID:28866 NetworkName:calibrationnet}
2020/08/04 18:56:18 resolving addresses: [t023889 t3wnrdur7ncpqusak336jwzh3aiu75k5ja6fkmxz55olwijz5ztifwrtbkflae3mh3bq2vmt4cuobfjeslvksq t05 t04 t02]
2020/08/04 18:56:18 resolved addresses: [t023889 t023266 t05 t04 t02]
2020/08/04 18:56:18 retaining init actor entries for addresses: [t023889 t3wnrdur7ncpqusak336jwzh3aiu75k5ja6fkmxz55olwijz5ztifwrtbkflae3mh3bq2vmt4cuobfjeslvksq t05 t04 t02]
2020/08/04 18:56:18 new init actor state: &{AddressMap:bafy2bzaceck6ghusiemp344swgcs3todgy52ba2kzsovijygyd35qehzduouo NextID:28866 NetworkName:calibrationnet}
2020/08/04 18:56:18 saving init actor into state tree
2020/08/04 18:56:18 saved init actor into state tree; new root: bafy2bzacebv2ybvzb4nfphsc3dxtiqgfrx4wjj4qond4ycil7xuhwojhtzvj6
execution sanity check
from actor found:  &{bafkqadlgnfwc6mjpmfrwg33vnz2a bafy2bzaceakk5jp6lgrtkqtppr34go3jlgsy5ufgdrggp5fxpa7sym35zfzsq 118 7032480240948148576112}
creating vm
applying message
applied message: &{MessageReceipt:{ExitCode:Ok(0) Return:[] GasUsed:140816980} ActorErr:<nil> Penalty:+0 ExecutionTrace:{Msg:0xc0001424d0 MsgRct:0xc000bc31d0 Error: Duration:785.678µs GasCharges:[0xc0001e45a0 0xc0001e4630 0xc0001e46c0 0xc0001e47e0 0xc0001e4900 0xc0001e4990 0xc0001e4a20 0xc0001e4ab0 0xc0001e4b40 0xc0001e4bd0 0xc0001e54d0 0xc0001e5dd0 0xc0001e5e60] Subcalls:[{Msg:0xc000999420 MsgRct:0xc000bc2ba0 Error: Duration:445.156µs GasCharges:[0xc0001e4d80 0xc0001e4e10 0xc0001e4ea0 0xc0001e4fc0 0xc0001e5050 0xc0001e50e0 0xc0001e5170 0xc0001e5200 0xc0001e5290 0xc0001e5320 0xc0001e53b0 0xc0001e5440] Subcalls:[]} {Msg:0xc000999500 MsgRct:0xc000bc3170 Error: Duration:92.607µs GasCharges:[0xc0001e5560 0xc0001e55f0 0xc0001e5680 0xc0001e57a0 0xc0001e5830 0xc0001e58c0 0xc0001e5950 0xc0001e59e0 0xc0001e5a70 0xc0001e5b00 0xc0001e5b90 0xc0001e5c20 0xc0001e5cb0 0xc0001e5d40] Subcalls:[]}]} Duration:791.714µs}
flushing
$ ./tvx exec-lotus --file vector2.json

Merges #167 and #162.

raulk commented 4 years ago

Still lots of rough edges, but I'd rather merge into master and continue iterating there.

raulk commented 4 years ago

BTW -- the test vector from the example (hex encoded, no deduplication, no gzip) is 27mb.

raulk commented 4 years ago

@willscott I committed/pushed these files; they were being ignored by an old (and I believe, irrelevant now) .gitignore directive.

raulk commented 4 years ago

@willscott I merged examine/tvx here, adapted it to fit some local changes, and also removed some unnecessary IPLD fiddling that seemed to replicate what a default CBOR store does for us anyway.

raulk commented 4 years ago

@willscott since I've rectified the reason why you switched your status from approval to "request changes", I'm going to go ahead and merge this.

nonsense commented 4 years ago

This LGTM overall, but I haven't ran it manually just yet.