Skip to content

Commit f429bc4

Browse files
authored
Merge pull request #1829 from kleros/dev
Release v2-testnet-4.0.5
2 parents aac794f + 1de725b commit f429bc4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+1048
-676
lines changed

.github/workflows/contracts-testing.yml

+16-7
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,23 @@ jobs:
3838
registry.yarnpkg.com:443
3939
registry.npmjs.org:443
4040
54.185.253.63:443
41-
42-
- name: Setup Node.js environment
43-
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
44-
with:
45-
node-version: 18.x
4641
4742
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
4843
with:
4944
submodules: recursive
50-
45+
46+
- name: Set up corepack (for yarn)
47+
run: |
48+
corepack enable
49+
corepack prepare [email protected] --activate
50+
yarn set version 4.5.1
51+
52+
- name: Setup Node.js environment
53+
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
54+
with:
55+
node-version: 20.x
56+
cache: yarn
57+
5158
- name: Cache node modules
5259
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
5360
env:
@@ -61,7 +68,9 @@ jobs:
6168
${{ runner.os }}-build-${{ secrets.CACHE_VERSION }}-${{ env.cache-name }}-
6269
6370
- name: Install contracts dependencies
64-
run: yarn workspace @kleros/kleros-v2-contracts install
71+
run: |
72+
# TODO: re-enable hardened mode once the kleros-app resolution is fixed
73+
YARN_ENABLE_HARDENED_MODE=0 yarn workspace @kleros/kleros-v2-contracts install
6574
6675
- name: Install Foundry
6776
uses: foundry-rs/foundry-toolchain@8f1998e9878d786675189ef566a2e4bf24869773 # v1.2.0

.github/workflows/pr-labels.yml

-39
This file was deleted.

kleros-app/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,6 @@
6161
"react": "^18.3.1",
6262
"react-dom": "^18.3.1",
6363
"viem": "^2.21.42",
64-
"wagmi": "^2.13.0"
64+
"wagmi": "^2.13.5"
6565
}
6666
}

package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,9 @@
8181
"local-stack": "scripts/tmux-local-stack.sh",
8282
"changelog": "conventional-changelog --infile CHANGELOG.md --same-file --release-count 0 && prettier --write CHANGELOG.md",
8383
"postinstall": "yarn check-prerequisites; husky install",
84-
"reinstall": "YARN_CHECKSUM_BEHAVIOR=update yarn install --no-immutable"
84+
"reinstall": "YARN_CHECKSUM_BEHAVIOR=update yarn install --no-immutable",
85+
"build:web:ci": "yarn workspaces focus @kleros/kleros-v2-web && yarn workspaces foreach -Ap --include kleros-app --include contracts run build && yarn workspace @kleros/kleros-v2-web build-netlify",
86+
"build:web-devtools:ci": "yarn workspaces focus @kleros/kleros-v2-web-devtools && yarn workspaces foreach -Ap --include contracts run build && yarn workspace @kleros/kleros-v2-web-devtools build-netlify"
8587
},
8688
"alias": {
8789
"process": "process/browser.js",

subgraph/core-neo/subgraph.yaml

+10-10
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ dataSources:
88
name: KlerosCore
99
network: arbitrum-one
1010
source:
11-
address: "0xCd415C03dfa85B02646C7e2977F22a480c4354F1"
11+
address: "0x991d2df165670b9cac3B022f4B68D65b664222ea"
1212
abi: KlerosCore
13-
startBlock: 190274596
13+
startBlock: 272063254
1414
mapping:
1515
kind: ethereum/events
1616
apiVersion: 0.0.7
@@ -64,9 +64,9 @@ dataSources:
6464
name: PolicyRegistry
6565
network: arbitrum-one
6666
source:
67-
address: "0x26c1980120F1C82cF611D666CE81D2b54d018547"
67+
address: "0x553dcbF6aB3aE06a1064b5200Df1B5A9fB403d3c"
6868
abi: PolicyRegistry
69-
startBlock: 190274403
69+
startBlock: 272063037
7070
mapping:
7171
kind: ethereum/events
7272
apiVersion: 0.0.7
@@ -84,9 +84,9 @@ dataSources:
8484
name: DisputeKitClassic
8585
network: arbitrum-one
8686
source:
87-
address: "0xb7c292cD9Fd3d20De84a71AE1caF054eEB6374A9"
87+
address: "0x70B464be85A547144C72485eBa2577E5D3A45421"
8888
abi: DisputeKitClassic
89-
startBlock: 190274518
89+
startBlock: 272063168
9090
mapping:
9191
kind: ethereum/events
9292
apiVersion: 0.0.7
@@ -119,9 +119,9 @@ dataSources:
119119
name: EvidenceModule
120120
network: arbitrum-one
121121
source:
122-
address: "0xe62B776498F48061ef9425fCEf30F3d1370DB005"
122+
address: "0x48e052B4A6dC4F30e90930F1CeaAFd83b3981EB3"
123123
abi: EvidenceModule
124-
startBlock: 190274441
124+
startBlock: 272063086
125125
mapping:
126126
kind: ethereum/events
127127
apiVersion: 0.0.7
@@ -140,9 +140,9 @@ dataSources:
140140
name: SortitionModule
141141
network: arbitrum-one
142142
source:
143-
address: "0x614498118850184c62f82d08261109334bFB050f"
143+
address: "0x21A9402aDb818744B296e1d1BE58C804118DC03D"
144144
abi: SortitionModule
145-
startBlock: 190274557
145+
startBlock: 272063201
146146
mapping:
147147
kind: ethereum/events
148148
apiVersion: 0.0.7

subgraph/core/schema.graphql

+5
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ type Dispute @entity {
160160
disputeID: BigInt!
161161
court: Court!
162162
createdAt: BigInt
163+
transactionHash: String!
163164
arbitrated: Arbitrable!
164165
period: Period!
165166
ruled: Boolean!
@@ -180,6 +181,8 @@ type Dispute @entity {
180181
arbitrableChainId:BigInt
181182
externalDisputeId:BigInt
182183
templateId:BigInt
184+
rulingTimestamp:BigInt
185+
rulingTransactionHash:String
183186
}
184187

185188
type PeriodIndexCounter @entity {
@@ -303,6 +306,8 @@ type ClassicJustification @entity {
303306
choice: BigInt!
304307
votes: [ClassicVote!]! @derivedFrom(field: "justification")
305308
reference: String!
309+
transactionHash: String!
310+
timestamp: BigInt!
306311
}
307312

308313
type ClassicEvidenceGroup implements EvidenceGroup @entity {

subgraph/core/src/DisputeKitClassic.ts

+2
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ export function handleVoteCast(event: VoteCast): void {
6666
justification.localRound = currentLocalRoundID;
6767
justification.choice = choice;
6868
justification.reference = event.params._justification;
69+
justification.transactionHash = event.transaction.hash.toHexString();
70+
justification.timestamp = event.block.timestamp;
6971
justification.save();
7072
const currentRulingInfo = updateCountsAndGetCurrentRuling(
7173
currentLocalRoundID,

subgraph/core/src/KlerosCore.ts

+2
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,8 @@ export function handleRuling(event: Ruling): void {
184184
const dispute = Dispute.load(disputeID.toString());
185185
if (!dispute) return;
186186
dispute.ruled = true;
187+
dispute.rulingTransactionHash = event.transaction.hash.toHexString();
188+
dispute.rulingTimestamp = event.block.timestamp;
187189
dispute.save();
188190
const court = Court.load(dispute.court);
189191
if (!court) return;

subgraph/core/src/entities/Dispute.ts

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export function createDisputeFromEvent(event: DisputeCreation): void {
2121
dispute.lastPeriodChange = event.block.timestamp;
2222
dispute.lastPeriodChangeBlockNumber = event.block.number;
2323
dispute.periodNotificationIndex = getAndIncrementPeriodCounter(dispute.period);
24+
dispute.transactionHash = event.transaction.hash.toHexString();
2425
const court = Court.load(courtID);
2526
if (!court) return;
2627
dispute.periodDeadline = event.block.timestamp.plus(court.timesPerPeriod[0]);

subgraph/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@kleros/kleros-v2-subgraph",
3-
"version": "0.9.1",
3+
"version": "0.10.1",
44
"license": "MIT",
55
"scripts": {
66
"update:core:arbitrum-sepolia-devnet": "./scripts/update.sh arbitrumSepoliaDevnet arbitrum-sepolia core/subgraph.yaml",

web-devtools/package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@
4848
},
4949
"dependencies": {
5050
"@kleros/kleros-sdk": "workspace:^",
51-
"@kleros/ui-components-library": "^2.19.0",
51+
"@kleros/kleros-v2-contracts": "workspace:^",
52+
"@kleros/ui-components-library": "^2.20.0",
5253
"@tanstack/react-query": "^5.61.0",
5354
"@wagmi/connectors": "^5.5.0",
5455
"@wagmi/core": "^2.15.0",
@@ -65,6 +66,6 @@
6566
"typewriter-effect": "^2.21.0",
6667
"vanilla-jsoneditor": "^0.21.6",
6768
"viem": "^2.21.50",
68-
"wagmi": "^2.13.0"
69+
"wagmi": "^2.13.5"
6970
}
7071
}

web/package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@
7878
},
7979
"dependencies": {
8080
"@cyntler/react-doc-viewer": "^1.17.0",
81-
"@kleros/kleros-app": "^2.0.2",
81+
"@kleros/kleros-app": "workspace:^",
8282
"@kleros/kleros-sdk": "workspace:^",
8383
"@kleros/kleros-v2-contracts": "workspace:^",
84-
"@kleros/ui-components-library": "^2.19.0",
84+
"@kleros/ui-components-library": "^2.20.0",
8585
"@lifi/wallet-management": "^3.4.6",
8686
"@lifi/widget": "^3.12.3",
8787
"@sentry/react": "^7.120.0",
@@ -117,6 +117,7 @@
117117
"react-toastify": "^9.1.3",
118118
"react-use": "^17.5.1",
119119
"styled-components": "^5.3.3",
120+
"subgraph-status": "^1.2.3",
120121
"viem": "^2.21.54",
121122
"wagmi": "^2.13.5"
122123
}

web/src/components/CasesDisplay/Filters.tsx

+4-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import styled, { css, useTheme } from "styled-components";
33

44
import { hoverShortTransitionTiming } from "styles/commonStyles";
55

6-
import { useNavigate, useParams } from "react-router-dom";
6+
import { useNavigate, useParams, useSearchParams } from "react-router-dom";
77

88
import { DropdownSelect } from "@kleros/ui-components-library";
99

@@ -55,16 +55,17 @@ const Filters: React.FC = () => {
5555
const { ruled, period, ...filterObject } = decodeURIFilter(filter ?? "all");
5656
const navigate = useNavigate();
5757
const location = useRootPath();
58+
const [searchParams] = useSearchParams();
5859

5960
const handleStatusChange = (value: string | number) => {
6061
const parsedValue = JSON.parse(value as string);
6162
const encodedFilter = encodeURIFilter({ ...filterObject, ...parsedValue });
62-
navigate(`${location}/1/${order}/${encodedFilter}`);
63+
navigate(`${location}/1/${order}/${encodedFilter}?${searchParams.toString()}`);
6364
};
6465

6566
const handleOrderChange = (value: string | number) => {
6667
const encodedFilter = encodeURIFilter({ ruled, period, ...filterObject });
67-
navigate(`${location}/1/${value}/${encodedFilter}`);
68+
navigate(`${location}/1/${value}/${encodedFilter}?${searchParams.toString()}`);
6869
};
6970

7071
const { isList, setIsList } = useIsList();

web/src/components/CasesDisplay/Search.tsx

+15-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
import React, { useMemo, useState } from "react";
1+
import React, { useMemo, useRef, useState } from "react";
22
import styled, { css } from "styled-components";
33

44
import Skeleton from "react-loading-skeleton";
5-
import { useNavigate, useParams } from "react-router-dom";
5+
import { useNavigate, useParams, useSearchParams } from "react-router-dom";
66
import { useDebounce } from "react-use";
7-
87
import { Searchbar, DropdownCascader } from "@kleros/ui-components-library";
98

109
import { isEmpty, isUndefined } from "utils/index";
@@ -39,6 +38,7 @@ const SearchBarContainer = styled.div`
3938
const StyledSearchbar = styled(Searchbar)`
4039
flex: 1;
4140
flex-basis: 310px;
41+
4242
input {
4343
font-size: 16px;
4444
height: 45px;
@@ -53,16 +53,25 @@ const Search: React.FC = () => {
5353
const decodedFilter = decodeURIFilter(filter ?? "all");
5454
const { id: searchValue, ...filterObject } = decodedFilter;
5555
const [search, setSearch] = useState(searchValue ?? "");
56+
const initialRenderRef = useRef(true);
5657
const navigate = useNavigate();
58+
const [searchParams] = useSearchParams();
59+
5760
useDebounce(
5861
() => {
62+
if (initialRenderRef.current && isEmpty(search)) {
63+
initialRenderRef.current = false;
64+
return;
65+
}
66+
initialRenderRef.current = false;
5967
const newFilters = isEmpty(search) ? { ...filterObject } : { ...filterObject, id: search };
6068
const encodedFilter = encodeURIFilter(newFilters);
61-
navigate(`${location}/${page}/${order}/${encodedFilter}`);
69+
navigate(`${location}/${page}/${order}/${encodedFilter}?${searchParams.toString()}`);
6270
},
6371
500,
6472
[search]
6573
);
74+
6675
const { data: courtTreeData } = useCourtTree();
6776
const items = useMemo(() => {
6877
if (!isUndefined(courtTreeData)) {
@@ -82,14 +91,15 @@ const Search: React.FC = () => {
8291
onSelect={(value) => {
8392
const { court: _, ...filterWithoutCourt } = decodedFilter;
8493
const newFilter = value === "all" ? filterWithoutCourt : { ...decodedFilter, court: value.toString() };
85-
navigate(`${location}/${page}/${order}/${encodeURIFilter(newFilter)}`);
94+
navigate(`${location}/${page}/${order}/${encodeURIFilter(newFilter)}?${searchParams.toString()}`);
8695
}}
8796
/>
8897
) : (
8998
<Skeleton width={240} height={42} />
9099
)}
91100
<SearchBarContainer>
92101
<StyledSearchbar
102+
dir="auto"
93103
type="text"
94104
placeholder="Search By ID"
95105
value={search}

web/src/components/DisputePreview/Alias.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const AliasDisplay: React.FC<IAlias> = ({ name, address }) => {
4646
const resolvedAddress = addressFromENS ?? (address as `0x${string}`);
4747

4848
return (
49-
<AliasContainer>
49+
<AliasContainer dir="auto">
5050
{isLoading ? <Skeleton width={30} height={24} /> : <IdenticonOrAvatar address={resolvedAddress} size="24" />}
5151
<TextContainer>
5252
{isLoading ? <Skeleton width={30} height={24} /> : <AddressOrName address={resolvedAddress} />}&nbsp;

0 commit comments

Comments
 (0)