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

refactor(sequencer): provide storage and snapshot types #1801

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
21 changes: 19 additions & 2 deletions Cargo.lock

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

3 changes: 3 additions & 0 deletions crates/astria-sequencer/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Index all event attributes [#1786](https://github.com/astriaorg/astria/pull/1786).
- Consolidate action handling to single module [#1759](https://github.com/astriaorg/astria/pull/1759).
- Ensure all deposit assets are trace prefixed [#1807](https://github.com/astriaorg/astria/pull/1807).
- Provide and use new `Storage` struct, wrapping `cnidarium::Storage` [#1801](https://github.com/astriaorg/astria/pull/1801).
- Provide and use new `Snapshot` struct, wrapping `cnidarium::Snapshot` and
holding a cache of recently-read values [#1801](https://github.com/astriaorg/astria/pull/1801).

## [1.0.0] - 2024-10-25

Expand Down
5 changes: 5 additions & 0 deletions crates/astria-sequencer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,14 @@ telemetry = { package = "astria-telemetry", path = "../astria-telemetry", featur
"display",
] }

anyhow = "1.0.89"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was a big effort to not have anyhow be a direct dependency of sequencer. Can we avoid reintroducing it here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we might be able to do that as part of #1436, but for now it's required since we're implementing cnidarium::StateRead on the new Snapshot type and that requires anyhow (cnidarium doesn't re-export it either).

borsh = { version = "1.5.1", features = ["bytes", "derive"] }
cnidarium = { git = "https://github.com/penumbra-zone/penumbra.git", tag = "v0.80.7", features = [
"metrics",
] }
ibc-proto = { version = "0.41.0", features = ["server"] }
matchit = "0.7.2"
quick_cache = "0.6.9"
tower = "0.4"
tower-abci = "0.12.0"
tower-actor = "0.1.0"
Expand All @@ -60,10 +62,12 @@ regex = { workspace = true }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
sha2 = { workspace = true }
tempfile = { workspace = true, optional = true }
tendermint-proto = { workspace = true }
tendermint = { workspace = true }
thiserror = { workspace = true }
tokio = { workspace = true, features = ["rt", "tracing"] }
tokio-stream = { workspace = true }
tonic = { workspace = true }
tracing = { workspace = true }

Expand All @@ -80,6 +84,7 @@ insta = { workspace = true, features = ["json"] }
paste = "1.0.15"
maplit = "1.0.2"
rand_chacha = "0.3.1"
tempfile = { workspace = true }
tokio = { workspace = true, features = ["test-util"] }

[build-dependencies]
Expand Down
10 changes: 5 additions & 5 deletions crates/astria-sequencer/src/accounts/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@ use astria_eyre::eyre::{
Result,
WrapErr as _,
};
use cnidarium::{
Snapshot,
StateRead,
Storage,
};
use cnidarium::StateRead;
use futures::TryStreamExt as _;
use prost::Message as _;
use tendermint::{
Expand All @@ -34,6 +30,10 @@ use crate::{
accounts::StateReadExt as _,
app::StateReadExt as _,
assets::StateReadExt as _,
storage::{
Snapshot,
Storage,
},
};

async fn ibc_to_trace<S: StateRead>(
Expand Down
Loading
Loading