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

API governance captures governed APIs at initial creation, doesn't notice upgrades #9990

Closed
Chris-Hibbert opened this issue Aug 28, 2024 · 0 comments · Fixed by #10822
Closed
Assignees
Labels
enhancement New feature or request Governance Governance

Comments

@Chris-Hibbert
Copy link
Contributor

What is the Problem Being Solved?

setupApiGovernance() is called with the current set of governed APIs when a contract is first created. If the contract updates the list on an upgrade, the API governor won't notice it.

Description of the Design

rather than

setupApiGovernance(governedApis, governedNames, timer, () => this.facets.helper.getUpdatedPoserFacet())

We should call

setupApiGovernance(getGovernedApis, getGovernedNames, timer, () =>
                  this.facets.helper.getUpdatedPoserFacet(),
                )

where getGovernedFoo() should be a function passed through that calls E(creatorFacet).getGovernedApis() or E(creatorFacet).getGovernedApiNames() later.

Security Considerations

superior robustness for upgrading contracts.

Scaling Considerations

No consequences.

Test Plan

A test that upgrades contracts.

@Chris-Hibbert Chris-Hibbert added enhancement New feature or request Governance Governance labels Aug 28, 2024
@Chris-Hibbert Chris-Hibbert self-assigned this Aug 28, 2024
@mergify mergify bot closed this as completed in #10822 Jan 22, 2025
mergify bot added a commit that referenced this issue Jan 22, 2025
closes: #9990

## Description

When a contract is upgraded, we'll read the governed APIs afresh.

### Security Considerations

Nothing special. The point of governed APIs is that contracts can make access to calling specific APIs legible in the sense used by governance.

### Scaling Considerations

Not an issue.

### Documentation Considerations

If we had detailed documentation on governance, this would be worth adding to the docs.

### Testing Considerations

Added a bootstrap test showing that a contract can be upgraded and the new APIs will be available after upgrade.

### Upgrade Considerations

AssetReserve, fluxAggregator, and VaultFactory use `apiGovernance` and might need this support if any governed APIs were added.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Governance Governance
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant