The underlying problem here is this: if Hardhat/EDR doesn't have a hardfork history for a given chain id, then "historical" calls will fail. This was a compromise we decided to make when we added hardfork histories. What we didn't foresee is that making a call immediately after forking is executed as a historical call, because the call is run in the forked block, which is not considered local. This means that if you fork a chain whose history is not in the default config and you immediately make a call, then you'll get an error.
It's unclear what's the right fix here. Two ideas:
Use the local hardfork for calls executed in the forked block. The forked block is already a weird block (e.g., it has an irregular state transition that changes the balances of the default accounts), so adding a little more weirdness seems like a fine compromise.
Have a safe default hardfork for unknown chain ids (maybe printing a warning).
PR https://github.com/NomicFoundation/hardhat/pull/5394 adds some naive hardfork histories for optimism/arbitrum chains, where the same (conservative) hardfork is used for all blocks.
The underlying problem here is this: if Hardhat/EDR doesn't have a hardfork history for a given chain id, then "historical" calls will fail. This was a compromise we decided to make when we added hardfork histories. What we didn't foresee is that making a call immediately after forking is executed as a historical call, because the call is run in the forked block, which is not considered local. This means that if you fork a chain whose history is not in the default config and you immediately make a call, then you'll get an error.
It's unclear what's the right fix here. Two ideas:
Notice that we can do both too.