Skip to content

Commit 6f174fc

Browse files
authored
Merge pull request #1 from EspressoSystems/nix-setup
Progress on nix env
2 parents d8cac43 + c479ffc commit 6f174fc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+1672
-254
lines changed

.dockerignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ solgen/go
1313
**/node_modules
1414

1515
target/**/*
16+
!target/machines
17+
!target/machines/*
18+
!target/machines/**/*
1619
brotli/buildfiles/**/*
1720

1821
# these are used by environment outside the docker:

.github/workflows/arbitrator-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ env:
2222
jobs:
2323
coverage:
2424
name: Run Arbitrator tests
25-
runs-on: ubuntu-8
25+
runs-on: ubuntu-latest
2626
steps:
2727
- name: Checkout
2828
uses: actions/checkout@v3

.github/workflows/ci.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ on:
1313
jobs:
1414
test:
1515
name: Go Tests
16-
runs-on: ubuntu-8
16+
container:
17+
image: ghcr.io/catthehacker/ubuntu:js-22.04
18+
runs-on: [self-hosted, X64]
1719

1820
# Creates a redis container for redis tests
1921
services:
@@ -34,7 +36,9 @@ jobs:
3436
submodules: true
3537

3638
- name: Install dependencies
37-
run: sudo apt update && sudo apt install -y wabt gotestsum
39+
run: >
40+
sudo apt update && sudo apt install -y wabt gotestsum
41+
cmake build-essential bison golang clang make wabt
3842
3943
- name: Setup nodejs
4044
uses: actions/setup-node@v3
@@ -75,13 +79,16 @@ jobs:
7579
toolchain: "stable"
7680
override: true
7781

82+
- name: Install cbindgen
83+
run: cargo install cbindgen
84+
7885
- name: Cache Build Products
7986
uses: actions/cache@v3
8087
with:
8188
path: |
8289
~/go/pkg/mod
8390
~/.cache/go-build
84-
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}-${{ matrix.test-mode }}
91+
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}-${{ matrix.test-mode }}
8592
restore-keys: ${{ runner.os }}-go-
8693

8794
- name: Cache Rust Build Products
@@ -137,8 +144,8 @@ jobs:
137144
138145
- name: Set environment variables
139146
run: |
140-
mkdir -p target/tmp/deadbeefbee
141-
echo "TMPDIR=$(pwd)/target/tmp/deadbeefbee" >> "$GITHUB_ENV"
147+
mkdir -p target/tmp/x
148+
echo "TMPDIR=$(pwd)/target/tmp/x" >> "$GITHUB_ENV"
142149
echo "GOMEMLIMIT=6GiB" >> "$GITHUB_ENV"
143150
echo "GOGC=80" >> "$GITHUB_ENV"
144151
@@ -156,7 +163,7 @@ jobs:
156163
157164
- name: run redis tests
158165
if: matrix.test-mode == 'defaults'
159-
run: TEST_REDIS=redis://localhost:6379/0 gotestsum --format short-verbose -- -p 1 -run TestRedis ./arbnode/... ./system_tests/... -coverprofile=coverage-redis.txt -covermode=atomic -coverpkg=./...
166+
run: TEST_REDIS=redis://redis:6379/0 gotestsum --format short-verbose -- -p 1 -run TestRedis ./arbnode/... ./system_tests/... -coverprofile=coverage-redis.txt -covermode=atomic -coverpkg=./...
160167

161168
- name: run challenge tests
162169
if: matrix.test-mode == 'challenge'
@@ -172,4 +179,3 @@ jobs:
172179
files: ./coverage.txt,./coverage-redis.txt
173180
verbose: false
174181
token: ${{ secrets.CODECOV_TOKEN }}
175-

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
analyze:
2727
name: Analyze
2828
if: github.repository == 'OffchainLabs/nitro' # don't run in any forks without "Advanced Security" enabled
29-
runs-on: ubuntu-8
29+
runs-on: ubuntu-latest
3030
permissions:
3131
actions: read
3232
contents: read

.github/workflows/docker.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ on:
1313
jobs:
1414
docker:
1515
name: Docker build
16-
runs-on: ubuntu-8
16+
runs-on: ubuntu-latest
1717
services:
1818
# local registery
1919
registry:
@@ -59,6 +59,17 @@ jobs:
5959
cache-from: type=local,src=/tmp/.buildx-cache
6060
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
6161

62+
- name: Start background nitro-testnode
63+
shell: bash
64+
run: |
65+
cd nitro-testnode
66+
./test-node.bash --init --dev &
67+
68+
- name: Wait for rpc to come up
69+
shell: bash
70+
run: |
71+
${{ github.workspace }}/.github/workflows/waitForNitro.sh
72+
6273
- name: Print WAVM module root
6374
id: module-root
6475
run: |

.github/workflows/waitForNitro.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# poll the nitro endpoint until we get a 0 return code
2+
while true
3+
do
4+
curl -X POST -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":45678,"method":"eth_chainId","params":[]}' 'http://localhost:8547'
5+
if [ "$?" -eq "0" ]; then
6+
exit 0
7+
else
8+
sleep 20
9+
fi
10+
done

.golangci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ linters-settings:
4545
gosec:
4646
excludes:
4747
- G404 # checks that random numbers are securely generated
48+
- G114
4849

4950
govet:
5051
enable-all: true

CODEOWNERS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# These owners will be the default owners for everything in the repo. Unless a
2+
# later match takes precedence, they will be requested for review when someone
3+
# opens a pull request.
4+
5+
* @ImJeremyHe @nomaxg @philippecamacho @sveitser @jbearer

arbitrator/prover/src/main.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -383,9 +383,7 @@ fn main() -> Result<()> {
383383
while let Some((module, func, profile)) = func_stack.pop() {
384384
sum.total_cycles += profile.total_cycles;
385385
sum.count += profile.count;
386-
let entry = func_profile
387-
.entry((module, func))
388-
.or_insert_with(SimpleProfile::default);
386+
let entry = func_profile.entry((module, func)).or_default();
389387
entry.count += sum.count;
390388
entry.total_cycles += sum.total_cycles;
391389
entry.local_cycles += profile.local_cycles;

arbitrator/prover/test-cases/go/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ func main() {
8989
verified, err = MerkleSample(data, -1)
9090
if err != nil {
9191
if verified {
92-
panic("succeded to verify proof invalid")
92+
panic("succeeded to verify proof invalid")
9393
}
9494
}
9595

0 commit comments

Comments
 (0)