Skip to content

Commit

Permalink
Merge pull request #1829 from kleros/dev
Browse files Browse the repository at this point in the history
Release v2-testnet-4.0.5
  • Loading branch information
jaybuidl authored Jan 14, 2025
2 parents aac794f + 1de725b commit f429bc4
Show file tree
Hide file tree
Showing 65 changed files with 1,048 additions and 676 deletions.
23 changes: 16 additions & 7 deletions .github/workflows/contracts-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,23 @@ jobs:
registry.yarnpkg.com:443
registry.npmjs.org:443
54.185.253.63:443
- name: Setup Node.js environment
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: 18.x
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: recursive


- name: Set up corepack (for yarn)
run: |
corepack enable
corepack prepare [email protected] --activate
yarn set version 4.5.1
- name: Setup Node.js environment
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: 20.x
cache: yarn

- name: Cache node modules
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
env:
Expand All @@ -61,7 +68,9 @@ jobs:
${{ runner.os }}-build-${{ secrets.CACHE_VERSION }}-${{ env.cache-name }}-
- name: Install contracts dependencies
run: yarn workspace @kleros/kleros-v2-contracts install
run: |
# TODO: re-enable hardened mode once the kleros-app resolution is fixed
YARN_ENABLE_HARDENED_MODE=0 yarn workspace @kleros/kleros-v2-contracts install
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@8f1998e9878d786675189ef566a2e4bf24869773 # v1.2.0
Expand Down
39 changes: 0 additions & 39 deletions .github/workflows/pr-labels.yml

This file was deleted.

2 changes: 1 addition & 1 deletion kleros-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,6 @@
"react": "^18.3.1",
"react-dom": "^18.3.1",
"viem": "^2.21.42",
"wagmi": "^2.13.0"
"wagmi": "^2.13.5"
}
}
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@
"local-stack": "scripts/tmux-local-stack.sh",
"changelog": "conventional-changelog --infile CHANGELOG.md --same-file --release-count 0 && prettier --write CHANGELOG.md",
"postinstall": "yarn check-prerequisites; husky install",
"reinstall": "YARN_CHECKSUM_BEHAVIOR=update yarn install --no-immutable"
"reinstall": "YARN_CHECKSUM_BEHAVIOR=update yarn install --no-immutable",
"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",
"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"
},
"alias": {
"process": "process/browser.js",
Expand Down
20 changes: 10 additions & 10 deletions subgraph/core-neo/subgraph.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ dataSources:
name: KlerosCore
network: arbitrum-one
source:
address: "0xCd415C03dfa85B02646C7e2977F22a480c4354F1"
address: "0x991d2df165670b9cac3B022f4B68D65b664222ea"
abi: KlerosCore
startBlock: 190274596
startBlock: 272063254
mapping:
kind: ethereum/events
apiVersion: 0.0.7
Expand Down Expand Up @@ -64,9 +64,9 @@ dataSources:
name: PolicyRegistry
network: arbitrum-one
source:
address: "0x26c1980120F1C82cF611D666CE81D2b54d018547"
address: "0x553dcbF6aB3aE06a1064b5200Df1B5A9fB403d3c"
abi: PolicyRegistry
startBlock: 190274403
startBlock: 272063037
mapping:
kind: ethereum/events
apiVersion: 0.0.7
Expand All @@ -84,9 +84,9 @@ dataSources:
name: DisputeKitClassic
network: arbitrum-one
source:
address: "0xb7c292cD9Fd3d20De84a71AE1caF054eEB6374A9"
address: "0x70B464be85A547144C72485eBa2577E5D3A45421"
abi: DisputeKitClassic
startBlock: 190274518
startBlock: 272063168
mapping:
kind: ethereum/events
apiVersion: 0.0.7
Expand Down Expand Up @@ -119,9 +119,9 @@ dataSources:
name: EvidenceModule
network: arbitrum-one
source:
address: "0xe62B776498F48061ef9425fCEf30F3d1370DB005"
address: "0x48e052B4A6dC4F30e90930F1CeaAFd83b3981EB3"
abi: EvidenceModule
startBlock: 190274441
startBlock: 272063086
mapping:
kind: ethereum/events
apiVersion: 0.0.7
Expand All @@ -140,9 +140,9 @@ dataSources:
name: SortitionModule
network: arbitrum-one
source:
address: "0x614498118850184c62f82d08261109334bFB050f"
address: "0x21A9402aDb818744B296e1d1BE58C804118DC03D"
abi: SortitionModule
startBlock: 190274557
startBlock: 272063201
mapping:
kind: ethereum/events
apiVersion: 0.0.7
Expand Down
5 changes: 5 additions & 0 deletions subgraph/core/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ type Dispute @entity {
disputeID: BigInt!
court: Court!
createdAt: BigInt
transactionHash: String!
arbitrated: Arbitrable!
period: Period!
ruled: Boolean!
Expand All @@ -180,6 +181,8 @@ type Dispute @entity {
arbitrableChainId:BigInt
externalDisputeId:BigInt
templateId:BigInt
rulingTimestamp:BigInt
rulingTransactionHash:String
}

type PeriodIndexCounter @entity {
Expand Down Expand Up @@ -303,6 +306,8 @@ type ClassicJustification @entity {
choice: BigInt!
votes: [ClassicVote!]! @derivedFrom(field: "justification")
reference: String!
transactionHash: String!
timestamp: BigInt!
}

type ClassicEvidenceGroup implements EvidenceGroup @entity {
Expand Down
2 changes: 2 additions & 0 deletions subgraph/core/src/DisputeKitClassic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ export function handleVoteCast(event: VoteCast): void {
justification.localRound = currentLocalRoundID;
justification.choice = choice;
justification.reference = event.params._justification;
justification.transactionHash = event.transaction.hash.toHexString();
justification.timestamp = event.block.timestamp;
justification.save();
const currentRulingInfo = updateCountsAndGetCurrentRuling(
currentLocalRoundID,
Expand Down
2 changes: 2 additions & 0 deletions subgraph/core/src/KlerosCore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ export function handleRuling(event: Ruling): void {
const dispute = Dispute.load(disputeID.toString());
if (!dispute) return;
dispute.ruled = true;
dispute.rulingTransactionHash = event.transaction.hash.toHexString();
dispute.rulingTimestamp = event.block.timestamp;
dispute.save();
const court = Court.load(dispute.court);
if (!court) return;
Expand Down
1 change: 1 addition & 0 deletions subgraph/core/src/entities/Dispute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export function createDisputeFromEvent(event: DisputeCreation): void {
dispute.lastPeriodChange = event.block.timestamp;
dispute.lastPeriodChangeBlockNumber = event.block.number;
dispute.periodNotificationIndex = getAndIncrementPeriodCounter(dispute.period);
dispute.transactionHash = event.transaction.hash.toHexString();
const court = Court.load(courtID);
if (!court) return;
dispute.periodDeadline = event.block.timestamp.plus(court.timesPerPeriod[0]);
Expand Down
2 changes: 1 addition & 1 deletion subgraph/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kleros/kleros-v2-subgraph",
"version": "0.9.1",
"version": "0.10.1",
"license": "MIT",
"scripts": {
"update:core:arbitrum-sepolia-devnet": "./scripts/update.sh arbitrumSepoliaDevnet arbitrum-sepolia core/subgraph.yaml",
Expand Down
5 changes: 3 additions & 2 deletions web-devtools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
},
"dependencies": {
"@kleros/kleros-sdk": "workspace:^",
"@kleros/ui-components-library": "^2.19.0",
"@kleros/kleros-v2-contracts": "workspace:^",
"@kleros/ui-components-library": "^2.20.0",
"@tanstack/react-query": "^5.61.0",
"@wagmi/connectors": "^5.5.0",
"@wagmi/core": "^2.15.0",
Expand All @@ -65,6 +66,6 @@
"typewriter-effect": "^2.21.0",
"vanilla-jsoneditor": "^0.21.6",
"viem": "^2.21.50",
"wagmi": "^2.13.0"
"wagmi": "^2.13.5"
}
}
5 changes: 3 additions & 2 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@
},
"dependencies": {
"@cyntler/react-doc-viewer": "^1.17.0",
"@kleros/kleros-app": "^2.0.2",
"@kleros/kleros-app": "workspace:^",
"@kleros/kleros-sdk": "workspace:^",
"@kleros/kleros-v2-contracts": "workspace:^",
"@kleros/ui-components-library": "^2.19.0",
"@kleros/ui-components-library": "^2.20.0",
"@lifi/wallet-management": "^3.4.6",
"@lifi/widget": "^3.12.3",
"@sentry/react": "^7.120.0",
Expand Down Expand Up @@ -117,6 +117,7 @@
"react-toastify": "^9.1.3",
"react-use": "^17.5.1",
"styled-components": "^5.3.3",
"subgraph-status": "^1.2.3",
"viem": "^2.21.54",
"wagmi": "^2.13.5"
}
Expand Down
7 changes: 4 additions & 3 deletions web/src/components/CasesDisplay/Filters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import styled, { css, useTheme } from "styled-components";

import { hoverShortTransitionTiming } from "styles/commonStyles";

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

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

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

const handleStatusChange = (value: string | number) => {
const parsedValue = JSON.parse(value as string);
const encodedFilter = encodeURIFilter({ ...filterObject, ...parsedValue });
navigate(`${location}/1/${order}/${encodedFilter}`);
navigate(`${location}/1/${order}/${encodedFilter}?${searchParams.toString()}`);
};

const handleOrderChange = (value: string | number) => {
const encodedFilter = encodeURIFilter({ ruled, period, ...filterObject });
navigate(`${location}/1/${value}/${encodedFilter}`);
navigate(`${location}/1/${value}/${encodedFilter}?${searchParams.toString()}`);
};

const { isList, setIsList } = useIsList();
Expand Down
20 changes: 15 additions & 5 deletions web/src/components/CasesDisplay/Search.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import React, { useMemo, useState } from "react";
import React, { useMemo, useRef, useState } from "react";
import styled, { css } from "styled-components";

import Skeleton from "react-loading-skeleton";
import { useNavigate, useParams } from "react-router-dom";
import { useNavigate, useParams, useSearchParams } from "react-router-dom";
import { useDebounce } from "react-use";

import { Searchbar, DropdownCascader } from "@kleros/ui-components-library";

import { isEmpty, isUndefined } from "utils/index";
Expand Down Expand Up @@ -39,6 +38,7 @@ const SearchBarContainer = styled.div`
const StyledSearchbar = styled(Searchbar)`
flex: 1;
flex-basis: 310px;
input {
font-size: 16px;
height: 45px;
Expand All @@ -53,16 +53,25 @@ const Search: React.FC = () => {
const decodedFilter = decodeURIFilter(filter ?? "all");
const { id: searchValue, ...filterObject } = decodedFilter;
const [search, setSearch] = useState(searchValue ?? "");
const initialRenderRef = useRef(true);
const navigate = useNavigate();
const [searchParams] = useSearchParams();

useDebounce(
() => {
if (initialRenderRef.current && isEmpty(search)) {
initialRenderRef.current = false;
return;
}
initialRenderRef.current = false;
const newFilters = isEmpty(search) ? { ...filterObject } : { ...filterObject, id: search };
const encodedFilter = encodeURIFilter(newFilters);
navigate(`${location}/${page}/${order}/${encodedFilter}`);
navigate(`${location}/${page}/${order}/${encodedFilter}?${searchParams.toString()}`);
},
500,
[search]
);

const { data: courtTreeData } = useCourtTree();
const items = useMemo(() => {
if (!isUndefined(courtTreeData)) {
Expand All @@ -82,14 +91,15 @@ const Search: React.FC = () => {
onSelect={(value) => {
const { court: _, ...filterWithoutCourt } = decodedFilter;
const newFilter = value === "all" ? filterWithoutCourt : { ...decodedFilter, court: value.toString() };
navigate(`${location}/${page}/${order}/${encodeURIFilter(newFilter)}`);
navigate(`${location}/${page}/${order}/${encodeURIFilter(newFilter)}?${searchParams.toString()}`);
}}
/>
) : (
<Skeleton width={240} height={42} />
)}
<SearchBarContainer>
<StyledSearchbar
dir="auto"
type="text"
placeholder="Search By ID"
value={search}
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/DisputePreview/Alias.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const AliasDisplay: React.FC<IAlias> = ({ name, address }) => {
const resolvedAddress = addressFromENS ?? (address as `0x${string}`);

return (
<AliasContainer>
<AliasContainer dir="auto">
{isLoading ? <Skeleton width={30} height={24} /> : <IdenticonOrAvatar address={resolvedAddress} size="24" />}
<TextContainer>
{isLoading ? <Skeleton width={30} height={24} /> : <AddressOrName address={resolvedAddress} />}&nbsp;
Expand Down
Loading

0 comments on commit f429bc4

Please sign in to comment.