Skip to content
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(examples): minimal viable ExEx #7565

Merged
merged 53 commits into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from 47 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
46f6487
wip: exex manager
onbjerg Mar 26, 2024
03f7781
refactor: rename to `spawn`
onbjerg Mar 26, 2024
09e6dda
feat: exex rx channel
onbjerg Mar 28, 2024
9e52e2d
feat: flesh out manager loop
onbjerg Mar 28, 2024
44a1a5f
refactor: move manager to `reth-exex`
onbjerg Apr 8, 2024
d9772d6
refactor: `ExExHandle`
onbjerg Apr 8, 2024
3223632
docs: typo
onbjerg Apr 8, 2024
01494dc
feat: [`ExExHandle::new`]
onbjerg Apr 8, 2024
eeaef8b
fix: retain events > min_id
onbjerg Apr 8, 2024
4af2c9a
feat: most of launch flow
onbjerg Apr 8, 2024
4674ef3
feat: exex id in `install_exex`
onbjerg Apr 8, 2024
3ac8ecd
feat: hook up blockchain tree
onbjerg Apr 8, 2024
4bea51b
chore: rm unused dep
onbjerg Apr 8, 2024
a9a3aab
fix: add id to other `install_exex` impl
onbjerg Apr 8, 2024
6d68a29
fix: use unbounded channels for `ExExEvent`
onbjerg Apr 8, 2024
2086a03
chore: add traces
onbjerg Apr 8, 2024
358d71b
chore: only spawn exex manager if there are exex's
onbjerg Apr 8, 2024
36006b1
docs: move exex docs
onbjerg Apr 8, 2024
3ee6116
feat: basic exex metrics
onbjerg Apr 8, 2024
4ce21fc
feat: handle `ExExEvent`
onbjerg Apr 8, 2024
c4895de
feat: manager metrics
onbjerg Apr 8, 2024
0e8ddc6
refactor: some cleanup
onbjerg Apr 8, 2024
638e474
fix: add missing f64 cast for metrics
onbjerg Apr 8, 2024
242600c
feat: `ExExManagerHandle::ready`
onbjerg Apr 10, 2024
ec91e4e
chore: manager tracing logs
onbjerg Apr 10, 2024
0caefa8
make manager handle mut
shekhirin Apr 10, 2024
18e9691
chore: `AsRef<str>` in `install_exex`
onbjerg Apr 10, 2024
ebd7f16
fix: make it compile
onbjerg Apr 10, 2024
b04012e
fix: actually really make it super compile
onbjerg Apr 10, 2024
25411db
test: make test compile
onbjerg Apr 10, 2024
837a2c9
feat: don't sent notifs exex doesn't care about
onbjerg Apr 10, 2024
4120dfa
feat: `events_sent` metric
onbjerg Apr 10, 2024
c775fa2
docs: finished height docs clarifications
onbjerg Apr 10, 2024
01c360e
fix: various fixes wrt finished height
onbjerg Apr 10, 2024
2d9e71d
chore: rename metrics
onbjerg Apr 10, 2024
fd8a06c
chore: drop span
onbjerg Apr 10, 2024
5c7ea0e
chore: re-introduce span
onbjerg Apr 10, 2024
f237ff9
docs: fix doclinks
onbjerg Apr 10, 2024
879d90f
refactor: rename `block` to `finished_height`
onbjerg Apr 10, 2024
3b5d6f7
feat: `ExExManagerHandle::capacity`
onbjerg Apr 10, 2024
af65a96
chore: stub `poll_ready`
onbjerg Apr 10, 2024
f3ddf17
chore: fmt
onbjerg Apr 10, 2024
e2c36ac
feat: `poll_ready`
onbjerg Apr 10, 2024
a2f670a
chore: clean up
onbjerg Apr 10, 2024
698d6e3
refactor: move exex launch past components builder
onbjerg Apr 10, 2024
e17da42
chore: review
onbjerg Apr 10, 2024
00a26eb
feat(examples): minimal viable ExEx
shekhirin Apr 11, 2024
232cd95
Merge remote-tracking branch 'origin/main' into onbjerg/exex-manager
shekhirin Apr 11, 2024
307bc3f
chore: use `Into<String>`
onbjerg Apr 11, 2024
3648a44
Merge remote-tracking branch 'origin/onbjerg/exex-manager' into alexe…
shekhirin Apr 11, 2024
ab17928
add comment, address PR review
shekhirin Apr 11, 2024
57b8df3
Merge branch 'main' into alexey/minimal-exex
onbjerg Apr 11, 2024
b0645e9
Merge remote-tracking branch 'origin/main' into alexey/minimal-exex
shekhirin Apr 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ members = [
"examples/trace-transaction-cli/",
"examples/polygon-p2p/",
"examples/custom-inspector/",
"examples/exex/minimal/",
"testing/ef-tests/",
]
default-members = ["bin/reth"]
Expand Down
12 changes: 12 additions & 0 deletions crates/exex/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,22 @@ description = "Execution extensions for Reth"
workspace = true

[dependencies]
## reth
reth-config.workspace = true
reth-metrics.workspace = true
reth-node-api.workspace = true
reth-node-core.workspace = true
reth-primitives.workspace = true
reth-provider.workspace = true
reth-tasks.workspace = true
reth-tracing.workspace = true

## async
futures.workspace = true
tokio.workspace = true
tokio-stream.workspace = true
tokio-util.workspace = true

## misc
eyre.workspace = true
metrics.workspace = true
32 changes: 30 additions & 2 deletions crates/exex/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,31 @@
//! Execution extensions.
// todo: expand this (examples, assumptions, invariants)
//! Execution extensions (ExEx).
//!
//! TBD
//! An execution extension is a task that derives its state from Reth's state.
//!
//! Some examples of such state derives are rollups, bridges, and indexers.
//!
//! An ExEx is a [`Future`] resolving to a `Result<()>` that is run indefinitely alongside Reth.
//!
//! ExEx's are initialized using an async closure that resolves to the ExEx; this closure gets
//! passed an [`ExExContext`] where it is possible to spawn additional tasks and modify Reth.
//!
//! Most ExEx's will want to derive their state from the [`CanonStateNotification`] channel given in
//! [`ExExContext`]. A new notification is emitted whenever blocks are executed in live and
//! historical sync.
//!
//! # Pruning
//!
//! ExEx's **SHOULD** emit an `ExExEvent::FinishedHeight` event to signify what blocks have been
//! processed. This event is used by Reth to determine what state can be pruned.
//!
//! An ExEx will only receive notifications for blocks greater than the block emitted in the event.
//! To clarify: if the ExEx emits `ExExEvent::FinishedHeight(0)` it will receive notifications for
//! any `block_number > 0`.
//!
//! [`Future`]: std::future::Future
//! [`ExExContext`]: crate::ExExContext
//! [`CanonStateNotification`]: reth_provider::CanonStateNotification
#![doc(
html_logo_url = "https://raw.githubusercontent.com/paradigmxyz/reth/main/assets/reth-docs.png",
html_favicon_url = "https://avatars0.githubusercontent.com/u/97369466?s=256",
Expand All @@ -14,3 +39,6 @@ pub use context::*;

mod event;
pub use event::*;

mod manager;
pub use manager::*;
Loading
Loading