Filecoin chains will occasionally produce null rounds. Ethers' transaction monitoring cannot handle skipped block heights. It will try to request intermediate blocks that don't exist. Lotus returns a JSON-RPC error when calling eth_getBlock* with a height corresponding to a null round. Ethers reacts with an exception, and this aborts the deployment process.
To overcome this situation, we inject a custom provider that catches this specific error, and returns an artificial empty block instead of an error. With this, hardhat-ethers can now cope with null rounds.
Major refactors and cleanups for easier maintenance
Adopted the hardhat-deploy plugin, which keeps track of deployments for us.
Removed hand-rolled deployment tracking and codegen. We no longer codegen scripts; any script can resolve any contract now.
All the mess under ops/deploy*.sh is now gone.
Refactored all Hardhat tasks, simplified aggressively, deduplicated code, deleted dead code, and removed tons of cruft.
Adopted Typescript typing.
Upgrade scripts are also massively overhauled for simplicity.
LoC delta: around -1000.
TODO
[ ] Update docs.
Next steps
[ ] Move to Hardhat Ignition. We should be able to get transaction deployment parallelism, but it requires bumping Hardhat and Ethers versions, which should be much simpler to do now than it was before.
Tolerating null rounds
Filecoin chains will occasionally produce null rounds. Ethers' transaction monitoring cannot handle skipped block heights. It will try to request intermediate blocks that don't exist. Lotus returns a JSON-RPC error when calling eth_getBlock* with a height corresponding to a null round. Ethers reacts with an exception, and this aborts the deployment process.
To overcome this situation, we inject a custom provider that catches this specific error, and returns an artificial empty block instead of an error. With this, hardhat-ethers can now cope with null rounds.
Major refactors and cleanups for easier maintenance
TODO
Next steps