Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: added chain IDs to injected parameters #50

Merged
merged 3 commits into from
Oct 4, 2021

Conversation

hbarcelos
Copy link
Contributor

@hbarcelos hbarcelos commented Sep 22, 2021

Changes

  • Added treatment to arbitrableChainID and arbitratorChainID parameters
  • Added sandbox for non-browser environments through v8-sandbox
  • Added tests for injected parameters

Notice

The changes here are supposed to be backwards compatible, so it will be released as a minor version.

New functionality

As recently discussed on the ERC-1497 original issue, we need some new functionality on @kleros/archon.

The updated proposal introduces, among other things, 2 new fields for the MetaEvidence JSON file:

  • arbitrableChainID
  • arbitratorChainID

Those fields are important to enable multi-chain MetaEvidence and are crucial in a cross-chain arbitration flow. Furthermore, they prevent issues when using deterministic contract addresses (CREATE2), which could cause a MetaEvidence for a specific chain being considered valid for a different one.

Such parameters can also be injected as scriptParameters when calling archon.arbitrable.getMetaEvidence(), which will be used when the parameters above are not set in the JSON file. However the primary source of truth is still the values declared in the MetaEvidence JSON.

The following table summarizes the behavior when both fields above are present (✅) or absent (❌) in the JSON file and the scriptParameters option:

arbitrableChainID arbitratorChainID
JSON params JSON params Description
Invalid if any of the params is different from the values in JSON
Invalid if arbitrableChainID param is different from the value in JSON
Invalid if arbitrableChainID param is different from the value in JSON
Invalid if arbitrableChainID param is different from the value in JSON
Invalid if arbitratorChainID param is different from the value in JSON
Always valid
Always valid
Always valid
Invalid if arbitratorChainID param is different from the value in JSON
Always valid
Always valid
Always valid
arbitrableChainID assumes the same value as arbitratorChainID; invalid if arbitratorChainID param is different from the value in JSON
arbitrableChainID assumes the same value as arbitratorChainID; Always valid
arbitrableChainID assumes the same value as arbitratorChainID; Always valid
Always valid

Validation now encompass more than just hashes, but also chain ID in case of MetaEvidence. The new name of the parameter better reflects that.

`strictHashes` will still be kept due to compatibility issues, but it is now an alias to `strict`.
@hbarcelos hbarcelos merged commit c80a266 into master Oct 4, 2021
@hbarcelos hbarcelos deleted the feat/inject-chain-ids branch October 4, 2021 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants