-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add flush_all_blocks option to also write intermediate blocks #2101
base: steb/update-rust
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2101 +/- ##
==========================================
- Coverage 75.96% 74.50% -1.46%
==========================================
Files 154 153 -1
Lines 15771 15170 -601
==========================================
- Hits 11980 11302 -678
- Misses 3791 3868 +77
|
* Plumb through dump_cache from fvm4 to access intermediate blocks: - filecoin-project/filecoin-ffi#512 - filecoin-project/ref-fvm#2101 * Enable cache dumping in StateReplay with LOTUS_REPLAY_DUMP_CACHED_BLOCKS * Add optional "Blocks" field InvocResult * Handle ExecutionEvent::Log's and add "Logs" field to ExecutionTrace * Dump intermediate cache blocks to CAR in /tmp when they appear while using `lotus-shed msg --exec-trace`.
This seems like a reasonable approach but I'm not super happy adding this to the Executor/Machine traits. What about adding a "flush intermediate blocks to" option to either:
This will also impact how it's integrated is writing these intermediate blocks to the real blockstore going to be an issue? IMO, probably not for debugging but definitely if we want to use it when tracing. |
- Update url dependency. We don't use it directly, but wasmtime does. - Update the builtin actors (dev) dependency to remove some crufty dependencies. - Add licenses everywhere.
* chore: prep release v4.5.4 chore: prep release v4.5.4 * chore: fix changelogs * chore: bump minor version instead of patch version Unfortunately, we have a tiny breaking change in `fvm_shared` renaming something. I merged it because we left it sitting for ages waiting for a "good time" and, in my infinite wisdom, I picked a releas that contained no other major breaking changes... * chore: release fvm_ipld_encoding 0.5.2 --------- Co-authored-by: Steven Allen <[email protected]>
This didn't get updated in the lockfile correctly. It doesn't really matter (it's just the lock file) but it was causing issues when publishing.
I'd really like to specify a separate blockstore for this, there's no good reason to pollute the main blockstore with a ton of garbage. I thought maybe I could put this on the Currently the blockstore is the whole |
i.e. it was significantly easier to have an entirely separate function and code path that doesn't touch FVM initialisation thanks to the complexity of the FFI layer |
398c205
to
c038a4a
Compare
Changed to just be a |
Matches builtin actors and fixes cargo-deny.
fvm/src/kernel/default.rs
Outdated
// TODO: remove this, it's just for debugging. | ||
self.call_manager.log(format!("block_link({})", k)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Stebalien I removed this in my latest version but realised I now lose the ability to see what blocks are created during which part of a message execution - with it, I can look in the trace, find these, and know which blocks were created during a particular call or subcall exec. Now I only get all the blocks for the entirety of a message's execution. Do you have any clever ideas for how I might restore the functionality?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy to add a new event type to the execution log. But that'll be a bit of a larger change (we'll probably need to generalize CallManager::log
.
I've also considered changing how our gas events work a bit: ideally we'd log syscalls/actor calls then associate gas charges with those syscalls. I'd leave this out of this change and chat about it sync next week.
* Plumb through dump_cache from fvm4 to access intermediate blocks: - filecoin-project/filecoin-ffi#512 - filecoin-project/ref-fvm#2101 * Enable cache dumping in StateReplay with LOTUS_REPLAY_DUMP_CACHED_BLOCKS * Add optional "Blocks" field InvocResult * Handle ExecutionEvent::Log's and add "Logs" field to ExecutionTrace * Dump intermediate cache blocks to CAR in /tmp when they appear while using `lotus-shed msg --exec-trace`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a reasonable approach.
fvm/src/blockstore/buffered.rs
Outdated
self.write.borrow().len() | ||
); | ||
self.base | ||
.put_many_keyed(self.write.borrow().iter().map(|(k, v)| (*k, v.as_slice()))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: flush
actually removes them from this blockstore to avoid writing twice (just in case). I'd do that here as well. I.e., put_many_keyed(self.write.borrow_mut().drain()...
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ahh good point, I've made it do this and added some tests to assert the behaviour of this vs flush()
Converting to draft because it's stacked on #2109 plus a master rebase so this branch is a bit messy and shouldn't be merged as is |
No description provided.