Skip to content
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

Fix: remove handlemsg #20

Closed
wants to merge 98 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
d3958c4
Fix/sync test scenarios (#59)
kaiden-araki Nov 13, 2024
d36379f
add ci reporting to workflows
Intizar-T Nov 13, 2024
4540b0b
add develop to workflows
Intizar-T Nov 14, 2024
58a5825
fix/ correct the expected nonce for generateErrorTestCase in TIL
kaiden-araki Nov 14, 2024
be9dc7b
Feature: Updates for coordinator, tx-processor and zki initial implem…
Shailu-s Nov 14, 2024
268d396
fix/add applyVouch func to update nonce, re-add amount into L2Tx and …
kaiden-araki Nov 15, 2024
5f57808
Fix/sync test scenarios (#69)
kaiden-araki Nov 15, 2024
bac8561
implement synchronizer tests workflow
Intizar-T Nov 15, 2024
df42d22
clean up tables after each test
Intizar-T Nov 15, 2024
8b3eab5
run all sequencer tests on PR to main
Intizar-T Nov 15, 2024
bf2c39f
saving progress for historydb tests
Intizar-T Nov 13, 2024
ec46a9b
implement TestSetExtraInfoForgedL1UserTxs
Intizar-T Nov 13, 2024
c2c9ab5
provide default zero value for batch gas price
Intizar-T Nov 14, 2024
21dcfeb
implement TestUpdateExitTree
Intizar-T Nov 14, 2024
05f8e6c
adjust testtxs to new updates
Intizar-T Nov 14, 2024
913675a
adjust TestUpdateExitTree to execute
Intizar-T Nov 14, 2024
0fea557
implement TestAddBucketUpdates
Intizar-T Nov 15, 2024
8c59148
reset db after tests complete
Intizar-T Nov 15, 2024
2833ab8
add empty account name check to til accounts
Intizar-T Nov 15, 2024
061f3eb
wrap up historydb tests
Intizar-T Nov 15, 2024
fc69854
remove delayed withdraw func from historydb
Intizar-T Nov 18, 2024
8dbd4da
set gas price to zero
Intizar-T Nov 18, 2024
3b841f6
implement statedb unit tests and workflow (#71)
Intizar-T Nov 19, 2024
7b963e3
implement test cleanup in sync tests (#72)
Intizar-T Nov 19, 2024
c726c34
set coord & sync and call start funcs
Intizar-T Nov 24, 2024
7bc68e2
cleanup main and related files
Intizar-T Nov 25, 2024
d2b79b7
comment out verifier idx from coordinator config
Intizar-T Nov 27, 2024
82d1ea1
Merge pull request #1 from tokamak-network/feat/cleanup-node
Intizar-T Nov 27, 2024
b80ec3b
feat/handle new block for sync scenario
kaiden-araki Nov 28, 2024
a5303de
feat/add go routine for sync
kaiden-araki Nov 28, 2024
e4ae642
fix/remove slot
kaiden-araki Nov 28, 2024
c702323
fix/remove recommendedFee from stateAPI strcut
kaiden-araki Nov 28, 2024
35c9f58
Merge pull request #2 from tokamak-network/feat/start-sync
kaiden-araki Nov 29, 2024
05d2238
implement go linter
Intizar-T Dec 1, 2024
46d8dce
fix lint logic in historydb workflow
Intizar-T Dec 1, 2024
6005828
cd into sequencer to run linting
Intizar-T Dec 1, 2024
f9f0ee8
separate linter install and run steps
Intizar-T Dec 1, 2024
2c1c73c
lint all relevant directories and files in historydb workflow
Intizar-T Dec 1, 2024
d8411e7
add linting to all workflows and update readme
Intizar-T Dec 1, 2024
dadc088
Merge pull request #3 from tokamak-network/feat/go-lint
Intizar-T Dec 2, 2024
9a1179c
added basic sync and forger setup
Shailu-s Dec 2, 2024
2049e3c
feat/remove ProcessL1&L2Txs and update ProcessTxs to handle only L1Us…
kaiden-araki Dec 2, 2024
afded9a
include go extension url
Intizar-T Dec 2, 2024
57869cb
Updated code to add constant
Shailu-s Dec 2, 2024
a90ad34
Merge pull request #5 from tokamak-network/chore/update-sequencer-readme
Intizar-T Dec 2, 2024
6c4757d
add task run seq command
Intizar-T Dec 2, 2024
0331225
include go task installation link for different os
Intizar-T Dec 2, 2024
3241b0f
Merge pull request #6 from tokamak-network/chore/seq-readme-run-server
Shailu-s Dec 2, 2024
edbfd60
lint entire seq directory on any go file change
Intizar-T Dec 3, 2024
2655121
Merge pull request #4 from tokamak-network/feat/node-setup
Shailu-s Dec 3, 2024
8ba967b
Merge pull request #7 from tokamak-network/fix/lint-seq
Shailu-s Dec 3, 2024
c55539f
feat/remove ProcessL1&L2Txs and update ProcessTxs to handle only L1Us…
kaiden-araki Dec 2, 2024
f3d0f16
fix/test for only l1txs
kaiden-araki Dec 3, 2024
ff67002
Merge branch 'feat/txProcessor_update' of https://github.com/tokamak-…
kaiden-araki Dec 3, 2024
d84c9bd
fix/historydb_test
kaiden-araki Dec 4, 2024
e2832a8
reject commit if linting fails
Intizar-T Dec 4, 2024
e18f5a7
chore: modify .gitignore file
DarkKnight3074 Dec 4, 2024
ee78326
feat: add interface file, mvp contract and mvp helper contract
DarkKnight3074 Dec 4, 2024
7eeb4f8
test: add helper file for testing
DarkKnight3074 Dec 4, 2024
855048e
test: add test-cases for Sybil contract
DarkKnight3074 Dec 4, 2024
02c7af4
fix/synchronizer_test
kaiden-araki Dec 5, 2024
cd3f06e
Revert "fix/synchronizer_test"
kaiden-araki Dec 5, 2024
ed81742
fix/synchronizer_test
kaiden-araki Dec 5, 2024
1a78a0d
Merge pull request #9 from tokamak-network/fix/constructor-removing
DarkKnight3074 Dec 5, 2024
10800c2
Merge pull request #8 from tokamak-network/fix/linting-precommit
Intizar-T Dec 5, 2024
5ab65f6
test: add testestForceExitTransaction()
DarkKnight3074 Dec 5, 2024
ac1a0bf
test: add testForceExplodeTransaction()
DarkKnight3074 Dec 5, 2024
472e55d
test: add testInitializeWithInvalidPoseidonAddresses()
DarkKnight3074 Dec 5, 2024
ae96131
fixed node setup and initialization
Shailu-s Dec 5, 2024
fb0892e
test: add testInitializeWithInvalidVerifierAddresses()
DarkKnight3074 Dec 5, 2024
2b87aca
test: add testWithdrawMerkleProofTransferFails()
DarkKnight3074 Dec 5, 2024
6a3da5f
test: add testWithdrawMerkleProofTransferPasses()
DarkKnight3074 Dec 5, 2024
d826cee
fix/add_l1tx_typecheck
kaiden-araki Dec 6, 2024
069e9b9
fix/change type checking
kaiden-araki Dec 6, 2024
5350ec8
Merge pull request #10 from tokamak-network/feat/txProcessor_update
kaiden-araki Dec 6, 2024
60b28b6
fixing tests
Shailu-s Dec 6, 2024
702126c
Merge branch 'develop' into fix/node-setup
Shailu-s Dec 6, 2024
352f152
Updated history DB test
Shailu-s Dec 6, 2024
ad75b99
Merge pull request #12 from tokamak-network/test/mvp-sybil
DarkKnight3074 Dec 6, 2024
d9430d5
Updated gitIgnore and readme file
Shailu-s Dec 9, 2024
5f21a8d
Merge branch 'develop' of https://github.com/tokamak-network/tokamak-…
kaiden-araki Dec 9, 2024
95fd81a
Updated keystore creation
Shailu-s Dec 9, 2024
c5492ae
minor update in read me file
Shailu-s Dec 9, 2024
01ff06a
Handled error
Shailu-s Dec 9, 2024
340c821
Merge pull request #11 from tokamak-network/fix/node-setup
Shailu-s Dec 9, 2024
f9cc71d
restore checking forger address in local keystore
Intizar-T Dec 9, 2024
d8b826e
Merge branch 'develop' of https://github.com/tokamak-network/tokamak-…
kaiden-araki Dec 10, 2024
afd9b45
add sybil.go and update rollup
kaiden-araki Dec 10, 2024
4458f5d
fix/rename rollupVerifiers
kaiden-araki Dec 10, 2024
2535388
Merge pull request #15 from tokamak-network/fix/node-start-keystore
Intizar-T Dec 10, 2024
76942aa
base coord setup
Intizar-T Dec 7, 2024
5dc3c9a
reimplement stateroot
Intizar-T Dec 7, 2024
9238094
fix/rollup initialize
kaiden-araki Dec 10, 2024
ec3a4ff
fix/update maxTx and nLevel based on SC
kaiden-araki Dec 11, 2024
5e6d69d
Merge pull request #13 from tokamak-network/feat/base-coord-setup
Intizar-T Dec 11, 2024
d27744c
Merge pull request #17 from tokamak-network/fix/rollup-sc
kaiden-araki Dec 12, 2024
58504e0
add account, vouch, and score state roots to batch
Intizar-T Dec 14, 2024
160c752
Merge pull request #19 from tokamak-network/feat/add-state-roots-to-b…
Intizar-T Dec 16, 2024
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
17 changes: 15 additions & 2 deletions .github/workflows/historydb.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ on:
push:
branches-ignore:
- "main"
- "develop"
paths:
- "sequencer/database/historydb/**"
- "sequencer/test/til/**"
- "sequencer/database/utils.go"
workflow_dispatch:

jobs:
core-build:
syb-historydb-test:
strategy:
fail-fast: false
runs-on: ubuntu-latest
Expand Down Expand Up @@ -49,6 +51,17 @@ jobs:
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Install golanci-lint
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.62.2

- name: Run golangci-lint on historydb & til & database/utils.go
run: |
cd ./sequencer
golangci-lint run ./database/utils.go
golangci-lint run ./database/historydb/...
golangci-lint run ./test/til/...

- name: Run historydb tests
run: |
cd ./sequencer
Expand All @@ -59,4 +72,4 @@ jobs:
PGUSER: "postgres"
PGPASSWORD: "postgres"
PGDATABASE: "statedb"

CI: true
12 changes: 11 additions & 1 deletion .github/workflows/sequencer.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
workflow_dispatch:

jobs:
core-build:
syb-sequencer-tests:
strategy:
fail-fast: false
runs-on: ubuntu-latest
Expand Down Expand Up @@ -49,6 +49,15 @@ jobs:
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Install golanci-lint
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.62.2

- name: Run golangci-lint on sequencer
run: |
cd ./sequencer
golangci-lint run ./...

- name: Run all tests
run: |
cd ./sequencer
Expand All @@ -59,4 +68,5 @@ jobs:
PGUSER: "postgres"
PGPASSWORD: "postgres"
PGDATABASE: "statedb"
CI: true

75 changes: 75 additions & 0 deletions .github/workflows/statedb.test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: "SYB statedb test"

on:
push:
branches-ignore:
- "main"
- "develop"
paths:
- "sequencer/database/statedb/**"
- "sequencer/test/til/**"
- "sequencer/database/utils.go"
workflow_dispatch:

jobs:
syb-statedb-test:
strategy:
fail-fast: false
runs-on: ubuntu-latest
timeout-minutes: 10

services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: statedb
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.22.5"
check-latest: true
cache-dependency-path: |
./sequencer/go.sum

- name: Install dependencies
run: |
cd ./sequencer
go mod tidy

- name: Install Task
uses: arduino/setup-task@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Install golanci-lint
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.62.2

- name: Run golangci-lint on statedb & til & database/utils.go
run: |
cd ./sequencer
golangci-lint run ./database/utils.go
golangci-lint run ./database/statedb/...
golangci-lint run ./test/til/...

- name: Run statedb tests
run: |
cd ./sequencer
task test-statedb
env:
PGHOST: "localhost"
PGPORT: "5432"
PGUSER: "postgres"
PGPASSWORD: "postgres"
PGDATABASE: "statedb"
CI: true
79 changes: 79 additions & 0 deletions .github/workflows/synchronizer.test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: "SYB synchronizer test"

on:
push:
branches-ignore:
- "main"
- "develop"
paths:
- "sequencer/synchronizer/**"
- "sequencer/database/historydb/**"
- "sequencer/database/l2db/**"
- "sequencer/database/statedb/**"
- "sequencer/txprocessor/**"
- "sequencer/test/til/**"
workflow_dispatch:

jobs:
syb-synchronizer-test:
strategy:
fail-fast: false
runs-on: ubuntu-latest
timeout-minutes: 10

services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: statedb
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.22.5"
check-latest: true
cache-dependency-path: |
./sequencer/go.sum

- name: Install dependencies
run: |
cd ./sequencer
go mod tidy

- name: Install Task
uses: arduino/setup-task@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Install golanci-lint
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.62.2

- name: Run golangci-lint on database & til & txprocessor & synchronizer
run: |
cd ./sequencer
golangci-lint run ./database/...
golangci-lint run ./test/til/...
golangci-lint run ./txprocessor/...
golangci-lint run ./synchronizer/...

- name: Run synchronizer tests
run: |
cd ./sequencer
task test-synchronizer
env:
PGHOST: "localhost"
PGPORT: "5432"
PGUSER: "postgres"
PGPASSWORD: "postgres"
PGDATABASE: "statedb"
CI: true
13 changes: 12 additions & 1 deletion .github/workflows/til.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ on:
push:
branches-ignore:
- "main"
- "develop"
paths:
- "sequencer/test/til/**"
- "!sequencer/test/til/README.md"
workflow_dispatch:

jobs:
core-build:
syb-til-test:
strategy:
fail-fast: false
runs-on: ubuntu-latest
Expand Down Expand Up @@ -48,6 +49,15 @@ jobs:
uses: arduino/setup-task@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Install golanci-lint
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.62.2

- name: Run golangci-lint on til
run: |
cd ./sequencer
golangci-lint run ./test/til/...

- name: Run TIL tests
run: |
Expand All @@ -60,4 +70,5 @@ jobs:
PGPASSWORD: "postgres"
PGDATABASE: "statedb"
DEBUG: "true"
CI: true

5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ circuits/scoring_algorithm_js/

#setup
*.ptau

tmp
#zkey
*.zkey
verification_key.json
Expand All @@ -22,4 +22,5 @@ public.json
sequencer/.env

# etc
.DS_Store
.DS_Store
var
2 changes: 2 additions & 0 deletions contracts/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ docs/

# Dotenv file
.env

node_modules/
81 changes: 81 additions & 0 deletions contracts/src/interfaces/IMVPSybil.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.23;

interface IMVPSybil {
error InvalidVerifierAddress();
error InvalidCreateAccountTransaction();
error InvalidDepositTransaction();
error InvalidForceExitTransaction();
error InvalidForceExplodeTransaction();
error InternalTxNotAllowed();
error BatchTimeoutExceeded();
error LoadAmountExceedsLimit();
error LoadAmountDoesNotMatch();
error AmountExceedsLimit();
error InvalidTransactionParameters();
error WithdrawAlreadyDone();
error SmtProofInvalid();
error EthTransferFailed();
error InvalidProof();



// Initialization function
function initialize(
address[] memory verifiers,
uint256[] memory maxTxs,
uint256[] memory nLevels,
uint8 _forgeL1L2BatchTimeout,
address _poseidon2Elements,
address _poseidon3Elements,
address _poseidon4Elements
) external;

// L1 Transaction functions
function _addTx(
address ethAddress,
uint48 fromIdx,
uint40 loadAmountF,
uint40 amountF,
uint48 toIdx
) external;

// Batch forging function
function forgeBatch(
uint48 newLastIdx,
uint256 newStRoot,
uint256 newVouchRoot,
uint256 newScoreRoot,
uint256 newExitRoot,
uint8 verifierIdx,
uint256[2] calldata proofA,
uint256[2][2] calldata proofB,
uint256[2] calldata proofC,
uint256 input
) external;

// Getter functions
function getStateRoot(uint32 batchNum) external view returns (uint256);
function getLastForgedBatch() external view returns (uint32);

// L1 Transaction Queue functions
function getL1TransactionQueue(
uint32 queueIndex
) external view returns (bytes memory);
function getQueueLength() external view returns (uint32);

// Creating the Account
function createAccount() external payable;

// Deposting Fucnction
function deposit(uint48 fromIdx, uint40 loadAmountF, uint40 amountF) external payable;

//
function exit(uint48 fromIdx, uint40 loadAmountF, uint40 amountF) external payable;

function explode(uint48 fromIdx, uint40 loadAmountF, uint40 amountF) external payable;

function setForgeL1BatchTimeout(uint8 newTimeout) external pure;


}
Loading
Loading