Skip to content

Commit 4b4ad95

Browse files
committed
fix: public input hash incorrect
1 parent 781e89c commit 4b4ad95

File tree

6 files changed

+38
-38
lines changed

6 files changed

+38
-38
lines changed

‎common-files/classes/public-inputs.mjs

+1-7
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,8 @@ class PublicInputs {
1717

1818
constructor(publicInputs) {
1919
// some inputs may be general numbers and some strings. We convert all to string, process and generalise.
20-
this.publicInputs = generalise(
21-
generalise(publicInputs.flat(Infinity))
22-
.all.hex()
23-
.map(pi => pi.toLowerCase()),
24-
);
25-
console.log('PUBLIC INPUTS', this.publicInputs);
20+
this.publicInputs = generalise(publicInputs.flat(Infinity));
2621
[, this.hash] = generalise(sha256(this.publicInputs).limbs(248, 2));
27-
console.log('HASH', this.hash);
2822
}
2923
}
3024

‎nightfall-client/src/services/database.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export async function getLatestTree() {
4040
const timberObjArr = await db
4141
.collection(TIMBER_COLLECTION)
4242
.find()
43-
.sort({ _id: -1 })
43+
.sort({ blockNumberL2: -1 })
4444
.limit(1)
4545
.toArray();
4646

‎nightfall-client/src/services/transfer.mjs

+6
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,12 @@ async function transfer(transferParams) {
114114
const leafIndices = commitmentTreeInfo.map(l => l.leafIndex);
115115
const blockNumberL2s = commitmentTreeInfo.map(l => l.isOnChain);
116116
const roots = commitmentTreeInfo.map(l => l.root);
117+
console.log(
118+
'Constructing transfer transaction with blockNumberL2s',
119+
blockNumberL2s,
120+
'and roots',
121+
roots,
122+
);
117123

118124
// public inputs
119125
const publicInputs = new PublicInputs([

‎test/ping-pong/docker-compose.host.docker.internal.yml

+13-13
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,16 @@ services:
5555
ZKP_MNEMONIC: tone shadow woman critic glare utility brass scheme edge brisk enforce champion
5656

5757

58-
user-local2:
59-
extra_hosts:
60-
- 'host.docker.internal:host-gateway'
61-
environment:
62-
BLOCKCHAIN_WS_HOST: host.docker.internal
63-
BLOCKCHAIN_PORT: 8546
64-
USER_ETHEREUM_SIGNING_KEY: eed50965cbe8268a3ee0a24afc2f31c434a7d568bdff73a89783711c91ca1c67
65-
USER_ADDRESS: '0x4637Ee1126723e098A152f33F326fb767A6A2b8A'
66-
TEST_LENGTH: 24
67-
ERC20_NAME: ERC20Mock
68-
RECIPIENT_PKD: 0x193a37cd7973373aceae05d133f3d69ab6e7ef2f4321461173871ec7611244e2,0x27234a8721e73c9aa160154ee63d2470101fc5fd841221eeb675a91ec2d66e78
69-
ZKP_MNEMONIC:
70-
tiger victory velvet tank ritual column horse conduct athlete position soul shaft
58+
# user-local2:
59+
# extra_hosts:
60+
# - 'host.docker.internal:host-gateway'
61+
# environment:
62+
# BLOCKCHAIN_WS_HOST: host.docker.internal
63+
# BLOCKCHAIN_PORT: 8546
64+
# USER_ETHEREUM_SIGNING_KEY: eed50965cbe8268a3ee0a24afc2f31c434a7d568bdff73a89783711c91ca1c67
65+
# USER_ADDRESS: '0x4637Ee1126723e098A152f33F326fb767A6A2b8A'
66+
# TEST_LENGTH: 24
67+
# ERC20_NAME: ERC20Mock
68+
# RECIPIENT_PKD: 0x193a37cd7973373aceae05d133f3d69ab6e7ef2f4321461173871ec7611244e2,0x27234a8721e73c9aa160154ee63d2470101fc5fd841221eeb675a91ec2d66e78
69+
# ZKP_MNEMONIC:
70+
# tiger victory velvet tank ritual column horse conduct athlete position soul shaft

‎test/ping-pong/docker-compose.yml

+15-15
Original file line numberDiff line numberDiff line change
@@ -131,21 +131,21 @@ services:
131131
BLOCKCHAIN_WS_HOST: blockchain1
132132
BLOCKCHAIN_PORT: 8546
133133

134-
user-local2:
135-
image: ghcr.io/eyblockchain/nightfall3-user-local:latest
136-
build:
137-
dockerfile: user-local.Dockerfile
138-
context: ../../
139-
networks:
140-
- pong_network
141-
environment:
142-
OPTIMIST_HOST: optimist
143-
OPTIMIST_WS_PORT: 8080
144-
OPTIMIST_HTTP_PORT: 80
145-
CLIENT_HOST: client
146-
CLIENT_PORT: 80
147-
BLOCKCHAIN_WS_HOST: blockchain1
148-
BLOCKCHAIN_PORT: 8546
134+
# user-local2:
135+
# image: ghcr.io/eyblockchain/nightfall3-user-local:latest
136+
# build:
137+
# dockerfile: user-local.Dockerfile
138+
# context: ../../
139+
# networks:
140+
# - pong_network
141+
# environment:
142+
# OPTIMIST_HOST: optimist
143+
# OPTIMIST_WS_PORT: 8080
144+
# OPTIMIST_HTTP_PORT: 80
145+
# CLIENT_HOST: client
146+
# CLIENT_PORT: 80
147+
# BLOCKCHAIN_WS_HOST: blockchain1
148+
# BLOCKCHAIN_PORT: 8546
149149

150150
volumes:
151151
mongodb:

‎test/ping-pong/pong-apps

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@ done
2525
# shut down cleanly in the event of a cntl-c etc. We don't want to leave containers running
2626
trap "exit 1" SIGHUP SIGINT SIGTERM
2727

28-
docker-compose -f docker-compose.yml $FILE up -d --remove-orphans proposer user-local1 user-local2
29-
docker-compose logs -f proposer user-local1 user-local2
28+
docker-compose -f docker-compose.yml $FILE up -d --remove-orphans proposer user-local1 #user-local2
29+
docker-compose logs -f proposer user-local1 #user-local2

0 commit comments

Comments
 (0)