Skip to content

Commit

Permalink
Merge pull request #1 from EspressoSystems/nix-setup
Browse files Browse the repository at this point in the history
Progress on nix env
  • Loading branch information
nomaxg authored Oct 30, 2023
2 parents d8cac43 + c479ffc commit 6f174fc
Show file tree
Hide file tree
Showing 63 changed files with 1,672 additions and 254 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ solgen/go
**/node_modules

target/**/*
!target/machines
!target/machines/*
!target/machines/**/*
brotli/buildfiles/**/*

# these are used by environment outside the docker:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/arbitrator-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ env:
jobs:
coverage:
name: Run Arbitrator tests
runs-on: ubuntu-8
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down
20 changes: 13 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ on:
jobs:
test:
name: Go Tests
runs-on: ubuntu-8
container:
image: ghcr.io/catthehacker/ubuntu:js-22.04
runs-on: [self-hosted, X64]

# Creates a redis container for redis tests
services:
Expand All @@ -34,7 +36,9 @@ jobs:
submodules: true

- name: Install dependencies
run: sudo apt update && sudo apt install -y wabt gotestsum
run: >
sudo apt update && sudo apt install -y wabt gotestsum
cmake build-essential bison golang clang make wabt
- name: Setup nodejs
uses: actions/setup-node@v3
Expand Down Expand Up @@ -75,13 +79,16 @@ jobs:
toolchain: "stable"
override: true

- name: Install cbindgen
run: cargo install cbindgen

- name: Cache Build Products
uses: actions/cache@v3
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}-${{ matrix.test-mode }}
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}-${{ matrix.test-mode }}
restore-keys: ${{ runner.os }}-go-

- name: Cache Rust Build Products
Expand Down Expand Up @@ -137,8 +144,8 @@ jobs:
- name: Set environment variables
run: |
mkdir -p target/tmp/deadbeefbee
echo "TMPDIR=$(pwd)/target/tmp/deadbeefbee" >> "$GITHUB_ENV"
mkdir -p target/tmp/x
echo "TMPDIR=$(pwd)/target/tmp/x" >> "$GITHUB_ENV"
echo "GOMEMLIMIT=6GiB" >> "$GITHUB_ENV"
echo "GOGC=80" >> "$GITHUB_ENV"
Expand All @@ -156,7 +163,7 @@ jobs:
- name: run redis tests
if: matrix.test-mode == 'defaults'
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=./...
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=./...

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

2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
analyze:
name: Analyze
if: github.repository == 'OffchainLabs/nitro' # don't run in any forks without "Advanced Security" enabled
runs-on: ubuntu-8
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
Expand Down
13 changes: 12 additions & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
jobs:
docker:
name: Docker build
runs-on: ubuntu-8
runs-on: ubuntu-latest
services:
# local registery
registry:
Expand Down Expand Up @@ -59,6 +59,17 @@ jobs:
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

- name: Start background nitro-testnode
shell: bash
run: |
cd nitro-testnode
./test-node.bash --init --dev &
- name: Wait for rpc to come up
shell: bash
run: |
${{ github.workspace }}/.github/workflows/waitForNitro.sh
- name: Print WAVM module root
id: module-root
run: |
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/waitForNitro.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# poll the nitro endpoint until we get a 0 return code
while true
do
curl -X POST -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":45678,"method":"eth_chainId","params":[]}' 'http://localhost:8547'
if [ "$?" -eq "0" ]; then
exit 0
else
sleep 20
fi
done
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ linters-settings:
gosec:
excludes:
- G404 # checks that random numbers are securely generated
- G114

govet:
enable-all: true
Expand Down
5 changes: 5 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# These owners will be the default owners for everything in the repo. Unless a
# later match takes precedence, they will be requested for review when someone
# opens a pull request.

* @ImJeremyHe @nomaxg @philippecamacho @sveitser @jbearer
4 changes: 1 addition & 3 deletions arbitrator/prover/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -383,9 +383,7 @@ fn main() -> Result<()> {
while let Some((module, func, profile)) = func_stack.pop() {
sum.total_cycles += profile.total_cycles;
sum.count += profile.count;
let entry = func_profile
.entry((module, func))
.or_insert_with(SimpleProfile::default);
let entry = func_profile.entry((module, func)).or_default();
entry.count += sum.count;
entry.total_cycles += sum.total_cycles;
entry.local_cycles += profile.local_cycles;
Expand Down
2 changes: 1 addition & 1 deletion arbitrator/prover/test-cases/go/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func main() {
verified, err = MerkleSample(data, -1)
if err != nil {
if verified {
panic("succeded to verify proof invalid")
panic("succeeded to verify proof invalid")
}
}

Expand Down
Loading

0 comments on commit 6f174fc

Please sign in to comment.