-
Notifications
You must be signed in to change notification settings - Fork 581
Add Substrate EVM adapter milestone 2 #1303
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
Conversation
|
Hey @dastansam, is this PR ready for review? |
Forgot the article again, will make it ready soon. Thanks! |
ready for review, thanks! |
|
Hi @dastansam thanks for the review. Currently there are 4 tests failing. None of them are related to the light client (which you said may fail). Can you take a look? Thanks! cargo test
warning: unused imports: `SubstrateConfig` and `SubstrateExtrinsicParams`
--> adapter/src/types.rs:9:38
|
9 | config::substrate::{BlakeTwo256, SubstrateExtrinsicParams, SubstrateHeader},
| ^^^^^^^^^^^^^^^^^^^^^^^^
10 | Config, PolkadotConfig, SubstrateConfig,
| ^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
warning: struct `BlockNotification` is never constructed
--> adapter/src/server.rs:22:12
|
22 | pub struct BlockNotification {
| ^^^^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: field `executor` is never read
--> adapter/src/server.rs:34:5
|
28 | pub struct EthAdapter {
| ---------- field in this struct
...
34 | executor: SubscriptionTaskExecutor,
| ^^^^^^^^
warning: field `symbol` is never read
--> adapter/src/sub_client.rs:31:5
|
27 | pub struct Properties {
| ---------- field in this struct
...
31 | symbol: String,
| ^^^^^^
|
= note: `Properties` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis
warning: method `subscribe_new_blocks` is never used
--> adapter/src/sub_client.rs:436:14
|
107 | impl SubLightClient {
| ------------------- method in this implementation
...
436 | async fn subscribe_new_blocks(
| ^^^^^^^^^^^^^^^^^^^^
warning: function `handle_accepted_subscription` is never used
--> adapter/src/sub_client.rs:462:14
|
462 | pub async fn handle_accepted_subscription(
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: `subeth` (bin "subeth" test) generated 6 warnings (run `cargo fix --bin "subeth" --tests` to apply 1 suggestion)
Finished `test` profile [unoptimized + debuginfo] target(s) in 0.70s
warning: the following packages contain code that will be rejected by a future version of Rust: trie-db v0.29.1
note: to see what the problems were, use the option `--future-incompat-report`, or run `cargo report future-incompatibilities --id 1`
Running unittests src/main.rs (target/debug/deps/subeth-6dbc030e5ff58475)
running 18 tests
test adapter::tests::test_pallet_mapping_works ... ok
test adapter::tests::test_hash_and_truncate ... ok
test adapter::tests::test_storage_key_works ... ok
test cache::tests::test_capacity_limit ... ok
test cache::tests::test_insert_and_retrieve ... ok
test tests::test_call_data_encoding_various_amounts ... ok
test cache::tests::test_latest_block ... ok
test tests::test_ethereum_transaction_encoding ... ok
test tests::test_fetch_local_metadata ... FAILED
Subeth RPC adapter!
Subeth RPC adapter!
Subeth RPC adapter!
[INFO ] Logger initialized
[INFO ] Logger initialized
[INFO ] Logger initialized
Error: RPC error: Error when opening the TCP socket: Connection refused (os error 111)
test tests::test_generic_scale_encoded_call_dispatch ... ok
[INFO ] Loading chain spec from: ../specs/polkadot.json
test tests::test_integration_flow_documentation ... ok
test tests::test_pallet_address_encoding ... ok
test tests::test_signature_format ... ok
test tests::test_transaction_message_hash ... ok
test tests::test_transfer_transaction_construction ... ok
[INFO ] Connected to chain: 42
[INFO ] RPC port: 8545
[INFO ] Launching RPC server at: Some([RpcEndpoint { listen_addr: 127.0.0.1:8545, batch_config: Unlimited, max_connections: 100, max_payload_in_mb: 15, max_payload_out_mb: 15, max_subscriptions_per_connection: 1024, max_buffer_capacity_per_connection: 64, rate_limit: None, rate_limit_trust_proxy_headers: false, rate_limit_whitelisted_ips: [], cors: Some(["http://localhost:*", "http://127.0.0.1:*", "https://localhost:*", "https://127.0.0.1:*", "https://polkadot.js.org"]), rpc_methods: Auto, is_optional: false, retry_random_port: true }, RpcEndpoint { listen_addr: [::1]:8545, batch_config: Unlimited, max_connections: 100, max_payload_in_mb: 15, max_payload_out_mb: 15, max_subscriptions_per_connection: 1024, max_buffer_capacity_per_connection: 64, rate_limit: None, rate_limit_trust_proxy_headers: false, rate_limit_whitelisted_ips: [], cors: Some(["http://localhost:*", "http://127.0.0.1:*", "https://localhost:*", "https://127.0.0.1:*", "https://polkadot.js.org"]), rpc_methods: Auto, is_optional: true, retry_random_port: true }])
[WARN ] Running in --dev mode, RPC CORS has been disabled.
[INFO ] Running JSON-RPC server: addr=127.0.0.1:8545,[::1]:8545
[INFO ] Chain initialization complete for polkadot. Name: "Polkadot". Genesis hash: 0x91b1…90c3. Chain specification starting at: 0xaf96…8407 (#14442869)
[INFO ] Chain specification of polkadot contains a `genesis.raw` item. It is possible to significantly improve the initialization time by replacing the `"raw": ...` field with `"stateRootHash": "0x29d0d972cd27cbc511e9589fcb7a4506d5eb6a9e8df205f00472e5ab354a4e17"`
[WARN ] Chain specification of polkadot contains a non-empty `telemetryEndpoints` field. Smoldot doesn't support telemetry endpoints and as such this field is unused.
[WARN ] The JSON-RPC client has just called a JSON-RPC function from the legacy JSON-RPC API (chain_getFinalizedHead). Legacy JSON-RPC functions have loose semantics and cannot be properly implemented on a light client. You are encouraged to use the new JSON-RPC API <https://github.com/paritytech/json-rpc-interface-spec/> instead. The legacy JSON-RPC API functions will be deprecated and removed in the distant future.
test tests::test_e2e_balance_transfer ... FAILED
[ERROR] subxt error: Metadata(IncompatibleCodegen)
test tests::test_eth_rpc_url ... FAILED
[INFO ] Successfully compiled runtime. Spec version: 9360. Size of `:code`: 1.3 MiB.
[INFO ] Connected to chain: 42
[INFO ] RPC port: 8546
[INFO ] Launching RPC server at: Some([RpcEndpoint { listen_addr: 127.0.0.1:8546, batch_config: Unlimited, max_connections: 100, max_payload_in_mb: 15, max_payload_out_mb: 15, max_subscriptions_per_connection: 1024, max_buffer_capacity_per_connection: 64, rate_limit: None, rate_limit_trust_proxy_headers: false, rate_limit_whitelisted_ips: [], cors: Some(["http://localhost:*", "http://127.0.0.1:*", "https://localhost:*", "https://127.0.0.1:*", "https://polkadot.js.org"]), rpc_methods: Auto, is_optional: false, retry_random_port: true }, RpcEndpoint { listen_addr: [::1]:8546, batch_config: Unlimited, max_connections: 100, max_payload_in_mb: 15, max_payload_out_mb: 15, max_subscriptions_per_connection: 1024, max_buffer_capacity_per_connection: 64, rate_limit: None, rate_limit_trust_proxy_headers: false, rate_limit_whitelisted_ips: [], cors: Some(["http://localhost:*", "http://127.0.0.1:*", "https://localhost:*", "https://127.0.0.1:*", "https://polkadot.js.org"]), rpc_methods: Auto, is_optional: true, retry_random_port: true }])
[WARN ] Running in --dev mode, RPC CORS has been disabled.
[INFO ] Running JSON-RPC server: addr=127.0.0.1:8546,[::1]:8546
test tests::test_eth_rpc_light_client ... ok
failures:
---- tests::test_fetch_local_metadata stdout ----
Error: RPC error: Error when opening the TCP socket: Connection refused (os error 111)
---- tests::test_e2e_balance_transfer stdout ----
Error: Client exited with status: exit status: 0
---- tests::test_eth_rpc_url stdout ----
Transaction: Some(Transaction { inner: Eip1559(Signed { tx: TxEip1559 { chain_id: 0, nonce: 0, gas_limit: 21000000, max_fee_per_gas: 340282366920938463463374607431768211455, max_priority_fee_per_gas: 0, to: Call(0x54696d657374616d000000000000000000000000), value: 0, access_list: AccessList([]), input: 0x03000b508cc3c29b01 }, signature: PrimitiveSignature { y_parity: false, r: 0, s: 0 }, hash: 0xfc1e79631a311925e1a8be2c85bbbaa0b0d4d2c24cacb4c088341f7c204a2362 }), block_hash: Some(0x8990b2b52497eee3bca09fd118af0afb4f588df76814a5fbcc084284645aa4c3), block_number: Some(29526172), transaction_index: Some(0), effective_gas_price: None, from: 0x0000000000000000000000000000000000000000 })
Error: ErrorObject { code: ServerError(500), message: "Adapter error", data: Some(RawValue("Subxt err: Metadata(IncompatibleCodegen)")) }
Caused by:
ErrorObject { code: ServerError(500), message: "Adapter error", data: Some(RawValue("Subxt err: Metadata(IncompatibleCodegen)")) }
failures:
tests::test_e2e_balance_transfer
tests::test_eth_rpc_url
tests::test_fetch_local_metadata
test result: FAILED. 15 passed; 3 failed; 0 ignored; 0 measured; 0 filtered out; finished in 51.39s |
|
The Docker file also fails seemingly due to an issue with the COPY command: |
thanks for the review, will be addressing it this weekend |
addressed the comments in this commit @keeganquigley |
|
Thanks @dastansam for the fixes. All tests are now passing. The Docker Compose file is working now but there is a minor issue where the health check is trying to use Could you either install |
thanks, just pushed the fix for this |
|
Thanks for the fixes @dastansam I'm now willing to accept M2. Here is my final evaluation. Congrats and was nice working with you through the process. |
|
🪙 Please fill out the invoice form in order to initiate the payment process. Please make sure that you follow the instructions and requirements as laid out in the form as well as our Terms & Conditions. Thank you! |
|
Congratulations on completing the first milestone of this grant! As part of the Grants Program, we want to help grant recipients acknowledge their grants publicly. To that end, we've created a badge for projects that successfully deliver their first milestone. Please use the badge only in reference to the work that has been completed as part of this grant, so please do not display it on your team or project's homepage unless accompanied by a short description of the grant. Furthermore, you're now welcome to announce the grant publicly. Please remember to observe the foundation's guidelines in doing so. If you haven't already, reach out to [email protected] for feedback on your announcement and cross-promotion. |
likewise, was nice working with you, thank you! |
Milestone Delivery Checklist
Link to the application pull request: w3f/Grants-Program#2292