Skip to content

feat: oracle bridge upgrade on admin networks #4817

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Reinis-FRP
Copy link
Contributor

Motivation

The Oracle bridge contract upgrade from #4816 should be rolled out also to admin controlled networks.

Summary

Updates contract deployment address and scripts for generating and verifying multisig payload for upgrading Oracle bridging contracts on admin controlled networks.

Testing

Check a box to describe how you tested these changes and list the steps for reviewers to test.

  • Ran end-to-end test, running the code as in production
  • New unit tests created
  • Existing tests adequate, no new tests required
  • All existing tests pass
  • Untested

Issue(s)

Fixes #XXXX

},
"devDependencies": {
"ts-node": "^10.9.2",
"typescript": "^5.8.3"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@safe-global/types-kit was not compatible with older typescipt from the root of the workspace.

(e) =>
e.returnValues.calls ===
[{ to: contractsByNetId[network.chainId].registry.options.address, data: registerContractData }]
const relayedRegisterContractEvent = relayedTransactions.find((e) =>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The newer typescript version errored to build this as it does not allow comparison of object references

data: BytesLike;
}[] = [];
const changeImplementationAddressTx = await finder.populateTransaction.changeImplementationAddress(
ethersUtils.formatBytes32String("Oracle"),
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: use interfaceName.Oracle from

const { interfaceName } = require("@uma/common");

Copy link
Contributor Author

Choose a reason for hiding this comment

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

totally forgot we had it, will fix

Copy link
Contributor

@md0x md0x left a comment

Choose a reason for hiding this comment

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

LGTM!

Signed-off-by: Reinis Martinsons <[email protected]>
Signed-off-by: Reinis Martinsons <[email protected]>
@mrice32 mrice32 requested a review from Copilot April 22, 2025 20:14
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR upgrades the Oracle bridge contract for admin networks by updating deployment addresses, multisig payload generation, and verification scripts. It updates relevant scripts to use the shared interfaceName for Oracle references, adds new admin proposal payload and verification scripts, and introduces a type generation tool.

Reviewed Changes

Copilot reviewed 9 out of 15 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/scripts/src/utils/gnosisPayload.ts Adds functions to build and simulate safe payloads for multisig execution
packages/scripts/src/admin-proposals/upgrade-oo-request-bridging/*.ts Updates contract address calls to use interfaceName.Oracle and adjusts payload logic
packages/scripts/src/admin-proposals/upgrade-oo-request-bridging-admin/*.ts Adds new scripts for payload generation and verification on admin chains
packages/scripts/src/admin-proposals/registerContract.js Uses deep equality (isEqual) for event comparison in contract registration
packages/scripts/generate-types.ts Introduces a script to generate ethers-v5 typechain files
Files not reviewed (6)
  • packages/core/networks/100.json: Language not supported
  • packages/core/networks/1116.json: Language not supported
  • packages/core/networks/1514.json: Language not supported
  • packages/core/networks/43114.json: Language not supported
  • packages/scripts/.gitignore: Language not supported
  • packages/scripts/package.json: Language not supported
Comments suppressed due to low confidence (2)

packages/scripts/src/utils/gnosisPayload.ts:231

  • Consider adding unit tests for the safe payload simulation functions (simulateSafePayload, approveTransaction, executeTransaction) to cover error scenarios and edge cases.
export async function simulateSafePayload(provider: JsonRpcProvider, payload: GnosisPayload, version: SafeVersion): Promise<void> {

packages/scripts/src/admin-proposals/registerContract.js:429

  • [nitpick] The deep equality check using 'isEqual' assumes a consistent order of calls in the event data. Consider adding a comment or adjusting the logic to handle potential changes in ordering.
isEqual(e.returnValues.calls, [ { to: contractsByNetId[network.chainId].registry.options.address, data: registerContractData } ])

for (const owner of owners.slice(0, threshold)) {
const signer = await getImpersonatedSigner(provider, owner, 1);

process.stdout.write(`Approving transaction from ${owner}...`);
Copy link
Preview

Copilot AI Apr 22, 2025

Choose a reason for hiding this comment

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

[nitpick] Using process.stdout for logging may lead to issues in non-interactive environments; consider using an environment-agnostic logging framework instead.

Copilot uses AI. Check for mistakes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the script is expected to be run only interactively, so it should be fine to use process.stdout

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