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

chore(rpc): use block_hash as BlockId on eth_callMany #11595

Merged
merged 4 commits into from
Oct 9, 2024
Merged

Conversation

joshieDo
Copy link
Collaborator

@joshieDo joshieDo commented Oct 9, 2024

similar to #11587

let target_block = block_number.unwrap_or_default();
let is_block_target_pending = target_block.is_pending();
let ((cfg, block_env, _), block) = futures::try_join!(
self.evm_env_at(target_block),
self.block_with_senders(target_block)
)?;

otherwise evm_env_at & block_with_senders will each one have its own view of what block_number is which might be different on a ill timed reorg

@joshieDo joshieDo added the A-rpc Related to the RPC implementation label Oct 9, 2024
@joshieDo joshieDo added the C-bug An unexpected or incorrect behavior label Oct 9, 2024
Comment on lines 250 to 255
let block_number = block_number.unwrap_or_default();
let target_block: BlockId = LoadBlock::provider(self)
.block_hash_for_id(block_number)
.map_err(|_| EthApiError::HeaderNotFound(block_number))?
.ok_or_else(|| EthApiError::HeaderNotFound(block_number))?
.into();
Copy link
Collaborator

Choose a reason for hiding this comment

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

this does not really work for the pending block.

so we can only do this if this is not pending

@joshieDo joshieDo requested a review from mattsse October 9, 2024 13:41
@mattsse mattsse added this pull request to the merge queue Oct 9, 2024
Merged via the queue into main with commit 7c818c1 Oct 9, 2024
37 checks passed
@mattsse mattsse deleted the joshie/callmany branch October 9, 2024 15:45
vandenbogart pushed a commit to testmachine-ai/reth that referenced this pull request Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rpc Related to the RPC implementation C-bug An unexpected or incorrect behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants