Skip to content

Release #1323

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

Merged
merged 93 commits into from
Nov 29, 2023
Merged

Release #1323

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
c6d8417
feat(web): structure for top jurors component with some hardcoded values
kemuru Oct 20, 2023
dfb3e87
Merge branch 'dev' into feat(web)/top-jurors-component
kemuru Oct 20, 2023
0d3479f
Merge branch 'dev' into feat(web)/top-jurors-component
kemuru Oct 22, 2023
7e92e10
refactor(web): abstraction user level coherency, level calculation, p…
kemuru Oct 22, 2023
eb442de
feat(web): better styling in mobile version
kemuru Oct 22, 2023
968d173
feat(web): slighly different style for mobile
kemuru Oct 22, 2023
f118da4
fix(web): bug styled skeleton not showing in pixelart
kemuru Oct 23, 2023
edd79fa
feat(web,subgraph): real data, add coherence score to subgraph schema…
kemuru Oct 24, 2023
025f02f
feat(web): share juror score on x
kemuru Oct 24, 2023
ddc232a
test: first subgraph unit test
jaybuidl Oct 24, 2023
a41c16d
fix(web): juror dashboard coherency fix
kemuru Oct 24, 2023
03b36c6
chore(subgraph): simplify coherence calculation
kemuru Oct 24, 2023
0f80e6c
test: user test fix
jaybuidl Oct 24, 2023
978e954
fix(web): appeal-tab-not-displaying-options
kemuru Oct 25, 2023
302ef1e
feat(web, subgraph): add timestamp field to disputekitdispute, update…
kemuru Oct 25, 2023
aa7390e
fix(web): my courts section not working on dashboard
alcercu Oct 25, 2023
c1857cf
chore(web): remove console.log
alcercu Oct 25, 2023
61df412
Merge branch 'dev' into fix(web)/courts-not-appearing-dashboard
alcercu Oct 25, 2023
4cf47e6
fix(web): broken import
alcercu Oct 25, 2023
923f2d4
Merge branch 'fix(web)/courts-not-appearing-dashboard' of github.com:…
alcercu Oct 25, 2023
d4c4869
chore: added devnet to deploy-subgraph.yml
jaybuidl Oct 25, 2023
8359e61
Merge branch 'dev' into fix(web)/courts-not-appearing-dashboard
alcercu Oct 25, 2023
a5aa14c
Merge pull request #1299 from kleros/fix(web)/courts-not-appearing-da…
alcercu Oct 25, 2023
c1c2f97
Merge branch 'dev' into feat(web)/top-jurors-component
kemuru Oct 25, 2023
7f8be8e
fix(subgraph): recompute coherence score if totalCoherent changed
kemuru Oct 25, 2023
8e45aa7
refactor(web): top jurors components modularization
kemuru Oct 25, 2023
38f61bc
feat(web): mobile version top jurors + bunch of code refactors
kemuru Oct 25, 2023
78b0fd6
Merge branch 'dev' into feat(web)/x-share-juror-score
kemuru Oct 26, 2023
a3f5a66
feat(web): create mini guides structure, create level miniguides, sty…
kemuru Oct 27, 2023
79d9ce8
feat(web): close miniguides when clicking outside container
kemuru Oct 27, 2023
13aa860
feat(web): add debug info to desktop version in help component
kemuru Oct 27, 2023
9b8a25a
feat(web): set some structure basis for the desktop my courts section
kemuru Oct 29, 2023
ecbf5f5
feat(web): reduce pixelarts images sizes
kemuru Oct 29, 2023
bea87be
fix(web): some gap between court name and stake data
kemuru Oct 30, 2023
a15a07c
feat(web): pass real info to the tweet
kemuru Oct 30, 2023
d71d813
chore(web): change tweet slightly
kemuru Oct 30, 2023
1a60dae
chore(web): change tweet slightly again
kemuru Oct 30, 2023
7016cc7
test: bumped solidity-coverage which was borked
jaybuidl Oct 30, 2023
f5495c9
Merge branch 'dev' into feat(web)/mini-guides-levels
jaybuidl Oct 30, 2023
3aeedd5
Merge branch 'dev' into feat(web)/mobile-version-my-courts-dashboard
jaybuidl Oct 30, 2023
62e6a91
Merge branch 'dev' into feat(web)/mobile-view-top-jurors-and-some-ref…
jaybuidl Oct 30, 2023
79fa3ea
Merge branch 'dev' into feat(web)/x-share-juror-score
jaybuidl Oct 30, 2023
5a72ba1
Merge pull request #1304 from kleros/feat(web)/mini-guides-levels
alcercu Oct 30, 2023
74235df
Merge pull request #1297 from kleros/feat(web)/x-share-juror-score
alcercu Oct 30, 2023
e5ded92
fix(web): resolve changes requested
kemuru Oct 30, 2023
f2803cb
Merge branch 'dev' into feat(web)/mobile-view-top-jurors-and-some-ref…
jaybuidl Oct 30, 2023
d4f554b
Merge branch 'feat(web)/mobile-view-top-jurors-and-some-refactors' of…
jaybuidl Oct 30, 2023
1e917ed
Merge branch 'dev' into feat(web)/mobile-version-my-courts-dashboard
kemuru Oct 31, 2023
873399d
feat(web): add how it works miniguide to dashboard, style header for …
kemuru Oct 31, 2023
aefcc48
feat(web): hide share juror score button if you have 0 cases
kemuru Oct 31, 2023
be3968b
fix(web): correction on topjurors styling
kemuru Oct 31, 2023
1751626
feat(web): slight adjustment topjurors mobile component
kemuru Oct 31, 2023
7a7eef6
feat(web): create new query for juror stakes, change whole structure …
kemuru Oct 31, 2023
aec9451
feat(web): add skeleton to evidencecard and empty evidence message
kemuru Oct 31, 2023
a5f70c0
fix(web): modularization of components, mobilecard, desktopcard, styl…
kemuru Oct 31, 2023
176bf73
feat(web): styling for mobile, code optimizations
kemuru Nov 1, 2023
255f03d
chore(web): code smell
kemuru Nov 1, 2023
d164898
fix(web): style adjustment in stake and lockedstake components
kemuru Nov 1, 2023
4543d99
feat(web): add onboarding mini guides, link it to help component, abs…
kemuru Nov 2, 2023
0d48369
fix(web): padding adjustment in mobile
kemuru Nov 2, 2023
dd450c2
fix(web): style onboarding guides for both dark and light mode
kemuru Nov 2, 2023
de8a73e
feat(web): add staking mini guides, howitworks component abstraction,…
kemuru Nov 2, 2023
0d340ba
feat(web): add appeal mini guides, link it to appeal tab
kemuru Nov 3, 2023
09b1a14
chore(web): code abstractions, refactors
kemuru Nov 3, 2023
dbe008d
chore(web): more abstractions
kemuru Nov 3, 2023
7bfbe00
feat(web): create ranked voting and binary voting miniguides
kemuru Nov 3, 2023
d0d1087
feat(web): link all the miniguides to onboarding miniguide, create me…
kemuru Nov 3, 2023
1ab08e2
feat(web): hide onboarding miniguide if subminiguide is open
kemuru Nov 3, 2023
2a42fc7
chore(web): abstract more code
kemuru Nov 3, 2023
abc0ac5
fix(web): add isonboarding variable to pagecontentstemplate
kemuru Nov 3, 2023
2e9b91d
chore(web): remove duplicated svgs for each theme, pass colors as par…
kemuru Nov 4, 2023
9e13596
chore(web): abstract styledimage, small style change
kemuru Nov 4, 2023
b6ef17b
chore(web): simplify pnklogo into one styled component and one svg
kemuru Nov 4, 2023
b9d1f53
chore(web): modals width adjustment on mobile
kemuru Nov 4, 2023
97d263d
feat(web): style cases page, courts page
kemuru Nov 7, 2023
25c969b
chore(web): move dropdown to the left, searchbar to the right
kemuru Nov 7, 2023
fd9862b
Merge pull request #1305 from kleros/feat(web)/mobile-version-my-cour…
alcercu Nov 7, 2023
d279014
fix(web,subgraph): fix staking balances bug
kemuru Nov 8, 2023
347cbcd
Merge pull request #1321 from kleros/fix(web,subgraph)/stakes-balance…
alcercu Nov 8, 2023
f4cae05
feat(web): new lockedstake design implementation
kemuru Nov 9, 2023
20b2191
fix(web): tiny code smell
kemuru Nov 10, 2023
cfe88a2
Merge pull request #1324 from kleros/feat(web)/locked-pnk-redesigns-f…
alcercu Nov 15, 2023
b5e59c8
fix(web): in progress cases fixed in court stats
kemuru Nov 16, 2023
9612770
fix(web): overflow pagination fix
kemuru Nov 16, 2023
53d7bf3
feat(web): show no cases found if user has not ever had a dispute
kemuru Nov 16, 2023
cdc324a
chore(web): adding usememo for performance
kemuru Nov 18, 2023
c7dc6b4
Merge pull request #1332 from kleros/fix(web)/cases-in-progress-and-p…
alcercu Nov 20, 2023
2a0dbf2
fix(web): increased draw query results up to 1000
kemuru Nov 22, 2023
7ddf34f
Merge pull request #1339 from kleros/fix(web)/increase-draw-query-res…
alcercu Nov 22, 2023
7483f1f
Merge branch 'master' into dev
jaybuidl Nov 22, 2023
2d6de9d
refactor(web): case details overview file too big
tractorss Nov 23, 2023
a0a583c
refactor(web): resolve suggestions
tractorss Nov 24, 2023
0795fbc
Merge pull request #1340 from kleros/refactor(web)/case-details-overview
alcercu Nov 24, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/deploy-subgraph.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
default: 'arbitrum-goerli'
type: choice
options:
- arbitrum-goerli-devnet
- arbitrum-goerli
- arbitrum
update:
Expand Down
2 changes: 1 addition & 1 deletion contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"pino-pretty": "^10.0.0",
"shelljs": "^0.8.5",
"solhint-plugin-prettier": "^0.0.5",
"solidity-coverage": "0.8.2",
"solidity-coverage": "0.8.5",
"ts-node": "^10.9.1",
"typechain": "^8.3.1",
"typescript": "^4.9.5"
Expand Down
4 changes: 3 additions & 1 deletion subgraph/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"update:local": "./scripts/update.sh localhost mainnet",
"codegen": "graph codegen",
"build": "graph build",
"test": "graph test",
"clean": "graph clean && rm subgraph.yaml.bak.*",
"deploy:arbitrum-goerli": "graph deploy --product hosted-service kleros/kleros-v2-core-testnet-2",
"deploy:arbitrum-goerli-devnet": "graph deploy --product hosted-service kleros/kleros-v2-core-devnet",
Expand All @@ -30,7 +31,8 @@
"@graphprotocol/graph-cli": "0.52.0",
"@kleros/kleros-v2-eslint-config": "workspace:^",
"@kleros/kleros-v2-prettier-config": "workspace:^",
"gluegun": "^5.1.2"
"gluegun": "^5.1.2",
"matchstick-as": "0.6.0-beta.2"
},
"dependenciesComments": {
"@graphprotocol/graph-cli": "pinned because of this issue: https://github.com/graphprotocol/graph-tooling/issues/1399#issuecomment-1676104540"
Expand Down
3 changes: 3 additions & 0 deletions subgraph/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ interface DisputeKitDispute {
coreDispute: Dispute!
localRounds: [DisputeKitRound!]! @derivedFrom(field: "localDispute")
currentLocalRoundIndex: BigInt!
timestamp: BigInt!
}

interface DisputeKitRound {
Expand Down Expand Up @@ -72,6 +73,7 @@ type User @entity {
totalResolvedDisputes: BigInt!
totalDisputes: BigInt!
totalCoherent: BigInt!
coherenceScore: BigInt!
totalAppealingDisputes: BigInt!
votes: [Vote!]! @derivedFrom(field: "juror")
contributions: [Contribution!]! @derivedFrom(field: "contributor")
Expand Down Expand Up @@ -236,6 +238,7 @@ type ClassicDispute implements DisputeKitDispute @entity {
coreDispute: Dispute!
localRounds: [DisputeKitRound!]! @derivedFrom(field: "localDispute")
currentLocalRoundIndex: BigInt!
timestamp: BigInt!

numberOfChoices: BigInt!
extraData: Bytes!
Expand Down
1 change: 1 addition & 0 deletions subgraph/src/entities/ClassicDispute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ export function createClassicDisputeFromEvent(event: DisputeCreation): void {
classicDispute.currentLocalRoundIndex = ZERO;
classicDispute.numberOfChoices = event.params._numberOfChoices;
classicDispute.extraData = event.params._extraData;
classicDispute.timestamp = event.block.timestamp;
classicDispute.save();
}
4 changes: 2 additions & 2 deletions subgraph/src/entities/JurorTokensPerCourt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export function updateJurorStake(jurorAddress: string, courtID: string, contract
const jurorBalance = contract.getJurorBalance(Address.fromString(jurorAddress), BigInt.fromString(courtID));
const previousStake = jurorTokens.staked;
const previousTotalStake = juror.totalStake;
jurorTokens.staked = jurorBalance.value0;
jurorTokens.staked = jurorBalance.value2;
jurorTokens.locked = jurorBalance.value1;
jurorTokens.save();
const stakeDelta = getDelta(previousStake, jurorTokens.staked);
Expand All @@ -47,7 +47,7 @@ export function updateJurorStake(jurorAddress: string, courtID: string, contract
court.stake = court.stake.plus(stakeDelta);
updateStakedPNK(stakeDelta, timestamp);
const activeJurorsDelta = getActivityDelta(previousTotalStake, newTotalStake);
const stakedJurorsDelta = getActivityDelta(previousStake, jurorBalance.value0);
const stakedJurorsDelta = getActivityDelta(previousStake, jurorBalance.value2);
court.numberStakedJurors = court.numberStakedJurors.plus(stakedJurorsDelta);
updateActiveJurors(activeJurorsDelta, timestamp);
juror.save();
Expand Down
18 changes: 17 additions & 1 deletion subgraph/src/entities/User.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
import { BigInt } from "@graphprotocol/graph-ts";
import { BigInt, BigDecimal } from "@graphprotocol/graph-ts";
import { User } from "../../generated/schema";
import { ONE, ZERO } from "../utils";

export function computeCoherenceScore(totalCoherent: BigInt, totalResolvedDisputes: BigInt): BigInt {
const smoothingFactor = BigDecimal.fromString("10");

let denominator = totalResolvedDisputes.toBigDecimal().plus(smoothingFactor);
let coherencyRatio = totalCoherent.toBigDecimal().div(denominator);

const coherencyScore = coherencyRatio.times(BigDecimal.fromString("100"));

const roundedScore = coherencyScore.plus(BigDecimal.fromString("0.5"));

return BigInt.fromString(roundedScore.toString().split(".")[0]);
}

export function ensureUser(id: string): User {
const user = User.load(id);

Expand All @@ -24,6 +37,7 @@ export function createUserFromAddress(id: string): User {
user.totalAppealingDisputes = ZERO;
user.totalDisputes = ZERO;
user.totalCoherent = ZERO;
user.coherenceScore = ZERO;
user.save();

return user;
Expand Down Expand Up @@ -52,6 +66,7 @@ export function resolveUserDispute(id: string, previousFeeAmount: BigInt, feeAmo
user.totalCoherent = user.totalCoherent.plus(ONE);
}
}
user.coherenceScore = computeCoherenceScore(user.totalCoherent, user.totalResolvedDisputes);
user.save();
return;
}
Expand All @@ -61,5 +76,6 @@ export function resolveUserDispute(id: string, previousFeeAmount: BigInt, feeAmo
user.totalCoherent = user.totalCoherent.plus(ONE);
}
user.activeDisputes = user.activeDisputes.minus(ONE);
user.coherenceScore = computeCoherenceScore(user.totalCoherent, user.totalResolvedDisputes);
user.save();
}
9 changes: 9 additions & 0 deletions subgraph/tests/user.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { assert, test, describe } from "matchstick-as/assembly/index";
import { BigInt } from "@graphprotocol/graph-ts";
import { computeCoherenceScore } from "../src/entities/User";

describe("Compute coherence score", () => {
test("Slam BigInts together", () => {
assert.bigIntEquals(BigInt.fromI32(8), computeCoherenceScore(BigInt.fromI32(1), BigInt.fromI32(2)));
});
});
Binary file modified web/src/assets/pngs/dashboard/aristoteles.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified web/src/assets/pngs/dashboard/diogenes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified web/src/assets/pngs/dashboard/plato.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified web/src/assets/pngs/dashboard/pythagoras.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified web/src/assets/pngs/dashboard/socrates.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions web/src/assets/svgs/menu-icons/help.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading