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: re-enable logs #276

Merged
merged 43 commits into from
Sep 18, 2024
Merged

refactor: re-enable logs #276

merged 43 commits into from
Sep 18, 2024

Conversation

gregorydemay
Copy link
Member

@gregorydemay gregorydemay commented Sep 16, 2024

Follow-up on #275 to copy over the logs infrastructure from the removed ic-cketh-minter dependency and re-enable logging in the EVM-RPC canister.

@gregorydemay gregorydemay marked this pull request as ready for review September 17, 2024 05:26
gregorydemay added a commit that referenced this pull request Sep 18, 2024
Remove the dependency on the
[`ic-cketh-minter`](https://github.com/dfinity/ic/blob/1f551bea63354370b6e7a5037e96d464bdab3b41/rs/ethereum/cketh/minter/Cargo.toml).

This includes copying over the various files needed, while keeping
refactoring at a minimum to somewhat try to ease the review. Additional
refactoring will take place in follow-up PRs.

### Overview of copied file
| Source:
[`ic-cketh-minter`](https://github.com/dfinity/ic/blob/1f551bea63354370b6e7a5037e96d464bdab3b41/rs/ethereum/cketh/minter/Cargo.toml)
| Target: PR |
|--------|--------|
| `src/checked_amount.rs` | `src/rpc_client/checked_amount/mod.rs` |
| `src/checked_amount/tests.rs` |
`src/rpc_client/checked_amount/tests.rs` |
| `src/eth_rpc.rs` | `src/rpc_client/eth_rpc/mod.rs` |
| `src/eth_rpc/tests.rs` | `src/rpc_client/eth_rpc/tests.rs` |
| `src/eth_rpc_error/mod.rs` | `src/rpc_client/eth_rpc_error/mod.rs` | 
| `src/eth_rpc_error/tests.rs` | `src/rpc_client/eth_rpc_error/tests.rs`
|
| `src/eth_rpc_client/mod.rs` | `src/rpc_client/mod.rs` | 
| `src/numeric/mod.rs` | `src/rpc_client/numeric/mod.rs` | 
| `src/numeric/tests.rs` | `src/rpc_client/numeric/tests.rs` | 
| `src/eth_rpc_client/providers.rs` | `src/rpc_client/providers.rs` | 
| `src/eth_rpc_client/requests.rs` |  `src/rpc_client/requests.rs` | 
| `src/eth_rpc_client/responses.rs` |  `src/rpc_client/responses.rs` | 
| `src/eth_rpc_client/tests.rs` |  `src/rpc_client/tests.rs` | 

### Noticeable changes:

1. Remove anything related to `minicbor`, excepted for the HTTPs
transform (`cleanup_response`), where the type of transform to use is
encoded via `minicbor`.
2. Remove `CandidType` for all types used in JSON requests or responses.
Those types are implementation details and should not be exposed outside
of this canister.
3. Logging is currently disabled and will be the subject of a future PR
(#276).
4. Copied metrics in `src/rpc_client/eth_rpc/mod.rs` is currently dead
code and will be removed in a future PR (#277).

### Noticeable Added Dependencies:
The goal is that none of the productive code depends on the [IC
repository ](https://github.com/dfinity/ic) and is the main driver for
this PR. 2 temporary exceptions were added, which are crates with a very
self-contain scoped:

1. `ic-crypto-sha3`: a wrapper around `sha3`. This crate will be
published on `crates.io`
2. `ic-ethereum-types`: a crate for common Etheurem types (e.g.
`Address`). This crate will be published on `crates.io`.

---------

Co-authored-by: rvanasa <[email protected]>
Co-authored-by: Thomas Locher <[email protected]>
Base automatically changed from gdemay/243-cketh-client to main September 18, 2024 09:37
# Conflicts:
#	Cargo.lock
#	Cargo.toml
#	src/main.rs
#	src/rpc_client/checked_amount/mod.rs
#	src/rpc_client/eth_rpc/mod.rs
#	src/rpc_client/eth_rpc_error/mod.rs
#	src/rpc_client/mod.rs
@gregorydemay gregorydemay merged commit ecffde6 into main Sep 18, 2024
3 checks passed
@gregorydemay gregorydemay deleted the gdemay/243-cketh-client-logs branch September 18, 2024 12:03
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.

Refactor to remove cketh-minter dependency
3 participants