Skip to content

Commit 2b0e7e4

Browse files
authored
Fix JIP2 (#67)
- **bump deps** - **update all docs** - **fix** --------- Signed-off-by: Oliver Tale-Yazdi <oliver@tasty.limo>
1 parent 67b536e commit 2b0e7e4

11 files changed

Lines changed: 1619 additions & 1086 deletions

File tree

build.sh

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,39 @@
22

33
set -e
44

5+
SIMPLE_NETWORKING_URL="https://github.com/zdave-parity/jam-np/blob/main/simple.md"
6+
HOST_CALL_LOG_URL="https://github.com/polkadot-fellows/JIPs/blob/main/JIP-1.md"
7+
JIP2_URL="https://github.com/polkadot-fellows/JIPs/blob/main/JIP-2.md"
8+
9+
# Convert github.com blob URLs to raw.githubusercontent.com URLs
10+
to_raw_url() {
11+
echo "$1" | perl -pe 's|github\.com/(.+?)/(.+?)/blob/(.+)|raw.githubusercontent.com/$1/$2/refs/heads/$3|'
12+
}
13+
14+
BUILD_DATE=$(date +%Y-%m-%d)
15+
516
mkdir -p node_modules
6-
wget https://raw.githubusercontent.com/zdave-parity/jam-np/refs/heads/main/simple.md -O node_modules/simple.md
7-
wget https://hackmd.io/@polkadot/jip1/download -O node_modules/host-call-log.md
8-
wget https://hackmd.io/@polkadot/jip2/download -O node_modules/jip2-gav.md
17+
wget "$(to_raw_url "$SIMPLE_NETWORKING_URL")" -O node_modules/simple.md
18+
wget "$(to_raw_url "$HOST_CALL_LOG_URL")" -O node_modules/host-call-log.md
19+
wget "$(to_raw_url "$JIP2_URL")" -O node_modules/jip2-gav.md
920

1021
cp docs/knowledge/simple-networking/spec.md.tmpl docs/knowledge/simple-networking/spec.md
1122
cat node_modules/simple.md >> docs/knowledge/simple-networking/spec.md
12-
perl -pi -e "s/BUILD_DATE/$(date +%Y-%m-%d)/" docs/knowledge/simple-networking/spec.md
23+
perl -pi -e "s|SOURCE_URL|${SIMPLE_NETWORKING_URL}|" docs/knowledge/simple-networking/spec.md
24+
perl -pi -e "s/BUILD_DATE/${BUILD_DATE}/" docs/knowledge/simple-networking/spec.md
1325

1426
cp docs/knowledge/testing/pvm/host-call-log.md.tmpl docs/knowledge/testing/pvm/host-call-log.md
1527
cat node_modules/host-call-log.md >> docs/knowledge/testing/pvm/host-call-log.md
16-
perl -pi -e "s/BUILD_DATE/$(date +%Y-%m-%d)/" docs/knowledge/testing/pvm/host-call-log.md
28+
perl -pi -e "s|SOURCE_URL|${HOST_CALL_LOG_URL}|" docs/knowledge/testing/pvm/host-call-log.md
29+
perl -pi -e "s/BUILD_DATE/${BUILD_DATE}/" docs/knowledge/testing/pvm/host-call-log.md
1730

1831
cp docs/knowledge/rpc/jip2-gav.md.tmpl docs/knowledge/rpc/jip2-gav.md
1932
cat node_modules/jip2-gav.md >> docs/knowledge/rpc/jip2-gav.md
20-
perl -pi -e "s/BUILD_DATE/$(date +%Y-%m-%d)/" docs/knowledge/rpc/jip2-gav.md
33+
perl -pi -e "s|SOURCE_URL|${JIP2_URL}|" docs/knowledge/rpc/jip2-gav.md
34+
perl -pi -e "s/BUILD_DATE/${BUILD_DATE}/" docs/knowledge/rpc/jip2-gav.md
35+
# Fix MDX-incompatible syntax in downloaded JIP-2 content
36+
perl -pi -e 's/<(https?:\/\/[^>]+)>/[$1]($1)/g' docs/knowledge/rpc/jip2-gav.md
37+
perl -pi -e 'if (!/\$|`/) { s/\{/\\{/g; s/\}/\\}/g }' docs/knowledge/rpc/jip2-gav.md
2138

2239
npm run convert-yaml docs/dao/index.md
2340

docs/knowledge/jam-chain.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
id: jam-chain
3+
title: What is JAM?
4+
sidebar_label: What Is JAM?
5+
sidebar_position: 0
6+
slug: /knowledge/jam-chain
7+
---
8+
9+
# JAM Chain
10+
11+
The **J**oin **A**ccumulate **M**achine (JAM) is an invention by Dr Gavin Wood formally specified in the [Gray Paper](https://graypaper.com). It is a blockchain network that will provide permissionless and scalable compute to anyone who pays for it.
12+
13+
## The Gray Paper Is Actually *Gray*
14+
15+
Yes is is not just the name. The original color schema is inspired by the 2000's electronics music album [Lemonjelly.ky](https://en.wikipedia.org/wiki/Lemonjelly.ky). Other color schemas available on [jamcha.in](https://jamcha.in/spec) for your eye's convenience.

docs/knowledge/rpc/jip2-gav.md

Lines changed: 437 additions & 202 deletions
Large diffs are not rendered by default.

docs/knowledge/rpc/jip2-gav.md.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ sidebar_position: 1
66
slug: /advanced/rpc/jip2-node-rpc
77
---
88

9-
(source https://hackmd.io/@polkadot/jip2 from BUILD_DATE)
9+
(fetched from [here](SOURCE_URL) on BUILD_DATE)
1010

1111
<!-- The raw MD from above will be downloaded and appended -->

docs/knowledge/simple-networking/spec.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ sidebar_position: 1
55
slug: /knowledge/advanced/simple-networking/spec
66
---
77

8-
(source https://github.com/zdave-parity/jam-np/blob/main/simple.md from 2025-12-04)
8+
(fetched from [here](https://github.com/zdave-parity/jam-np/blob/main/simple.md) on 2026-02-11)
99

1010
<!-- The raw MD from above will be downloaded and appended -->
1111
# JAM Simple Networking Protocol (JAMNP-S)
@@ -805,12 +805,18 @@ On receipt of a new negative judgment for a work-report that the node is respons
805805
- The node should audit the work-report, if it has not already done so, publishing its own judgment
806806
following this.
807807

808+
A negative judgement should include the guarantees supporting the report. This is not needed for positive judgements.
809+
The guarantees is a bounded vector of at most 3 elements, preceded by the guarantees' slot.
810+
808811
```
809812
Validity = 0 (Invalid) OR 1 (Valid) (Single byte)
813+
GuaranteeSignature = Validator Index ++ Ed25519 Signature
814+
Guarantee = Slot ++ len++[GuaranteeSignature] (2 or 3 elements only)
810815
811816
Auditor -> Validator
812817
813818
--> Epoch Index ++ Validator Index ++ Validity ++ Work-Report Hash ++ Ed25519 Signature
819+
--> Guarantee [Optional, this message is present if and only if Validity == 0]
814820
--> FIN
815821
<-- FIN
816822
```

docs/knowledge/simple-networking/spec.md.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ sidebar_position: 1
55
slug: /knowledge/advanced/simple-networking/spec
66
---
77

8-
(source https://github.com/zdave-parity/jam-np/blob/main/simple.md from BUILD_DATE)
8+
(fetched from [here](SOURCE_URL) on BUILD_DATE)
99

1010
<!-- The raw MD from above will be downloaded and appended -->
1111

docs/knowledge/testing/pvm/host-call-log.md

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ sidebar_label: Log Host Call
44
sidebar_position: 1
55
---
66

7-
(source https://hackmd.io/@polkadot/jip1 from 2025-12-04)
7+
(fetched from [here](https://github.com/polkadot-fellows/JIPs/blob/main/JIP-1.md) on 2026-02-11)
88

99
<!-- The raw MD from above will be downloaded and appended -->
1010
# JIP-1: Debug message host call
@@ -13,15 +13,22 @@ A host call for passing a debugging message from the service/authorizer to the h
1313

1414
## Host-call specification
1515

16-
Index: 100
17-
Name: `log`
18-
Gas usage: 0
19-
Input registers: $\omega_{7\dots+5}$
20-
Output registers: $\{\}$
16+
**Index**: 100
2117

22-
- `level` = $\omega_7$
23-
- `target` = $\begin{cases}\varnothing &\text{when } \omega_8 = 0 \wedge \omega_9 = 0 \\ \mu_{\omega_8\dots+\omega_9} &\text{otherwise}\end{cases}$
24-
- `message` = $\mu_{\omega_{10}\dots+\omega_{11}}$
18+
**Name**: `log`
19+
20+
**Gas usage**: 10 (same as host-call with bad index)
21+
22+
**Input registers**: $\varphi_{7\dots+5}$
23+
24+
- `level` = $\varphi_7$
25+
- `target` = $\varnothing$ if $\varphi_8 = 0 \wedge \varphi_9 = 0$, otherwise $\mu_{\varphi_8\dots+\varphi_9}$
26+
- `message` = $\mu_{\varphi_{10}\dots+\varphi_{11}}$
27+
28+
**Output registers**: $\varphi'_7$
29+
30+
- $\varphi'_7$ = `WHAT`. `WHAT` is always returned so that authorizer/service behaviour is the same
31+
whether or not this JIP is implemented.
2532

2633
### Side-effects
2734

@@ -43,14 +50,14 @@ Otherwise, express a message to user according to the user-agent.
4350

4451
### Display format for console logging
4552

46-
Note that `<CORE>` is assumed to be the integer index of the core on which the PVM is executing, which may not exist (e.g. in the On-Transfer logic).
53+
Note that `<CORE>` is assumed to be the integer index of the core on which the PVM is executing, which may not exist (e.g. in the Accumulate logic).
4754

4855
Note that `<SERVICE_ID>` is assumed to be the integer index of the service for which the PVM is executing, which may not exist (e.g. in the Is-Authorized logic).
4956

5057

5158
```
5259
<YYYY-MM-DD hh-mm-ss> <LEVEL>[@<CORE>]?[#<SERVICE_ID>]? [<TARGET>]? <MESSAGE>
53-
```
60+
```
5461

5562
#### Example log item
5663

docs/knowledge/testing/pvm/host-call-log.md.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ sidebar_label: Log Host Call
44
sidebar_position: 1
55
---
66

7-
(source https://hackmd.io/@polkadot/jip1 from BUILD_DATE)
7+
(fetched from [here](SOURCE_URL) on BUILD_DATE)
88

99
<!-- The raw MD from above will be downloaded and appended -->
1010

docusaurus.config.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const config: Config = {
1111
favicon: 'img/favicon.png',
1212

1313
// Set the production url of your site here
14-
url: 'https://jam-docs.onrender.com',
14+
url: 'https://docs.jamcha.in',
1515
// Set the /<baseUrl>/ pathname under which your site is served
1616
// For GitHub pages deployment, it is often '/<projectName>/'
1717
baseUrl: '/',
@@ -22,7 +22,12 @@ const config: Config = {
2222
projectName: 'jam-docs', // Usually your repo name.
2323

2424
onBrokenLinks: 'throw',
25-
onBrokenMarkdownLinks: 'throw',
25+
26+
markdown: {
27+
hooks: {
28+
onBrokenMarkdownLinks: 'throw',
29+
},
30+
},
2631

2732
// Even if you don't use internationalization, you can use this field to set
2833
// useful metadata like html lang. For example, if your site is Chinese, you

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
"@mdx-js/react": "^3.1.1",
2323
"clsx": "^2.0.0",
2424
"prism-react-renderer": "^2.3.0",
25-
"react": "^19.2.1",
26-
"react-dom": "^19.2.1",
25+
"react": "^19.2.4",
26+
"react-dom": "^19.2.4",
2727
"rehype-katex": "^7.0.1",
2828
"remark-math": "^6.0.0"
2929
},

0 commit comments

Comments
 (0)