-
Notifications
You must be signed in to change notification settings - Fork 50
University redeploy #2138
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
University redeploy #2138
Conversation
✅ Deploy Preview for kleros-v2-testnet ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
❌ Deploy Preview for kleros-v2-university failed. Why did it fail? →
|
✅ Deploy Preview for kleros-v2-neo ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
WalkthroughRenames “Devnet” to “V2 Devnet (unstable)”, updates Arbitrum Sepolia University deployment addresses, adds DisputeTemplateRegistryUniversity (UUPS proxy + impl), upgrades University variants of DisputeKitClassic, KlerosCore, SortitionModule, and DisputeResolver (ABI and governance changes), expands proxy suite, and adjusts deploy/test wiring and utilities. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Deployer
participant Chain
participant DTRProxy as DisputeTemplateRegistryUniversity Proxy
participant DTRImpl as DisputeTemplateRegistryUniversity Impl
rect rgb(240,248,255)
note right of Deployer: University deploy sequence (high-level)
Deployer->>Chain: deploy DTR Implementation
Deployer->>Chain: deploy DTR Proxy(implementation, initData)
Chain-->>DTRProxy: Proxy constructed
DTRProxy->>DTRImpl: delegatecall initialize(owner)
DTRImpl-->>DTRProxy: initialization complete
Deployer->>Chain: continue with DisputeKit/Core/Sortition deployments using DTR address
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal). Please share your feedback with us on this Discord post. Comment |
❌ Deploy Preview for kleros-v2-testnet-devtools failed. Why did it fail? →
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
contracts/deployments/arbitrumSepoliaDevnet/SortitionModuleUniversity.json (1)
236-244
: ABI surface changed — update callers, indexers, tests and deployment ABIs
- Offchain & frontend: update draw callsites to the new return shape (destructure tuple / handle extra return values) — e.g. web/src/pages/Cases/CaseDetails/MaintenanceButtons/DrawButton.tsx (draw call).
- Keeper / scripts: fix core.draw usage/staticCall (keeperBot: contracts/scripts/keeperBot.ts casts staticCall to bigint — adjust to actual return).
- Tests: update expectations for StakeSet and draw across contracts/test/arbitration/* and contracts/test/sortition/* (withArgs / destructuring as needed).
- Subgraphs / indexers: update mappings and generated types in subgraph/core/src/SortitionModule.ts and subgraph/core-university/src/SortitionModule.ts, update tests (subgraph/core/tests/*), and run codegen after ABI changes (handle extended StakeSet params and add LeftoverPNK handler if present).
- Deployments / ABIs: update contracts/deployments/* (devnet/testnet/mainnet/arbitrumSepoliaDevnet...) where StakeSet and related ABI entries are defined.
- governor() migration: ripgrep found no TS/JS uses, but the search did not run over .sol files — scan Solidity sources for governor() and migrate to owner() for university deployments.
contracts/deploy/00-home-chain-arbitration-university.ts (1)
92-97
: Use DisputeTemplateRegistryUniversity heregetContractOrDeployUpgradable currently requests "DisputeTemplateRegistry" — change to "DisputeTemplateRegistryUniversity" so the resolver wires to the university registry.
File: contracts/deploy/00-home-chain-arbitration-university.ts (lines 92–97)
- const disputeTemplateRegistry = await getContractOrDeployUpgradable(hre, "DisputeTemplateRegistry", { + const disputeTemplateRegistry = await getContractOrDeployUpgradable(hre, "DisputeTemplateRegistryUniversity", { from: deployer, args: [deployer], log: true, });
🧹 Nitpick comments (7)
contracts/README.md (1)
77-110
: Addresses update looks good; add provenance details for opsConsider appending deployment tx hashes and block numbers next to each new address to ease verification and rollbacks.
contracts/test/integration/getContractsViem.test.ts (1)
214-216
: Minor: clarify DEVNET path for “university” verification.Add a brief comment explaining why university uses NETWORKS.DEVNET (artifacts live under arbitrumSepoliaDevnet) to avoid confusion.
- await verifyDeployedAddresses(contracts, NETWORKS.DEVNET, universityContractMapping); + // University artifacts are stored under arbitrumSepoliaDevnet. + await verifyDeployedAddresses(contracts, NETWORKS.DEVNET, universityContractMapping);contracts/scripts/utils/contracts.ts (1)
54-55
: University mapping LGTM.Correctly points to DisputeTemplateRegistryUniversity for university deployments.
Consider allowing getContractsFromNetwork/getContractNamesFromNetwork to accept an optional core override (env var or param) to support university without hardcoding network names.
contracts/deployments/arbitrumSepoliaDevnet/KlerosCoreUniversity.json (2)
292-299
: ABI change: _courtID/_parent now uint96 — update clients/subgraphsCourtCreated now emits uint96 for IDs. Update any decoding schemas/types that assumed uint256.
1533-1561
: ABI change: Round tuple expanded
getRoundInfo
now includesdrawnJurorFromCourtIDs (uint96[])
and a__gap
field. Regenerate typings and adjust tuple decoding.contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassicUniversity.json (2)
812-822
: Nit: getDegreeOfCoherencePenalty output nameThe output is named
pnkCoherence
while the function denotes a penalty. Consider renaming in source for clarity in future builds (no on-chain impact).
1070-1097
: Nit: hashVote’s third parameter is unnamed in ABIConsider naming the string parameter (e.g.,
_saltedJustification
) in source to improve autogenerated client typings.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (19)
contracts/README.md
(2 hunks)contracts/deploy/00-home-chain-arbitration-university.ts
(1 hunks)contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassicUniversity.json
(19 hunks)contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassicUniversity_Proxy.json
(3 hunks)contracts/deployments/arbitrumSepoliaDevnet/DisputeResolverUniversity.json
(10 hunks)contracts/deployments/arbitrumSepoliaDevnet/DisputeTemplateRegistryUniversity.json
(1 hunks)contracts/deployments/arbitrumSepoliaDevnet/DisputeTemplateRegistryUniversity_Implementation.json
(1 hunks)contracts/deployments/arbitrumSepoliaDevnet/DisputeTemplateRegistryUniversity_Proxy.json
(1 hunks)contracts/deployments/arbitrumSepoliaDevnet/KlerosCoreUniversity.json
(18 hunks)contracts/deployments/arbitrumSepoliaDevnet/KlerosCoreUniversity_Proxy.json
(2 hunks)contracts/deployments/arbitrumSepoliaDevnet/SortitionModuleUniversity.json
(13 hunks)contracts/deployments/arbitrumSepoliaDevnet/SortitionModuleUniversity_Proxy.json
(2 hunks)contracts/deployments/contractsEthers.ts
(2 hunks)contracts/deployments/contractsViem.ts
(2 hunks)contracts/scripts/utils/contracts.ts
(2 hunks)contracts/scripts/utils/execution.ts
(2 hunks)contracts/src/proxy/KlerosProxies.sol
(1 hunks)contracts/test/integration/getContractsEthers.test.ts
(1 hunks)contracts/test/integration/getContractsViem.test.ts
(1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2025-09-04T23:36:16.415Z
Learnt from: jaybuidl
PR: kleros/kleros-v2#2126
File: contracts/src/arbitration/KlerosCore.sol:472-489
Timestamp: 2025-09-04T23:36:16.415Z
Learning: In this repo, KlerosCore emits AcceptedFeeToken and NewCurrencyRate events that are declared in contracts/src/arbitration/interfaces/IArbitratorV2.sol; implementations don’t need to redeclare these events.
Applied to files:
contracts/deployments/arbitrumSepoliaDevnet/DisputeResolverUniversity.json
contracts/deployments/arbitrumSepoliaDevnet/KlerosCoreUniversity.json
📚 Learning: 2025-01-22T00:55:35.842Z
Learnt from: jaybuidl
PR: kleros/kleros-v2#1805
File: contracts/src/proxy/UUPSProxiable.sol:127-129
Timestamp: 2025-01-22T00:55:35.842Z
Learning: In Solidity, a public state variable automatically implements a corresponding external view function with the same name. For example, `string public constant override version = "0.8.0"` implements the abstract `function version() external view returns (string memory)`.
Applied to files:
contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassicUniversity.json
contracts/deployments/arbitrumSepoliaDevnet/KlerosCoreUniversity.json
📚 Learning: 2024-11-19T16:31:08.965Z
Learnt from: jaybuidl
PR: kleros/kleros-v2#1746
File: contracts/config/courts.v2.mainnet-neo.json:167-170
Timestamp: 2024-11-19T16:31:08.965Z
Learning: In `contracts/config/courts.v2.mainnet-neo.json`, the `minStake` parameter is denominated in PNK, not ETH.
Applied to files:
contracts/deployments/arbitrumSepoliaDevnet/SortitionModuleUniversity.json
🧬 Code graph analysis (1)
contracts/deploy/00-home-chain-arbitration-university.ts (2)
contracts/deploy/utils/deployUpgradable.ts (1)
deployUpgradable
(37-89)contracts/deployments/utils.ts (1)
deployments
(3-16)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (15)
- GitHub Check: Redirect rules - kleros-v2-neo
- GitHub Check: Header rules - kleros-v2-neo
- GitHub Check: Redirect rules - kleros-v2-university
- GitHub Check: Redirect rules - kleros-v2-testnet
- GitHub Check: Pages changed - kleros-v2-neo
- GitHub Check: Redirect rules - kleros-v2-testnet
- GitHub Check: Header rules - kleros-v2-university
- GitHub Check: Header rules - kleros-v2-testnet
- GitHub Check: Header rules - kleros-v2-testnet
- GitHub Check: Pages changed - kleros-v2-university
- GitHub Check: Pages changed - kleros-v2-testnet
- GitHub Check: Pages changed - kleros-v2-testnet
- GitHub Check: Analyze (javascript)
- GitHub Check: SonarCloud
- GitHub Check: hardhat-tests
🔇 Additional comments (17)
contracts/deployments/arbitrumSepoliaDevnet/SortitionModuleUniversity_Proxy.json (1)
2-67
: Proxy artifact refresh acknowledgedProxy address, tx hash, and metadata updated; matches README. No issues.
contracts/deployments/contractsViem.ts (1)
22-24
: Switch to DisputeTemplateRegistryUniversity config is correctUniversity mapping now points to the university-specific DTR config. LGTM.
Also applies to: 170-177
contracts/deployments/contractsEthers.ts (1)
21-23
: University DTR wiring updatedUsing devnetDtrUniversityConfig for university deployments is consistent with artifacts and tests.
Also applies to: 206-213
contracts/test/integration/getContractsEthers.test.ts (1)
89-90
: Test mapping aligned with university artifact nameSwitching to "DisputeTemplateRegistryUniversity" ensures address lookup matches deployments.
contracts/src/proxy/KlerosProxies.sol (1)
34-36
: New DisputeTemplateRegistryUniversityProxy addedConsistent with UUPSProxy pattern and deployment artifacts. No issues.
contracts/test/integration/getContractsViem.test.ts (1)
69-69
: Approve — DisputeTemplateRegistryUniversity rename is correct. Artifact exists at contracts/deployments/arbitrumSepoliaDevnet/DisputeTemplateRegistryUniversity.json and is referenced in deployments and tests (address present in contracts/deployments/arbitrumSepoliaDevnet.ts).contracts/deploy/00-home-chain-arbitration-university.ts (1)
39-39
: Initializer args: double-check WETH reference.
- contracts/deploy/00-home-chain-arbitration-university.ts:39 — verify deployERC20AndFaucet returns an object with a .target (address) and that DisputeKitClassic.initialize(owner, zeroAddr, weth, 1) expects the weth address; if it expects an address, pass weth.target (or weth.address) instead of the contract instance.
contracts/scripts/utils/contracts.ts (1)
44-45
: BASE mapping LGTM.Keeps BASE behavior unchanged for the dispute template registry.
contracts/deployments/arbitrumSepoliaDevnet/DisputeTemplateRegistryUniversity_Implementation.json (1)
1-446
: Approve — UUPS implementation artifact looks correct; implementation address only referenced in deployments/docsABI, storage layout and events align. Repo search shows the implementation address 0xC3f638389635bF33E019c845FdaF2ed9bca3DF67 appears only in deployment artifacts and README (no occurrences in application/runtime code outside deployments).
Affected files:
- contracts/deployments/arbitrumSepoliaDevnet/DisputeTemplateRegistryUniversity_Implementation.json
- contracts/deployments/arbitrumSepoliaDevnet/DisputeTemplateRegistryUniversity.json
- contracts/deployments/arbitrumSepoliaDevnet/DisputeTemplateRegistryUniversity_Proxy.json
- contracts/deployments/arbitrumSepoliaDevnet.ts
- contracts/deployments/devnet.viem.ts
- contracts/README.md
contracts/deployments/arbitrumSepoliaDevnet/DisputeTemplateRegistryUniversity_Proxy.json (1)
1-81
: Proxy wiring LGTM — verifiedConstructor args point to the implementation; initializer selector matches initialize(address) (0xc4d66de8). diff failed in the sandbox (/dev/fd unavailable) but both addresses printed identically.
contracts/deployments/arbitrumSepoliaDevnet/DisputeTemplateRegistryUniversity.json (1)
296-303
: LGTM: proxy wired to implementation and initialized with ownerProxy address, implementation, and initializer args look consistent. No issues spotted here.
contracts/deployments/arbitrumSepoliaDevnet/KlerosCoreUniversity_Proxy.json (1)
101-109
: Confirm client compatibility with new compiler/bytecode settingsThis proxy was rebuilt with Solidity 0.8.30 (viaIR, cancun). Ensure ABIs in downstream clients/subgraphs are regenerated against these artifacts to avoid decoder drift.
contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassicUniversity_Proxy.json (1)
58-61
: Incorrect — DK initializer does not set core to 0x0Constructor calldata (contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassicUniversity_Proxy.json, args[1])'s first 32‑byte argument is 0x000000000000000000000000f1C7c037891525E360C59f708739aC09A7670c59 (address 0xf1C7c037891525E360C59f708739aC09A7670c59), not 0x0.
Likely an incorrect or invalid review comment.
contracts/deployments/arbitrumSepoliaDevnet/KlerosCoreUniversity.json (2)
1966-1974
: Sanity-check initializer wiring (DK, prosecution module, owner/instructor)Initializer embeds:
- owner = 0xF1C7...c59
- instructor = 0xF1C7...c59
- jurorProsecutionModule = 0x000...000
- disputeKit = 0x82F208...92F91 (DK Classic Univ)
Please confirm the prosecution module is intentionally unset (0x0). If not, plan a
changeJurorProsecutionModule(address)
call.
1387-1391
: Function rename: executeOwnerProposalDownstream code invoking
executeGovernorProposal
must be updated toexecuteOwnerProposal
.contracts/deployments/arbitrumSepoliaDevnet/DisputeResolverUniversity.json (1)
302-302
: Good: Arbitrator wired to Core proxy
_arbitrator
= 0xA34dBBD0E5e1d09bd683455f9dbC393797BC558f matches the Core proxy. Looks correct.contracts/deployments/arbitrumSepoliaDevnet/DisputeKitClassicUniversity.json (1)
1360-1366
: Reconfirm initializer constants (core=0x0, wNative, jumpDKID)
- _core is 0x0 here as well; ensure a
changeCore
follow-up is executed (see DK proxy comment).- _wNative = 0x3829A2486d53ee984a0ca2D76552715726b77138 — confirm this is the intended wrapped native on Arbitrum Sepolia.
- _jumpDisputeKitID = 1 — confirm expected.
contracts/deployments/arbitrumSepoliaDevnet/DisputeResolverUniversity.json
Show resolved
Hide resolved
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
♻️ Duplicate comments (1)
contracts/deploy/00-home-chain-arbitration-university.ts (1)
27-33
: Use getContractOrDeployUpgradable for idempotence and consistent reruns; also reduces nonce fragility.Switching to the idempotent helper aligns with the rest of the script and avoids accidental redeploys/skips that can shift nonces before you compute the predicted KlerosCore address.
Apply this diff:
- const disputeTemplateRegistry = await deployUpgradable(deployments, "DisputeTemplateRegistryUniversity", { - from: deployer, - contract: "DisputeTemplateRegistry", - args: [deployer], - log: true, - }); + const disputeTemplateRegistry = await getContractOrDeployUpgradable(hre, "DisputeTemplateRegistryUniversity", { + from: deployer, + args: [deployer], + log: true, + });Additionally, your nonce-based prediction for KlerosCore at Lines 41-46 assumes SortitionModule is freshly deployed (2 tx). If Sortition already exists or upgrades, the offset changes and the predicted address can be wrong. Either:
- compute the offset based on whether Sortition exists, or
- initialize Sortition with a zero core and set it post‑deploy.
Example (outside this hunk):
const sortitionExisting = await deployments.getOrNull("SortitionModuleUniversity"); const nonce = await ethers.provider.getTransactionCount(deployer); const offset = sortitionExisting ? 1 : 3; // only KlerosCore (impl+proxy) vs also Sortition (impl+proxy) klerosCoreAddress = getContractAddress(deployer, nonce + offset);
🧹 Nitpick comments (1)
contracts/deploy/00-home-chain-arbitration-university.ts (1)
37-37
: Validate the new 4th constructor arg for DisputeKitClassicUniversity.Hardcoding 1 is risky. If this is a chainId, derive it: Number(await getChainId()). If it’s a version flag, name a constant and document it.
Possible tweak:
- args: [deployer, ZeroAddress, weth.target, 1], + args: [deployer, ZeroAddress, weth.target, Number(await getChainId())], // if this param is chainId
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
contracts/deploy/00-home-chain-arbitration-university.ts
(2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
contracts/deploy/00-home-chain-arbitration-university.ts (1)
contracts/deploy/utils/deployUpgradable.ts (1)
deployUpgradable
(37-89)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (14)
- GitHub Check: Redirect rules - kleros-v2-testnet
- GitHub Check: Redirect rules - kleros-v2-testnet-devtools
- GitHub Check: Redirect rules - kleros-v2-testnet
- GitHub Check: Header rules - kleros-v2-testnet
- GitHub Check: Redirect rules - kleros-v2-university
- GitHub Check: Header rules - kleros-v2-testnet
- GitHub Check: Header rules - kleros-v2-testnet-devtools
- GitHub Check: Header rules - kleros-v2-university
- GitHub Check: Pages changed - kleros-v2-testnet-devtools
- GitHub Check: Pages changed - kleros-v2-testnet
- GitHub Check: Pages changed - kleros-v2-testnet
- GitHub Check: hardhat-tests
- GitHub Check: Pages changed - kleros-v2-university
- GitHub Check: Analyze (javascript)
🔇 Additional comments (1)
contracts/deploy/00-home-chain-arbitration-university.ts (1)
93-93
: Good: Resolver wired to proxy addresses.Passing core.target (proxy) and disputeTemplateRegistry.address (proxy) is correct and prevents pointing at implementations.
PR-Codex overview
This PR introduces the
DisputeTemplateRegistryUniversityProxy
contract and updates references to theDisputeTemplateRegistry
across various files, ensuring consistency with the new naming convention. It also modifies contract interactions and deployment scripts accordingly.Detailed summary
DisputeTemplateRegistryUniversityProxy
contract.disputeTemplateRegistry
references toDisputeTemplateRegistryUniversity
in test files.owner
togovernor
in contract execution logic.DisputeTemplateRegistryUniversity
.DisputeTemplateRegistryUniversity
.Summary by CodeRabbit
New Features
Changes
Documentation