Skip to content

[contracts] fork tests rely on BNB_HTTP_URL which publicnode cannot fulfill — archive node required #269

@obchain

Description

@obchain

Refs #53

File: contracts/foundry.toml, [rpc_endpoints] section; contracts/test/CharonLiquidatorFork.t.sol

Problem:
foundry.toml maps the 'bnb' fork alias to ${BNB_HTTP_URL}. The repo documentation and PR #52 both reference publicnode (https://bsc-dataseed.publicnode.com) as the default RPC. publicnode is a full node, not an archive node. Fork tests that read historical state (vToken exchange rates, borrower balances at a pinned block) require archive-depth eth_call. publicnode returns 'missing trie node' for these calls.

This was confirmed in issue #229 raised during PR #52 review. PR #53 introduces a new consumer of the same BNB_HTTP_URL alias without resolving the underlying RPC requirement.

Impact:
CI environments using publicnode as BNB_HTTP_URL will see intermittent 'missing trie node' failures or silently incorrect state reads. The '4/4 pass' result in the PR description is only valid against the specific archive RPC the author used locally.

Fix:

  1. Add a CI README note (or .env.example comment) specifying that BNB_HTTP_URL must point to a BSC archive node. Recommended: QuickNode BSC archive, Alchemy BSC, or self-hosted.
  2. Add a test_fork_realContractsHaveCode-style guard that also checks block.number matches the pinned FORK_BLOCK, so mismatched RPC configuration fails loudly.
  3. Resolve issue [scanner] MempoolMonitor::run returns anyhow::Result on public library API — use thiserror #229 by documenting the archive requirement in README.md under the 'Running fork tests' section.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions