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

Better debug logging #7

Merged
merged 4 commits into from
Feb 10, 2023
Merged

Better debug logging #7

merged 4 commits into from
Feb 10, 2023

Conversation

mattiekat
Copy link

This is what our Mailbox used to look like in the logs (if pretty formatted)

EthereumMailbox {
    contract: Mailbox(0x4ed7c70f96b99c776995fb64377f0d4ab3b0e1c1),
    domain: HyperlaneDomain(test2 (13372)),
    provider: SignerMiddleware {
        inner: NonceManagerMiddleware {
            inner: PrometheusMiddleware(
                Provider {
                    inner: QuorumProvider {
                        quorum: Majority,
                        quorum_weight: 2,
                        providers: [
                            WeightedProvider {
                                inner: RetryingProvider {
                                    inner: PrometheusJsonRpcClient(
                                        Provider {
                                            id: 8,
                                            client: Client {
                                                accepts: Accepts,
                                                proxies: [Proxy(System({}), None)],
                                                referer: true,
                                                default_headers: {"accept": "*/*"},
                                                timeout: 60s
                                            },
                                            url: Url {
                                                scheme: "http",
                                                cannot_be_a_base: false,
                                                username: "",
                                                password: None,
                                                host: Some(Ipv4(127.0.0.1)),
                                                port: Some(8545),
                                                path: "/",
                                                query: None,
                                                fragment: None
                                            }
                                        }
                                    ),
                                    max_requests: 5,
                                    base_retry_ms: 1000
                                },
                                weight: 1
                            },
                            WeightedProvider {
                                inner: RetryingProvider {
                                    inner: PrometheusJsonRpcClient(
                                        Provider {
                                            id: 8,
                                            client: Client {
                                                accepts: Accepts,
                                                proxies: [Proxy(System({}), None)],
                                                referer: true,
                                                default_headers: {"accept": "*/*"},
                                                timeout: 60s
                                            },
                                            url: Url {
                                                scheme: "http",
                                                cannot_be_a_base: false,
                                                username: "",
                                                password: None,
                                                host: Some(Ipv4(127.0.0.1)),
                                                port: Some(8545),
                                                path: "/",
                                                query: None,
                                                fragment: None
                                            }
                                        }
                                    ),
                                    max_requests: 5,
                                    base_retry_ms: 1000
                                },
                                weight: 1
                            },
                            WeightedProvider {
                                inner: RetryingProvider {
                                    inner: PrometheusJsonRpcClient(
                                        Provider {
                                            id: 8,
                                            client: Client {
                                                accepts: Accepts,
                                                proxies: [Proxy(System({}), None)],
                                                referer: true,
                                                default_headers: {"accept": "*/*"},
                                                timeout: 60s
                                            },
                                            url: Url {
                                                scheme: "http",
                                                cannot_be_a_base: false,
                                                username: "",
                                                password: None,
                                                host: Some(Ipv4(127.0.0.1)),
                                                port: Some(8545),
                                                path: "/",
                                                query: None,
                                                fragment: None
                                            }
                                        }
                                    ),
                                    max_requests: 5,
                                    base_retry_ms: 1000
                                },
                                weight: 1
                            }
                        ]
                    },
                    ens: None,
                    interval: None,
                    from: None,
                    _node_client: Mutex {
                        is_locked: false,
                        has_waiters: false
                    }
                }
            ),
            initialized: false,
            nonce: 0,
            address: 0xbcd4042de499d14e55001ccbb24a551f3b954096
        },
        signer: Local(
            Wallet {
                address: 0xbcd4042de499d14e55001ccbb24a551f3b954096,
                chain_Id: 31337
            }
        ),
        address: 0xbcd4042de499d14e55001ccbb24a551f3b954096
    }
}

And this is what it looks like now (if pretty formatted)

EthereumMailbox {
    contract: Mailbox(0x4ed7c70f96b99c776995fb64377f0d4ab3b0e1c1),
    domain: HyperlaneDomain(test2 (13372)),
    provider: SignerMiddleware {
        signer: Local(
            Wallet {
                address: 0xbcd4042de499d14e55001ccbb24a551f3b954096,
                chain_Id: 31337
            }
        ),
        address: 0xbcd4042de499d14e55001ccbb24a551f3b954096,
        inner: NonceManagerMiddleware {
            initialized: false,
            nonce: 0,
            address: 0xbcd4042de499d14e55001ccbb24a551f3b954096,
            inner: PrometheusMiddleware(
                Provider {
                    ens: None,
                    interval: None,
                    from: None,
                    inner: QuorumProvider {
                        quorum: Majority,
                        quorum_weight: 2,
                        providers: [
                            WeightedProvider {
                                weight: 1,
                                inner: RetryingProvider {
                                    max_requests: 5,
                                    base_retry_ms: 1000,
                                    inner: PrometheusJsonRpcClient(
                                        Http { id: 44, url: http://127.0.0.1:8545/ }
                                    )
                                }
                            },
                            WeightedProvider {
                                weight: 1,
                                inner: RetryingProvider {
                                    max_requests: 5,
                                    base_retry_ms: 1000,
                                    inner: PrometheusJsonRpcClient(
                                        Http { id: 44, url: http://127.0.0.1:8545/ }
                                    )
                                }
                            },
                            WeightedProvider {
                                weight: 1,
                                inner: RetryingProvider {
                                    max_requests: 5,
                                    base_retry_ms: 1000,
                                    inner: PrometheusJsonRpcClient(
                                        Http { id: 44, url: http://127.0.0.1:8545/ }
                                    )
                                }
                            }
                        ]
                    }
                }
            )
        }
    }
}

@mattiekat mattiekat changed the title Mattie/better debug logging Better debug logging Feb 9, 2023
@mattiekat mattiekat marked this pull request as ready for review February 9, 2023 23:08
@mattiekat mattiekat requested a review from tkporter February 9, 2023 23:08
Copy link

@asaj asaj left a comment

Choose a reason for hiding this comment

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

Wondering if we should merge changes from upstream as well while we're at it

@mattiekat
Copy link
Author

mattiekat commented Feb 10, 2023

Wondering if we should merge changes from upstream as well while we're at it

They haven't made a new release tag yet and we have not run into any missing features yet (that they have in main) so I vote no.

@mattiekat mattiekat merged commit fe5d882 into hyperlane Feb 10, 2023
@mattiekat mattiekat deleted the mattie/better-debug-logging branch February 10, 2023 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants