Skip to content

Conversation

@zerosnacks
Copy link
Member

Motivation

Opening for visibility + discussion

Solution

Methodology: https://gist.github.com/zerosnacks/227ac62697fba3c868db4156d4e37610

Removes unused code

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

Comment on lines -2422 to -2429
/// Sets the reported block number
///
/// Handler for ETH RPC call: `anvil_setBlock`
pub fn anvil_set_block(&self, block_number: u64) -> Result<()> {
node_info!("anvil_setBlock");
self.backend.set_block_number(block_number);
Ok(())
}
Copy link
Member Author

Choose a reason for hiding this comment

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

This should probably be implemented instead of removed

Comment on lines -570 to -600
/// Returns protocol version encoded as a string (quotes are necessary).
///
/// Handler for ETH RPC call: `eth_protocolVersion`
pub fn protocol_version(&self) -> Result<u64> {
node_info!("eth_protocolVersion");
Ok(1)
}

/// Returns the number of hashes per second that the node is mining with.
///
/// Handler for ETH RPC call: `eth_hashrate`
pub fn hashrate(&self) -> Result<U256> {
node_info!("eth_hashrate");
Ok(U256::ZERO)
}

/// Returns the client coinbase address.
///
/// Handler for ETH RPC call: `eth_coinbase`
pub fn author(&self) -> Result<Address> {
node_info!("eth_coinbase");
Ok(self.backend.coinbase())
}

/// Returns true if client is actively mining new blocks.
///
/// Handler for ETH RPC call: `eth_mining`
pub fn is_mining(&self) -> Result<bool> {
node_info!("eth_mining");
Ok(self.is_mining)
}
Copy link
Member Author

Choose a reason for hiding this comment

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

these should likely be implemented, they are currently not

Comment on lines -325 to -327
// Helper function to set default chains
fn create_default_chains() -> HashMap<String, ChainData> {
let mut chains = HashMap::new();
Copy link
Member Author

@zerosnacks zerosnacks Jun 5, 2025

Choose a reason for hiding this comment

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

This is entirely unused / not wired up, I think these are leftover files from #10226

Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

can we do this incrementally,

reviewing a large cleanup like this isnt really feasible

@zerosnacks
Copy link
Member Author

closing, will do selectively changes as separate PRs in the future

@zerosnacks zerosnacks closed this Jun 30, 2025
@github-project-automation github-project-automation bot moved this to Done in Foundry Jun 30, 2025
@zerosnacks zerosnacks deleted the zerosnacks/remove-dead-code-2 branch August 4, 2025 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants