Skip to content

Commit 9cdd1cc

Browse files
authored
Remove scoring chains (#57)
## Motivation Scoring has disabled in the portal. ## Proposal * Stop reporting to GOL backend services. * Upgrade linera JS packages ## Test Plan CI + manual
1 parent 9b16685 commit 9cdd1cc

File tree

6 files changed

+15
-95
lines changed

6 files changed

+15
-95
lines changed

README.md

Lines changed: 0 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -47,73 +47,3 @@ cargo run --bin gol -- create-puzzles
4747
4848
bash -e -x <(linera extract-script-from-markdown backend/README.md)
4949
```
50-
51-
## Testing scores against the production app
52-
53-
Run the commands below using `bash -e -x <(linera extract-script-from-markdown README.md)`.
54-
55-
```bash
56-
# Production app
57-
APP_ID=750eb4b947761eeece6c52fd488ec23442dce240fab150b93ea2212b014aaace
58-
59-
# Scoring chains
60-
CHAIN_0=1b2a5089b0b8cd0971aca985f1819ebb2f23088aca5f864cc99a2666585226ad
61-
CHAIN_1=f30e18278e8cf01ff39d44b856782805b5b22ca5c5dec19ca4694a724cdbf1cd
62-
CHAIN_2=7cc367a5baebdb26f82c4d1753736319cb9bfe1aa920d6a894e93bfc597e2377
63-
CHAIN_3=e3747adab559105a41e361bc52c141a284b31bc5eb0ef738f37c4f3f8651cb39
64-
65-
# Test user and its pinned scoring chain
66-
MATHIEU_CLI="0x359C1a2203aE35adBFA85bC9C1EAB540bF8797a7"
67-
# 2 == 0x359C1a220 % 4
68-
CHAIN=$CHAIN_2
69-
70-
# Getting a chain and tracking the scores
71-
FAUCET_URL=https://faucet.testnet-conway.linera.net
72-
73-
LINERA_TMP_DIR=$(mktemp -d)
74-
export LINERA_WALLET="$LINERA_TMP_DIR/wallet.json"
75-
export LINERA_KEYSTORE="$LINERA_TMP_DIR/keystore.json"
76-
export LINERA_STORAGE="rocksdb:$LINERA_TMP_DIR/client.db"
77-
78-
linera wallet init --faucet $FAUCET_URL
79-
linera wallet follow-chain $CHAIN
80-
81-
linera service --port 8080 &
82-
```
83-
84-
```gql,uri=http://localhost:8080/chains/$CHAIN/applications/$APP_ID
85-
query {
86-
reportedSolutions {
87-
entry(key: "$MATHIEU_CLI") {
88-
key
89-
value {
90-
entries(input: {}) {
91-
key
92-
value
93-
}
94-
}
95-
}
96-
}
97-
}
98-
```
99-
100-
## Previous scoring chains
101-
102-
The following chains were used previously and may contain valid scoring information from early users.
103-
104-
```
105-
# APP_ID=750eb4b947761eeece6c52fd488ec23442dce240fab150b93ea2212b014aaace
106-
CHAIN_V3_0=b4b3575bf33fc466b925b250812bb53147e4013d2be1d629efb7acb172d3c97b
107-
CHAIN_V3_1=ad6dbf944468255c573b4ad36daddbfe03c2de255c471cf8a0bca74e6c044ffd
108-
CHAIN_V3_2=35e0742d9f2171abd0758a334d3f3dbbe2c97567f5d455f0c4fca64a7c6ea3d3
109-
CHAIN_V3_3=0325662e35fb81d180b532af3083c303878ac60d63d850229c5eddc535dfbb9d
110-
111-
# APP_ID=750eb4b947761eeece6c52fd488ec23442dce240fab150b93ea2212b014aaace
112-
CHAIN_V2_0=74b5850ecf6a7389523f7a9748dc6f81fc71533757f617b65e5c9f01fa1430b8
113-
CHAIN_V2_1=3e6bdd095d2e4e30f12e8da38ea1409f2442696b01badbda4226577df09479ff
114-
CHAIN_V2_2=78bfe088e0e6ab2acbb894c7bac4b537650a98ca7337667cef38359b6c590508
115-
CHAIN_V2_3=d6e2e25987b75a51f9ac1df8851bd0e0d16d858e7e2896b1e9d511bac8e13f92
116-
117-
# /!\ APP_ID=27145fa604adf9996647a9a2add1dafe8f80f1a547835edf62ee408cd8903dd3
118-
CHAIN_V1=e71636fde3a70cdbfdb7fd9bef6cb1ba632af8b0567b8f76df47b35489972dd3
119-
```

frontend/index.html

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,6 @@
1212
content="frame-src https://app.dynamicauth.com 'self';"
1313
/>
1414
<script src="/js/dynamic-iframe-shim.js"></script>
15-
<script type="importmap">
16-
{
17-
"imports": {
18-
"@linera/client": "/node_modules/@linera/client/dist/linera_web.js"
19-
}
20-
}
21-
</script>
2215
</head>
2316
<body>
2417
<div id="root"></div>

frontend/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@
3434
"@heroui/system": "2.4.20",
3535
"@heroui/tabs": "^2.2.21",
3636
"@heroui/theme": "2.4.20",
37-
"@linera/client": "0.15.5",
38-
"@linera/signer": "0.15.5",
37+
"@linera/client": "0.15.7",
3938
"@react-aria/ssr": "3.9.10",
4039
"@react-aria/visually-hidden": "3.8.26",
4140
"@tailwindcss/postcss": "4.1.11",

frontend/src/lib/linera/constants.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,7 @@
22
export const LINERA_RPC_URL = "https://faucet.testnet-conway.linera.net/";
33

44
// Game of Life scoring chain IDs
5-
export const GOL_SCORING_CHAIN_IDS = [
6-
"1b2a5089b0b8cd0971aca985f1819ebb2f23088aca5f864cc99a2666585226ad",
7-
"f30e18278e8cf01ff39d44b856782805b5b22ca5c5dec19ca4694a724cdbf1cd",
8-
"7cc367a5baebdb26f82c4d1753736319cb9bfe1aa920d6a894e93bfc597e2377",
9-
"e3747adab559105a41e361bc52c141a284b31bc5eb0ef738f37c4f3f8651cb39",
10-
]
5+
export const GOL_SCORING_CHAIN_IDS = []
116

127
// Game of Life application ID
138
export const GOL_APP_ID = "750eb4b947761eeece6c52fd488ec23442dce240fab150b93ea2212b014aaace";

frontend/src/lib/linera/lib/linera-adapter.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import initLinera, { Faucet, Client, Wallet, Application } from "@linera/client";
1+
import { initialize, Faucet, Client, Wallet, Application } from "@linera/client";
22
import type { Wallet as DynamicWallet } from "@dynamic-labs/sdk-react-core";
33
import { DynamicSigner } from "./dynamic-signer";
44

@@ -41,7 +41,7 @@ export class LineraAdapter {
4141
console.log("🔗 Connecting with Dynamic wallet:", address);
4242

4343
try {
44-
if (!this.wasmInitPromise) this.wasmInitPromise = initLinera();
44+
if (!this.wasmInitPromise) this.wasmInitPromise = initialize();
4545
await this.wasmInitPromise;
4646
console.log("✅ Linera WASM modules initialized successfully");
4747
} catch (e) {
@@ -105,15 +105,15 @@ export class LineraAdapter {
105105
async setApplications(appId: string, previousAppIds: string[]) {
106106
if (!this.provider) throw new Error("Not connected to Linera");
107107

108-
const application = await this.provider.client.frontend().application(appId);
108+
const application = await this.provider.client.application(appId);
109109

110110
if (!application) throw new Error("Failed to get application");
111111
this.application = application;
112112
console.log("✅ Linera application set successfully: ", appId);
113113

114114
const applications = []
115115
for (const appId of previousAppIds) {
116-
const application = await this.provider.client.frontend().application(appId);
116+
const application = await this.provider.client.application(appId);
117117
if (!application) throw new Error("Failed to get previous application");
118118
applications.push(application);
119119
}

frontend/src/lib/linera/services/LineraService.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {
1818
export interface WalletInfo {
1919
chainId: string;
2020
createdAt: string;
21-
scoringChainId: string;
21+
scoringChainId: string | null;
2222
}
2323

2424
export class LineraService {
@@ -50,10 +50,13 @@ export class LineraService {
5050

5151
await lineraAdapter.setApplications(GOL_APP_ID, PREVIOUS_GOL_APP_IDS);
5252

53-
const address = lineraAdapter.getAddress();
54-
const value = Number(address.substring(0, 10)); // top 8 hex digits including 0x
55-
const index = value % GOL_SCORING_CHAIN_IDS.length;
56-
const scoringChainId = GOL_SCORING_CHAIN_IDS[index];
53+
var scoringChainId = null;
54+
if (GOL_SCORING_CHAIN_IDS.length > 0) {
55+
const address = lineraAdapter.getAddress();
56+
const value = Number(address.substring(0, 10)); // top 8 hex digits including 0x
57+
const index = value % GOL_SCORING_CHAIN_IDS.length;
58+
scoringChainId = GOL_SCORING_CHAIN_IDS[index];
59+
}
5760

5861
this.walletInfo = {
5962
chainId: provider.chainId,
@@ -164,7 +167,7 @@ export class LineraService {
164167
try {
165168
const mutation = {
166169
query: `
167-
mutation SubmitSolution($puzzleId: String!, $board: BoardInput!, $scoringChainId: String!) {
170+
mutation SubmitSolution($puzzleId: String!, $board: BoardInput!, $scoringChainId: String) {
168171
submitSolution(puzzleId: $puzzleId, board: $board, scoringChainId: $scoringChainId)
169172
}
170173
`,

0 commit comments

Comments
 (0)