Commit b322ded
Refactor Tracing (#273)
* Refactor tracing
This commit refactors tracing to work with the latest tracing changes in
substrate that came with the `RPC for state tracing` PR.
Some things in the tracing code were refactored, particularly
with reference to executing blocks in order to make the code
easier to understand.
* add wasm for 8.30
* refactor tracing for changes to state tracing in substrate
* Revert "refactor tracing for changes to state tracing in substrate"
This reverts commit aa2221a.
* add missing method to main_backend, add a common test crate
* start creating tests for state tracing
* Wasm Binaries & Tests
- create macro to pull polkadot blocks from different runtime versions
- binaries for 8.30
* Revert changing self.last_max in `blocks.rs`
* add blocks for v25 26 and 27
* remove test for now
* remove superfluous logline
* AlwaysWasm -> NativeElseWasm
* fix logs
* log::error!
* logs
* create type-definitions for dot_runtime_api function return value
* comment for decl_block_data
* remove panic
* license headers, update Cargo.lock
* Update test-common/Cargo.toml
Co-authored-by: David <dvdplm@gmail.com>
* Update substrate-archive/src/actors.rs
Co-authored-by: David <dvdplm@gmail.com>
* remove dead_code in comments
* block_hash -> hash, block_num -> number
* thorw error when dispatcher fails
* expand docs a bit
* Don't destroy Mutex in execute_with_tracing
Instead of destroying the mutex, which has the possiblity of panicking,
prefer to allocate and drain(..) from the mutex.
* Update substrate and Polkadot
use `ReadRuntimeVersion` instead of `CallInWasmExt` for gathering
runtime versions. Instead of calling into wasm, ReadRuntimeVersion
will read the text header of a wasm blob first to check if the version
exists there.
* update substrate & polkadot
* add integration test crate
* revert integration_tests crae
* some cleanup
* revert updating to latest substrate
* compile polkadot-archive
* update dependencies
* update dependencies to latest substrate/polkadot
* update node-template
* use temp substrate branch
* dont use live data for unit tests
* Write unit tests for TraceHandler
Dont use stateful data from Polkadot live chains.
* refine test
* remove unused from test-wasm
* add some asserts for test
* Update substrate-archive/src/tasks.rs
Co-authored-by: Zeke Mostov <32168567+emostov@users.noreply.github.com>
* update dependencies to latest substrate
* style lints
* normalize wasm blob names, add 8.30 compiled with older rust compiler
* add 0.9.0 and 0.9.1
* add 0.9.2
* add 0.9.3
* use code_substitutes for call executor
* update polkadot-service
* add especially compiled wasm blobs
* Update substrate-archive-backend/src/frontend.rs
Co-authored-by: David <dvdplm@gmail.com>
* nits
* remove duplicate wasm
* build 8.30 with earlier compiler version
* clippy lints
* update polkadot-service dev dep
* remove node-template check from actions
* split up actions into separate jobs
* name actions accordingly
* fix node-template workflow
* check on pull_request and push to master
* check on push to release too
* style lints
* skip wasm build when checking archive library
* skip wasm build on code lints
* simplify return type of prepare_block()
* Remove CurrentSpan & unnecesary clones
- Removes CurrentSpan since that is being deprecated in tracing-subscriber
- to facilitate the removal of CurrentSpan, we turn the
`TraceHandler` from a `Subscriber` into a `Layer`.
This allows us to create a subscriber in `scoped_trace` with
tokio's `Registry` type which tracks the `current_span`, and
therefore parent-child relationships, for us.
- Removed `block_num` and `hash` from the instantiation of
`TraceHandler`. `TraceHandler` just needs to be able to track
arbitrary spans & events, and the context of those spans &
events may be attached after-the-fact. Since we track them with
a default dispatcher per-thread, we already did this.
Therefore also adding `block_num` and `hash` to `TraceHandler`
just created unnecessary cloning and blocknum per-span/event.
* code style
Co-authored-by: David <dvdplm@gmail.com>
Co-authored-by: Zeke Mostov <32168567+emostov@users.noreply.github.com>1 parent cd6a446 commit b322ded
File tree
19 files changed
+693
-3208
lines changed- .github/workflows
- substrate-archive
- src
- actors/workers
- database
- test-common
- src
- test-wasm
- src
19 files changed
+693
-3208
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
39 | 41 | | |
40 | 42 | | |
41 | 43 | | |
42 | 44 | | |
43 | 45 | | |
44 | 46 | | |
| 47 | + | |
| 48 | + | |
45 | 49 | | |
46 | 50 | | |
47 | 51 | | |
48 | 52 | | |
49 | 53 | | |
50 | 54 | | |
| 55 | + | |
| 56 | + | |
51 | 57 | | |
52 | 58 | | |
53 | 59 | | |
54 | 60 | | |
55 | 61 | | |
56 | 62 | | |
| 63 | + | |
| 64 | + | |
57 | 65 | | |
58 | 66 | | |
59 | 67 | | |
0 commit comments