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

refactor: access module #53

Merged
merged 8 commits into from
Nov 7, 2024
Merged

Conversation

xorsal
Copy link
Contributor

@xorsal xorsal commented Nov 6, 2024

🤖 Linear

Closes OPT-514

solidity/interfaces/IAccessController.sol Show resolved Hide resolved
solidity/contracts/OracleAccessController.sol Outdated Show resolved Hide resolved
solidity/contracts/CommonAccessController.sol Outdated Show resolved Hide resolved
solidity/contracts/CommonAccessController.sol Outdated Show resolved Hide resolved
solidity/contracts/CommonAccessController.sol Show resolved Hide resolved
Comment on lines 353 to 356
IDisputeModule(_request.disputeModule).finalizeRequest(_request, _response, _accessControl.user);
IResponseModule(_request.responseModule).finalizeRequest(_request, _response, _accessControl.user);
IRequestModule(_request.requestModule).finalizeRequest(_request, _response, _accessControl.user);
IAccessModule(_request.accessModule).finalizeRequest(_request, _response, _accessControl.user);
Copy link
Member

Choose a reason for hiding this comment

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

I think there should be a zero address check at least for the access module here. I guess the others don't have it because they are expected to always exist.

Also, shouldn't it be set as an allowedModule at the time of creating a request, as happens with any other module?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There was a discussion about this with Shaito over voice. I don't recall the specific argument, but we decided not to include it in the allowed module list/mapping.

One argument could be that allowedModules is used by modules to determine whether one module calling another is allowed (i.e. set during the request creation) by the Oracle.
An access module, although is not restricted, shouldn't be making external calls to other modules, therefore no other module should need to check whether the module is authorized.

we can move the discussion to this PR's base

Copy link
Member

@0xJabberwock 0xJabberwock Nov 7, 2024

Choose a reason for hiding this comment

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

Even though there's no immediate use case in the context of Prophet, other protocols or external agents may be served with the possibility of asserting on-chain whether an access module is allowed for a particular oracle request—this is why I think it would increase composability.

Copy link

linear bot commented Nov 7, 2024

@ashitakah ashitakah merged commit 2b68ec0 into feat/access-controller Nov 7, 2024
5 checks passed
@ashitakah ashitakah deleted the feat/access-module branch November 7, 2024 18:31
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.

3 participants