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

Disputable: Implement disputable base app #581

Merged
merged 14 commits into from
Jun 26, 2020
Merged

Conversation

facuspagnuolo
Copy link
Contributor

@facuspagnuolo facuspagnuolo commented May 31, 2020

image

@facuspagnuolo facuspagnuolo self-assigned this May 31, 2020
@auto-assign auto-assign bot requested a review from izqui May 31, 2020 21:02
@sohkai sohkai added this to the aragonOS 5.0 milestone Jun 4, 2020
Copy link
Contributor

@sohkai sohkai left a comment

Choose a reason for hiding this comment

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

Pretty small notes and nothing major!

The only things I wasn't sure about were:

  • Being able to unset the Agreement
  • Always being a forwarder
  • Some interface structuring / documentation

contracts/apps/disputable/DisputableApp.sol Outdated Show resolved Hide resolved
contracts/apps/disputable/DisputableApp.sol Outdated Show resolved Hide resolved
contracts/apps/disputable/DisputableApp.sol Outdated Show resolved Hide resolved
contracts/apps/disputable/DisputableApp.sol Outdated Show resolved Hide resolved
contracts/apps/disputable/DisputableApp.sol Outdated Show resolved Hide resolved
contracts/apps/disputable/DisputableApp.sol Outdated Show resolved Hide resolved
contracts/apps/disputable/IArbitrable.sol Outdated Show resolved Hide resolved
contracts/apps/disputable/IDisputable.sol Show resolved Hide resolved
contracts/lib/arbitration/IArbitrable.sol Show resolved Hide resolved
@facuspagnuolo
Copy link
Contributor Author

@sohkai thanks again for the review! I addressed almost all your comments, let me know your thoughts!

@coveralls
Copy link

coveralls commented Jun 4, 2020

Coverage Status

Coverage increased (+0.03%) to 99.148% when pulling 6f622c4 on add_disputable_base_app into 8d40fea on next.

@@ -10,14 +10,20 @@ contract('Arbitrable', () => {
describe('supportsInterface', () => {
it('supports ERC165', async () => {
assert.isTrue(await arbitrable.supportsInterface('0x01ffc9a7'), 'does not support ERC165')

assert.equal(await arbitrable.ERC165_INTERFACE(), '0x01ffc9a7', 'ERC165 interface ID does not match')
assert.equal(await arbitrable.erc165interfaceID(), await arbitrable.ERC165_INTERFACE(), 'ERC165 interface ID does not match')
Copy link
Contributor

@sohkai sohkai Jun 5, 2020

Choose a reason for hiding this comment

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

On the interface, I like having these tests, but was mostly curious as to how we came up with our own magic numbers for IDisputable.

Are we doing the sanity check via https://github.com/aragon/aragonOS/pull/581/files#diff-a4bee50cd93746db86bb3d3cef7232ebR26-R32? Again, just wondering if there's an automated tool to generate these based on an interface's ABI, so we literally can't miss it if we ever change something.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

On the interface, I like having these tests, but was mostly curious as to how we came up with our own magic numbers for IDisputable.

It wasn't magic haha, I computed them manually before writing the tests

Are we doing the sanity check via https://github.com/aragon/aragonOS/pull/581/files#diff-a4bee50cd93746db86bb3d3cef7232ebR26-R32? Again, just wondering if there's an automated tool to generate these based on an interface's ABI, so we literally can't miss it if we ever change something.

The link is not working for me, although I see your point. I haven't found any tool to compute interface IDs for ERC165, we could probably write a tool to have this but we will need to force a weird interface inheritance in the contracts (or make sure we don't inherit at all) to make sure the IDs are computed correctly. Specially thinking about IArbitrable and IDisputable that inherit from ERC165, which makes me think we will definitely moving the potential error to another place instead of solving it.

Copy link
Contributor

Choose a reason for hiding this comment

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

we will need to force a weird interface inheritance in the contracts

Hmm interesting, can the EIP165 interface differ from being the XOR of all external function selectors in a given interface (e.g. IDisputable's)? If so, could we take the ABI to automatically generate the selector in tests, to make sure ours match?

For example, I would've expected our IDisputable interface identifier to change since we now have more exposed methods.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would've expected our IDisputable interface identifier to change since we now have more exposed methods.

It does indeed, that's the con, we are not automatically generating it. I need to update it :/

we will need to force a weird interface inheritance in the contracts

What I meant here is that in order to build an automatic tool, it is not possible to distinguish between the methods coming from inherited contracts, and that's the case for IDisputable and IAgreement. Both carry their parent's methods, and it is not possible to identify them from the compilation output, we could use the AST tho but it will take a bit more of time :)

Copy link
Contributor

Choose a reason for hiding this comment

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

it is not possible to distinguish between the methods coming from inherited contracts, and that's the case for IDisputable and IAgreement

Gotcha. This kind of begs another question: does EIP-165 say anything about this case? In theory, if your interface inherits from another interface, you should consider this new interface as the combination of the whole, not just the new parts.

Copy link
Contributor

@sohkai sohkai left a comment

Choose a reason for hiding this comment

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

Added a couple more comments and replied to a few.

In case those get lost, they're at:

Copy link
Contributor

@bingen bingen left a comment

Choose a reason for hiding this comment

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

LGTM!

contracts/apps/disputable/DisputableAragonApp.sol Outdated Show resolved Hide resolved
contracts/lib/arbitration/IArbitrable.sol Show resolved Hide resolved
Copy link
Contributor

@sohkai sohkai left a comment

Choose a reason for hiding this comment

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

@facuspagnuolo
Copy link
Contributor Author

Thanks @sohkai! Let me know your thoughts about the last tweaks!

Copy link
Contributor

@sohkai sohkai left a comment

Choose a reason for hiding this comment

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

A couple of notes from looking at Agreements and its IAgreement interface.

contracts/apps/disputable/IAgreement.sol Outdated Show resolved Hide resolved
contracts/apps/disputable/IAgreement.sol Outdated Show resolved Hide resolved
contracts/apps/disputable/IAgreement.sol Outdated Show resolved Hide resolved
contracts/apps/disputable/IAgreement.sol Outdated Show resolved Hide resolved
contracts/apps/disputable/IAgreement.sol Outdated Show resolved Hide resolved
contracts/apps/disputable/IAgreement.sol Outdated Show resolved Hide resolved
contracts/apps/disputable/IAgreement.sol Outdated Show resolved Hide resolved
contracts/apps/disputable/IAgreement.sol Show resolved Hide resolved
contracts/apps/disputable/IAgreement.sol Show resolved Hide resolved
@facuspagnuolo
Copy link
Contributor Author

Thanks once again @sohkai, addressed/answered all your comments, let me know your thoughts!

Copy link
Contributor

@sohkai sohkai left a comment

Choose a reason for hiding this comment

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

Looking good and as with the others, just pushed a few cosmetic commits.

I have a couple last notes on the interfaces; let me know what your thoughts are!

(Also left a comment above, in case it gets lost: #581 (comment))

contracts/apps/disputable/IDisputable.sol Outdated Show resolved Hide resolved
contracts/apps/disputable/DisputableAragonApp.sol Outdated Show resolved Hide resolved
contracts/apps/disputable/IAgreement.sol Outdated Show resolved Hide resolved
contracts/lib/arbitration/IArbitrator.sol Show resolved Hide resolved
contracts/lib/arbitration/IArbitrable.sol Show resolved Hide resolved
contracts/apps/disputable/IAgreement.sol Show resolved Hide resolved
contracts/apps/disputable/IAgreement.sol Outdated Show resolved Hide resolved
contracts/apps/disputable/IAgreement.sol Outdated Show resolved Hide resolved
@facuspagnuolo
Copy link
Contributor Author

@sohkai addressed and answered all your comments! Let me know your thoughts

Copy link
Contributor

@sohkai sohkai left a comment

Choose a reason for hiding this comment

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

Finally, I think this has crossed the finish line 🛣 🏁 🏎 🎊

package.json Outdated Show resolved Hide resolved
@facuspagnuolo facuspagnuolo merged commit 7d53d16 into next Jun 26, 2020
@facuspagnuolo facuspagnuolo deleted the add_disputable_base_app branch June 26, 2020 14:56
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.

4 participants