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

Logging context refactoring #218

Merged
merged 25 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
337740f
Draft implementation of new logging API
soareschen Mar 20, 2024
34cd68c
Also log values from the logging context in LogSerialize
soareschen Mar 20, 2024
b2f0fc9
Use new logger in EstimateFeesAndSendTx
soareschen Mar 20, 2024
2e5126c
Initialize Tracing logger in tests
soareschen Mar 20, 2024
f5ad47e
Implement logger in a context-generic way
soareschen Mar 20, 2024
f0f228c
Log TxNoResponseError
soareschen Mar 20, 2024
9a1f8e5
Refactor retryable error
soareschen Mar 20, 2024
728716d
Add generic DelegateErrorRaiser component
soareschen Mar 20, 2024
d30bfa9
Add log entry LogRetryQueryTxResponse
soareschen Mar 20, 2024
d70ee55
Remove CanLogTx and CanLogNonce
soareschen Mar 21, 2024
f1d9e55
Implement NoLogger
soareschen Mar 21, 2024
3180e29
Add LogSkipRelayLockedPacket
soareschen Mar 21, 2024
fea0c06
Add LogRelayPacketProgress
soareschen Mar 21, 2024
7682911
Use LogSkipRelayLockedPacket in PacketEventRelayer
soareschen Mar 21, 2024
921e5da
Add LogClearPacketError
soareschen Mar 21, 2024
929dca3
Add LogRelayPacketStatus
soareschen Mar 21, 2024
02e90c2
Add LogSkipBuildUpdateClientMessage
soareschen Mar 21, 2024
a2a817e
Add LogWaitUpdateClientHeightStatus
soareschen Mar 21, 2024
0746183
Remove use of OldLogger
soareschen Mar 21, 2024
f422e70
Add LogBatchWorker
soareschen Mar 21, 2024
3522c38
Remove old logging context
soareschen Mar 21, 2024
3b655d2
Add back logging in IbcTransferTest
soareschen Mar 21, 2024
cc9d44c
Move context-generic logging components to tracing-components crate
soareschen Mar 21, 2024
e5fcb78
Fix clippy
soareschen Mar 21, 2024
82f7ca2
Slight refactoring
soareschen Mar 21, 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
161 changes: 156 additions & 5 deletions Cargo.lock

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

5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ members = [
"crates/runtime/tokio-runtime-components",
"crates/runtime/relayer-runtime",
"crates/encoding/protobuf-components",
"crates/logging/tracing-components",
"crates/cosmos/cosmos-client-components",
"crates/cosmos/cosmos-test-components",
"crates/cosmos/cosmos-integration-tests",
Expand Down Expand Up @@ -69,6 +70,7 @@ serde_derive = { version = "1.0" }
serde_json = { version = "1.0" }
tokio = { version = "1.36" }
tracing = { version = "0.1.40" }
tracing-subscriber = { version = "0.3.18" }
tonic = { version = "0.10" }
toml = { version = "0.8.10" }
futures = { version = "0.3.29", default-features = false }
Expand All @@ -80,7 +82,6 @@ itertools = { version = "0.11" }
http = { version = "0.2.11" }
humantime = { version = "2.1.0" }
flex-error = { version = "0.4.4", default-features = false }
tracing-subscriber = { version = "0.3.18" }
jsonrpsee = { version = "0.21.0", default-features = false }
hdpath = { version = "0.6.3" }
borsh = { version = "0.10.3" }
Expand Down Expand Up @@ -109,6 +110,7 @@ hermes-async-runtime-components = { version = "0.1.0" }
hermes-tokio-runtime-components = { version = "0.1.0" }
hermes-relayer-runtime = { version = "0.1.0" }
hermes-protobuf-components = { version = "0.1.0" }
hermes-tracing-components = { version = "0.1.0" }
hermes-solomachine-relayer = { version = "0.1.0" }
hermes-test-components = { version = "0.1.0" }
hermes-ibc-test-suite = { version = "0.1.0" }
Expand Down Expand Up @@ -165,6 +167,7 @@ hermes-async-runtime-components = { path = "./crates/runtime/async-runtime-c
hermes-tokio-runtime-components = { path = "./crates/runtime/tokio-runtime-components" }
hermes-relayer-runtime = { path = "./crates/runtime/relayer-runtime" }
hermes-protobuf-components = { path = "./crates/encoding/protobuf-components" }
hermes-tracing-components = { path = "./crates/logging/tracing-components" }
hermes-solomachine-relayer = { path = "./crates/solomachine/solomachine-relayer" }
hermes-test-components = { path = "./crates/test/test-components" }
hermes-ibc-test-suite = { path = "./crates/test/test-suite" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ use hermes_cosmos_test_components::bootstrap::traits::generator::generate_wallet
use hermes_cosmos_test_components::bootstrap::traits::modifiers::modify_comet_config::CometConfigModifier;
use hermes_cosmos_test_components::bootstrap::traits::modifiers::modify_genesis_config::CosmosGenesisConfigModifier;
use hermes_relayer_components::runtime::traits::runtime::{ProvideRuntime, RuntimeTypeComponent};
use hermes_relayer_runtime::impls::types::runtime::ProvideTokioRuntimeType;
use hermes_relayer_runtime::impls::types::runtime::ProvideHermesRuntime;
use hermes_relayer_runtime::types::runtime::HermesRuntime;
use hermes_test_components::chain_driver::traits::types::chain::ChainTypeComponent;
use hermes_test_components::driver::traits::types::chain_driver::ChainDriverTypeComponent;
Expand Down Expand Up @@ -89,7 +89,7 @@ delegate_components! {
BaseCelestiaBootstrapComponents,
ErrorTypeComponent: ProvideEyreError,
ErrorRaiserComponent: RaiseDebugError,
RuntimeTypeComponent: ProvideTokioRuntimeType,
RuntimeTypeComponent: ProvideHermesRuntime,
[
ChainTypeComponent,
ChainDriverTypeComponent,
Expand Down
2 changes: 1 addition & 1 deletion crates/cosmos/cosmos-client-components/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ tendermint = { workspace = true, features = ["secp256k1
tendermint-proto = { workspace = true }
tendermint-rpc = { workspace = true, features = ["http-client", "websocket-client"] }

flex-error = { workspace = true }
prost = { workspace = true }
prost-types = { workspace = true }
eyre = { workspace = true }
Expand All @@ -35,4 +34,5 @@ futures = { workspace = true }
tracing = { workspace = true }
http = { workspace = true }
bech32 = { workspace = true }
serde_json = { workspace = true }
tonic = { workspace = true, features = ["tls", "tls-roots"] }
12 changes: 7 additions & 5 deletions crates/cosmos/cosmos-integration-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ hermes-cosmos-client-components = { workspace = true }
hermes-cosmos-test-components = { workspace = true }
tendermint-rpc = { workspace = true }

eyre = { workspace = true }
tokio = { workspace = true }
toml = { workspace = true }
serde_json = { workspace = true }
prost = { workspace = true }
eyre = { workspace = true }
tokio = { workspace = true }
toml = { workspace = true }
serde_json = { workspace = true }
prost = { workspace = true }
tracing = { workspace = true }
tracing-subscriber = { workspace = true }

stable-eyre = { version = "0.2.2" }
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use cgp_core::prelude::*;
use cgp_core::{ErrorRaiserComponent, ErrorTypeComponent};
use hermes_cosmos_relayer::contexts::logger::ProvideCosmosLogger;
use hermes_cosmos_relayer::types::error::{DebugError, ProvideCosmosError};
use hermes_relayer_components::logger::traits::has_logger::{
LoggerFieldComponent, LoggerTypeComponent,
use hermes_relayer_components::log::traits::has_logger::{
GlobalLoggerGetterComponent, LoggerGetterComponent, LoggerTypeComponent,
};
use hermes_relayer_runtime::impls::logger::components::ProvideTracingLogger;
use hermes_test_components::driver::traits::channel_at::ChannelGetterAt;
use hermes_test_components::driver::traits::types::birelay_at::BiRelayTypeAtComponent;
use hermes_test_components::driver::traits::types::chain_at::ChainTypeAtComponent;
Expand Down Expand Up @@ -44,11 +44,6 @@ delegate_components! {
CosmosBinaryChannelTestDriverComponents {
ErrorTypeComponent: ProvideCosmosError,
ErrorRaiserComponent: DebugError,
[
LoggerTypeComponent,
LoggerFieldComponent,
]:
ProvideTracingLogger,
[
ChainTypeAtComponent,
ChainDriverTypeAtComponent,
Expand All @@ -57,6 +52,12 @@ delegate_components! {
RelayDriverTypeAtComponent,
]:
ProvideCosmosTestTypes,
[
LoggerTypeComponent,
LoggerGetterComponent,
GlobalLoggerGetterComponent,
]:
ProvideCosmosLogger,
}
}

Expand Down
Loading
Loading