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

Fix: cross-chain Meta Evidence #52

Merged
merged 5 commits into from
Oct 20, 2021
Merged

Conversation

hbarcelos
Copy link
Contributor

The recent updates in ERC-1497 introduced new parameters to make dynamic scripts and evidence display interfaces less fragile, removing the need to hard-code JSON-RPC endpoints.

One particular edge case relates to cross-chain Meta Evidence, when the JSON file should contain a hard-coded arbitrableChainID to indicate which chain it belongs to. However this created a problem when calling Archon#arbitrable.getMetaEvidence() because the caller cannot know the value of arbitrableChainID beforehand in order to be able to inject the proper arbitrableJsonRpcUrl into the dynamic script.

To overcome that issue we are introducing a new option for Archon#arbitrable.getMetaEvidence() named getJsonRpcUrl, which is a callback in the form:

options.getJsonRpcUrl(chainId: number) => string

This new option will allow archon to obtain a JSON-RPC URL from arbitrableChainID after it downloads the original file so it can be injected into scriptParameters automatically.

This change is supposed to be non-breaking and should not change the current behavior when arbitrableChainID is not defined.

Managed to find a fix that was preventing webpack to build when v8-sandox package was prent. Look for webpack.ContextReplacementPlugin.
Copy link
Member

@0xferit 0xferit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good but couldn't we use shorthand notations? It looks like too much code.

What I mean is: A = A || B

@hbarcelos
Copy link
Contributor Author

Done.

@hbarcelos hbarcelos merged commit 577e520 into master Oct 20, 2021
@hbarcelos hbarcelos deleted the fix/cross-chain-metaevidence branch October 20, 2021 14:22
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