* CCQ: Fuzzing for parseAndVerifyQueryResponse
* CCQ: Fuzz signature checking and improve request body check
* CCQ: Use forge bounding & improve test coverage
If you don't do this, in the tests you have to do:
vm.expectRevert(bytes4(keccak256("UnsupportedQueryType()")));
Whereas with this change, you can simply import the contract and do:
vm.expectRevert(UnsupportedQueryType.selector);
Instead of the test contract inheriting directly from the QueryResponse
contract, it instantiates an instance of it and uses that for the
testing. This seems to work much nicer with the forge coverage tools.
With this commit, the coverage for QueryResponse shows 85.1% line
coverage, 100% function coverage, and 50% branch coverage.
By moving the structs out of the abstract contract, you can use them
directly in any contract that imports QueryResponse.sol *without*
requiring that contract to inherit from the QueryResponse contract. This
seems to work much better with forge's coverage tooling.
* refund address handling improvement
* fix compilation error
* Remove unnecessary line
* restrict to view
* fix comment
* Improve handling of gas limits
* get test to pass - check that the return data is appropriately long before decoding
* modification to checking inequality
* modification to checking inequality - use unchecked
* clean functions around - add untrustedBaseDeliveryPrice
* make quote_length_bytes a constant
* seperate pay into two overloads
* change inequality to equality for checking return data length
* renaming functions
* allow override of refund per gas unused
* test modification
* note
The hash preimages for storage calculations were wrong for two storage
slots. The updated preimages can be verified to be correct with e.g. the
`chisel` command line tool from the foundry suite.
* ethereum: Add Foundry tests written by RV
* ethereum: Add scripts and instructions to run proofs using KEVM
* ethereum: Fix typo on testSetup_after_setup_revert_KEVM
* ethereum: Edit Makefile to skip KEVM tests when running forge test
* ethereum: Fix commented-out lines in Foundry tests
* ethereum: Refactor GovernanceStructs invalid-size tests
* ethereum: Replace assume with bound in Foundry tests
Co-authored-by: Jeff Schroeder <jeffschroeder@computer.org>
* ethereum: Apply review suggestions to run-kevm script
Co-authored-by: Jeff Schroeder <jeffschroeder@computer.org>
* ethereum: explicit cast to uint8 for some vars
The bound() calls need to be explicitly cast to uint8 from the uint256
that forge-std's bound() returns.
* ethereum: updating some of the RV tests
The definitions don't compile with newer forge/solc.
* ethereum: Add assumption to test that guardian count > 0
Prevents an arithmetic over/underflow error in testCannotVerifySignaturesWithOutOfBoundsSignature, in the expression bound(outOfBoundsGuardian, 0, params.guardianCount - 1)
---------
Co-authored-by: Lucas MT <lucas.tabajara@runtimeverification.com>
Co-authored-by: Jeff Schroeder <jeffschroeder@computer.org>
* AutoRelayer: replay protection
* AutoRelayer: store block number on failure and success, use for replay protection and indexing
* AutoRelayer: add 'deliveryAttempted' view fn; clear failure mapping on success