Reconcile addresses with mismatched casings #748
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The problem raised by issue #745 is that currently ignition will fail to reconcile the address param
0xaaa...
if it has been changed to0xAaa...
or, more specifically, if the case of the new address doesn't perfectly match the previously executed address.This makes sense as a bug to fix, but there is a bit of a design decision to be made around what solution we decide on. The solution I opted for, and what is currently in this PR, is the following logic:
0xaaa...
+0xAAA...
reconciles ✅0xaaa...
+0xAaa...
does not reconcile ❌The reason for this choice is because it follows the same rules that ethers uses for their checksum and address-checking code.
An alternative approach would be to cast every address to lowercase before checking equality, which would allow for the second case above to reconcile successfully, but we would be bypassing what (admittedly few) protections are in place for checksummed addresses.
In this PR, I included two tests to demonstrate the above cases, but I'll add them to the rest of the reconciliation tests after we decide on a direction for this logic.
Edit:
Leaving the above for posterity's sake, but we are moving forward with this strategy.
One additional thing this PR does is adds
examples/sample
to thepnpm-workspace.yaml
file for better local testing and debugging of things.resolves #745