Skip to content

Conversation

@klkvr
Copy link
Owner

@klkvr klkvr commented Jun 3, 2025

Changes in the PR:

  1. Bump reth to latest commit
  2. Fix rlp implementation of NewBlock requests by using new AT from feat: make NewBlock message generic paradigmxyz/reth#16627
  3. Remove unnecesary PayloadTypes generic from Blockimport type
  4. Add a hack to configure the ImportService by sending the engine handle after node startup

@klkvr klkvr force-pushed the klkvr/block-import branch from c75fa1f to daf8dd5 Compare June 3, 2025 20:14
@klkvr klkvr force-pushed the klkvr/block-import branch from daf8dd5 to 9605515 Compare June 3, 2025 20:16
@klkvr klkvr requested a review from Copilot June 3, 2025 20:20
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR contains bug fixes and refactoring updates for the BSC node, including an update to use the latest reth commit, a fix for the RLP implementation of NewBlock requests, removal of an unnecessary generic from Blockimport, and a hack to configure the ImportService by sending the engine handle after node startup.

  • Bump reth to latest commit and update associated types.
  • Fix the RLP implementation of NewBlock requests.
  • Remove an unnecessary generic parameter and add a temporary hack for ImportService configuration.

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/system_contracts/mod.rs Formatting updates and restructuring of contract initialization.
src/node/rpc/transaction.rs Removed generic parameter from TransactionCompat implementation.
src/node/rpc/block.rs Updated primitive types in accordance with recent changes.
src/node/network/mod.rs Updated imports and modified network builder to pass engine handle.
src/node/network/block_import/service.rs Removed generics and updated types for block import service.
src/node/network/block_import/mod.rs Adjusted BlockImport implementation to use new types.
src/node/network/block_import/handle.rs Updated handle types to remove generics.
src/node/mod.rs Refactored BscNode to support engine handle configuration.
src/main.rs Updated node launch order to send engine handle after startup.
rustfmt.toml & Cargo.toml Formatting and dependency updates.
Comments suppressed due to low confidence (1)

src/node/network/mod.rs:138

  • Consider handling the case where the engine handle has already been taken in a more graceful manner rather than unconditionally calling expect, to prevent potential runtime panics in production.
let handle = engine_handle_rx.lock().await.take().expect("node should only be launched once").await.unwrap();

error!("Import service error: {}", e);
}
});
engine_handle_tx.send(node.beacon_engine_handle.clone()).unwrap();
Copy link

Copilot AI Jun 3, 2025

Choose a reason for hiding this comment

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

Using unwrap here assumes the send will always succeed; consider handling the error or logging a descriptive message if the send fails in order to improve robustness.

Suggested change
engine_handle_tx.send(node.beacon_engine_handle.clone()).unwrap();
engine_handle_tx.send(node.beacon_engine_handle.clone())?;

Copilot uses AI. Check for mistakes.
@klkvr klkvr closed this Jun 10, 2025
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