Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
23 changes: 20 additions & 3 deletions .github/workflows/node-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,18 @@ concurrency:
env:
CARGO_TERM_COLOR: always
RUST_TOOLCHAIN: 1.98.1
# v0.8.3-rc1: fullnode 9443de63, the whole v0.8.3 batch but #159 (storage only). Set v0.8.3 at the tag.
FULLNODE_TAG: v0.8.5
# Empty until fullnode v0.8.7 is tagged: this core is constraint set 11 (chain 22), which no
# fullnode release verifies yet (v0.8.5/v0.8.6 are set 9), so the real-node job builds rand-node
# and rand-prover from the vendored fullnode (core/vendor/fullnode, feat/cs11-revendor 60a7d03)
# instead of downloading a release. Set v0.8.7 at the tag.
FULLNODE_TAG: ""

jobs:
real-node:
name: real-node
if: github.event_name != 'schedule'
runs-on: ubuntu-24.04
timeout-minutes: 60
timeout-minutes: 90
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -76,7 +79,21 @@ jobs:
restore-keys: core-target-${{ env.RUST_TOOLCHAIN }}-
- name: The wasm core
run: core/scripts/build-wasm.sh
- name: System dependencies (building the vendored fullnode)
if: env.FULLNODE_TAG == ''
run: sudo apt-get update && sudo apt-get install -y clang libclang-dev
- name: rand-node and rand-prover from the vendored fullnode (no release on this constraint set yet)
if: env.FULLNODE_TAG == ''
working-directory: core/vendor/fullnode
run: |
cargo build --release --locked -p randprotocol-node -p randprotocol-prover
target/release/rand-node --version
{
echo "RAND_NODE_BIN=$PWD/target/release/rand-node"
echo "RAND_PROVER_BIN=$PWD/target/release/rand-prover"
} >> "$GITHUB_ENV"
- name: Download the fullnode ${{ env.FULLNODE_TAG }} release
if: env.FULLNODE_TAG != ''
env:
GH_TOKEN: ${{ github.token }}
run: |
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ STARK proof, keys are Poseidon2 hashes, envelopes are ML-KEM-768 + ChaCha20-Poly
primitives exist only in the fullnode's Rust crates, and a wallet that re-implemented them in
Swift, Java or JavaScript would have to be byte-identical to the node or every transfer is
refused. So `core/` vendors the fullnode crates (`core/vendor/fullnode`,
a submodule at fullnode `v0.8.5` `d8efd47` (v0.8.4 plus the audit v12 node fixes; constraint set 9, the `randprotocol-msig` signer checks with the payee check a signer runs, and the verified fold in the verify cache), chain 21 onward: **split authorisation**, where a transaction carries a bundle proof made from the viewing key and a small authorisation proof the wallet always makes itself from the spend key; **BIND-1**, a transaction bound to its chain's genesis; program state and the `Invoke` action (RPL-2); and the chain's bridge fee) and exposes one JSON entry point, `call(method, params)`, that each
a submodule at fullnode `feat/cs11-revendor` `60a7d03` (fullnode PR #194, the v0.8.7 candidate: **constraint set 11**, new Poseidon2 constants, so every commitment, nullifier, key and genesis hash moves; chain 22 only; before it `v0.8.5` `d8efd47`, constraint set 9, chain 21), with the `randprotocol-msig` signer checks with the payee check a signer runs, and the verified fold in the verify cache: **split authorisation**, where a transaction carries a bundle proof made from the viewing key and a small authorisation proof the wallet always makes itself from the spend key; **BIND-1**, a transaction bound to its chain's genesis; program state and the `Invoke` action (RPL-2); and the chain's bridge fee) and exposes one JSON entry point, `call(method, params)`, that each
client wraps: an XCFramework on iOS, a `.so` on Android, WebAssembly in the browser. Everything
above that line — the RPC client, note store, scan and send flow, key storage and the UI — is
Swift, Java and JavaScript.
Expand Down Expand Up @@ -202,7 +202,7 @@ cd clients
git checkout v0.8.3 && git submodule update --init # the newest clients release, rather than main
```

`v0.8.3` is the newest clients release tag. `v0.8.4` and `v0.8.5` are fullnode tags, not clients tags: `main` vendors fullnode v0.8.5, and there is no clients release built on it yet.
`v0.8.3` is the newest clients release tag. `v0.8.4` and `v0.8.5` are fullnode tags, not clients tags: `main` vendors fullnode `feat/cs11-revendor` `60a7d03` (constraint set 11, chain 22, the v0.8.7 candidate; v0.8.5 before it), and there is no clients release built on it yet.

**A `v0.8.x` tag on this repository is not always a wallet release.** At a node release every
repository of the project is tagged with the node's version, as a snapshot of the whole at that
Expand All @@ -215,7 +215,7 @@ The wallet releases are the tags that have a
snapshot tag.

or unpack `rand-wallet-<v>-source.tar.gz` from a release, which has the submodule in it already.
The submodule is the full node (`core/vendor/fullnode`, at `v0.8.5` `d8efd47`, v0.8.4 plus the audit v12 node fixes): the wallet's
The submodule is the full node (`core/vendor/fullnode`, at `feat/cs11-revendor` `60a7d03`, constraint set 11 for chain 22): the wallet's
cryptography is the node's own code.

### 3. Test the core (optional, about a minute)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public final class Prefs {
private static final String FILE = "rand_wallet_prefs";

public static final String DEFAULT_RPC_URL = "https://rpc.randprotocol.org";
public static final long DEFAULT_CHAIN_ID = 21;
public static final long DEFAULT_CHAIN_ID = 22;
public static final int DEFAULT_AUTO_LOCK_MINUTES = 15;

public static final String THEME_DARK = "dark";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,6 @@ public void theMultisigSentencesAreMappedAndEnglishIsTheInput() {
same(m);
}
// The crate's payee refusals are shown verbatim, by design (Task 3).
same("output 2 pays b9856a063c1fb742, not an expected recipient");
same("output 2 pays ae362e71c853c30f, not an expected recipient");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ static JSONObject output(JSONObject s, int i) throws Exception {
CheckSession c = new CheckSession();
CheckSession.Ticket t = c.begin("{p}");
c.land(t, summary(), signable());
c.setTyped("aak3");
c.setTyped("ss8z");
assertTrue(c.canSign("{p}"));
c.gate().rows().get(0).addr = recipient();
assertFalse("the editor holds other text", c.canSign("{p} "));
Expand Down Expand Up @@ -317,14 +317,14 @@ static JSONObject output(JSONObject s, int i) throws Exception {
c.gate().rows().get(0).amount = "12";
c.gate().edited();
c.land(t, summary(), signable());
c.setTyped("AAK3");
c.setTyped("SS8Z");
assertTrue(c.gate().stale());
assertFalse(c.canSign("{p}"));
c.gate().rows().get(0).amount = "10";
c.gate().edited();
CheckSession.Ticket t2 = c.begin("{p}");
c.land(t2, summary(), signable());
c.setTyped("AAK3");
c.setTyped("SS8Z");
assertTrue(c.canSign("{p}"));
assertEquals("Sign sends the list the review was checked with", payees(), c.reviewedPayees());
c.gate().adopt(List.of("rand1other:1"));
Expand All @@ -335,7 +335,7 @@ static JSONObject output(JSONObject s, int i) throws Exception {
CheckSession c = new CheckSession();
CheckSession.Ticket t = c.begin("{p}");
c.land(t, summary(), signable());
c.setTyped("aak3");
c.setTyped("ss8z");
c.refused(judge(summary(), 2020L));
assertEquals(Verdict.EXPIRED, c.review().judgement.verdict);
assertTrue(c.review().showsSummary());
Expand All @@ -346,16 +346,16 @@ static JSONObject output(JSONObject s, int i) throws Exception {
// ------------------------------------------------------------------ the confirmation

@Test public void theLastFourIgnoreDashesAndCase() throws Exception {
SignReview r = new SignReview(summary(), signable()); // NFYW-K8E9-E5K9-AAK3
assertTrue(r.canSign("aak3", false));
assertTrue(r.canSign("AAK3", false));
SignReview r = new SignReview(summary(), signable()); // SSJG-ERXD-74B6-SS8Z
assertTrue(r.canSign("ss8z", false));
assertTrue(r.canSign("SS8Z", false));
assertTrue(r.canSign("a-ak3", false));
assertTrue(r.canSign(" AA-K3 ", false));
assertFalse(r.canSign("aak", false));
assertFalse(r.canSign("9aak3", false));
assertFalse(r.canSign("9ss8z", false));
assertFalse(r.canSign("", false));
assertFalse("stale", r.canSign("aak3", true));
assertFalse(new SignReview(summary().put("policy_fingerprint", 5), signable()).canSign("aak3", false));
assertFalse("stale", r.canSign("ss8z", true));
assertFalse(new SignReview(summary().put("policy_fingerprint", 5), signable()).canSign("ss8z", false));
}

// ------------------------------------------------------------------ the review and refusals
Expand Down Expand Up @@ -401,7 +401,7 @@ static JSONObject output(JSONObject s, int i) throws Exception {
SignReview r = new SignReview(s, judge(bad, 2000L));
assertFalse(r.judgement.signable());
assertNotNull(r.refusal());
assertFalse(r.canSign("aak3", false));
assertFalse(r.canSign("ss8z", false));
r.lines();
r.fee();
r.expiresAt();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,13 +335,13 @@ static SignFlow.Judgement fee(JSONObject s, Long head, String maxFee) throws Exc
}

@Test public void confirmationIsTheLastFour() {
assertTrue(SignFlow.confirms("NFYW-K8E9-E5K9-AAK3", " aak3"));
assertTrue(SignFlow.confirms("NFYW-K8E9-E5K9-AAK3", "a-ak3"));
assertFalse(SignFlow.confirms("NFYW-K8E9-E5K9-AAK3", "aak"));
assertFalse(SignFlow.confirms("NFYW-K8E9-E5K9-AAK3", "9aak3"));
assertTrue(SignFlow.confirms("SSJG-ERXD-74B6-SS8Z", " ss8z"));
assertTrue(SignFlow.confirms("SSJG-ERXD-74B6-SS8Z", "a-ak3"));
assertFalse(SignFlow.confirms("SSJG-ERXD-74B6-SS8Z", "aak"));
assertFalse(SignFlow.confirms("SSJG-ERXD-74B6-SS8Z", "9ss8z"));
assertFalse(SignFlow.confirms("", ""));
assertFalse(SignFlow.confirms(null, "aak3"));
assertFalse(SignFlow.confirms("NFYW-K8E9-E5K9-AAK3", null));
assertFalse(SignFlow.confirms(null, "ss8z"));
assertFalse(SignFlow.confirms("SSJG-ERXD-74B6-SS8Z", null));
}

@Test public void linesAreTheCoresVerbatimAndFilesAreCleaned() throws Exception {
Expand Down Expand Up @@ -562,13 +562,13 @@ static void assertZeroed(byte[] b) {

@Test public void aCoreRefusalStillZeroesTheSeed() throws Exception {
FakeCore core = new FakeCore(summary());
core.signError = new Exception("output 2 pays b9856a063c1fb742, not an expected recipient");
core.signError = new Exception("output 2 pays ae362e71c853c30f, not an expected recipient");
FakeSeeds seeds = new FakeSeeds();
try {
flow(core, new FakeNode(2000L), seeds).sign("a1", PROPOSAL, payees(), null);
fail();
} catch (Exception e) {
assertEquals("output 2 pays b9856a063c1fb742, not an expected recipient", e.getMessage());
assertEquals("output 2 pays ae362e71c853c30f, not an expected recipient", e.getMessage());
}
assertZeroed(seeds.handed);
}
Expand Down Expand Up @@ -620,7 +620,7 @@ static void assertZeroed(byte[] b) {
SignFlow.Check c = flow(core, new FakeNode(2000L), new FakeSeeds()).check("a1", PROPOSAL, payees());
assertEquals(Verdict.SIGNABLE, c.judgement.verdict);
assertEquals(24, c.judgement.blocksLeft);
assertEquals("NFYW-K8E9-E5K9-AAK3", c.summary.getString("policy_fingerprint"));
assertEquals("SSJG-ERXD-74B6-SS8Z", c.summary.getString("policy_fingerprint"));
}

@Test public void anUnknownProfileOrAShareWithoutAnIndexRefuses() throws Exception {
Expand Down Expand Up @@ -754,9 +754,9 @@ private static JSONObject probe() throws Exception {
}

@Test public void theConfirmationIgnoresInnerWhitespaceAsTheWebDoes() {
assertTrue(SignFlow.confirms("NFYW-K8E9-E5K9-AAK3", "a a k 3"));
assertTrue(SignFlow.confirms("NFYW-K8E9-E5K9-AAK3", " A-A\tk3\n"));
assertTrue(SignFlow.confirms("NFYW-K8E9-E5K9-AAK3", "aa\u00A0k3"));
assertFalse(SignFlow.confirms("NFYW-K8E9-E5K9-AAK3", "a a k"));
assertTrue(SignFlow.confirms("SSJG-ERXD-74B6-SS8Z", "a a k 3"));
assertTrue(SignFlow.confirms("SSJG-ERXD-74B6-SS8Z", " A-A\tk3\n"));
assertTrue(SignFlow.confirms("SSJG-ERXD-74B6-SS8Z", "aa\u00A0k3"));
assertFalse(SignFlow.confirms("SSJG-ERXD-74B6-SS8Z", "a a k"));
}
}
10 changes: 5 additions & 5 deletions core/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading