Skip to content

Feat/use solidity source #64

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
19 changes: 19 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true

- name: Set up Go
uses: actions/setup-go@v3
Expand Down Expand Up @@ -63,13 +65,20 @@ jobs:
run: |
go mod download

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Cache binaries
uses: actions/cache@v3
id: cache-bin
with:
path: ${{ runner.temp }}/bin
key: ${{ runner.os }}-binaries

- name: Build Contracts
run: |
forge build --force

- name: Download geth and reth
if: steps.cache-bin.outputs.cache-hit != 'true'
run: |
Expand Down Expand Up @@ -118,4 +127,14 @@ jobs:
--config ./configs/contract.yml \
--root-dir ${{ runner.temp }}/data-dir \
--output-dir ${{ runner.temp }}/output \
--geth-bin ${{ runner.temp }}/bin/geth
- name: Run ERC20 Benchmark
id: erc20
run: |
go run benchmark/cmd/main.go \
--log.level info \
run \
--config ./configs/erc20.yml \
--root-dir ${{ runner.temp }}/data-dir \
--output-dir ${{ runner.temp }}/output \
--geth-bin ${{ runner.temp }}/bin/geth
11 changes: 10 additions & 1 deletion .github/workflows/public-benchmarks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: true

- name: Set up Go
uses: actions/setup-go@v3
Expand All @@ -30,6 +32,13 @@ jobs:
path: ${{ runner.temp }}/bin
key: ${{ runner.os }}-binaries

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Build Contracts
run: |
forge build --force

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to use --force here?


- name: Download geth and reth
if: steps.cache-bin.outputs.cache-hit != 'true'
run: |
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
data-dir/
output/
.vercel

contracts/cache/
contracts/out/
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "contracts/lib/openzeppelin"]
path = contracts/lib/openzeppelin
url = https://github.com/OpenZeppelin/openzeppelin-contracts
[submodule "contracts/lib/forge-std"]
path = contracts/lib/forge-std
url = https://github.com/foundry-rs/forge-std
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,13 @@ LDFLAGSSTRING +=-X main.GitDate=$(GITDATE)
LDFLAGSSTRING +=-X main.Version=$(VERSION)
LDFLAGS := -ldflags "$(LDFLAGSSTRING)"

.PHONY: contracts
contracts:
forge build --force

.PHONY: build
build:
env GO111MODULE=on GOOS=$(TARGETOS) GOARCH=$(TARGETARCH) CGO_ENABLED=0 go build -v $(LDFLAGS) -o ./bin/base-bench ./benchmark/cmd
forge build --force && env GO111MODULE=on GOOS=$(TARGETOS) GOARCH=$(TARGETARCH) CGO_ENABLED=0 go build -v $(LDFLAGS) -o ./bin/base-bench ./benchmark/cmd

.PHONY: clean
clean:
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ Base Benchmark provides comprehensive testing capabilities:

## 📋 Quick Start

[Install Forge](https://book.getfoundry.sh/getting-started/installation)

Recursively clone github submodules:

```bash
git submodule update --init --recursive
```

```bash
# Build the application
make build
Expand Down
2 changes: 1 addition & 1 deletion configs/contract.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
variables:
- type: transaction_workload
values:
- contract:1:ecpairing(uint256,bytes):10000000:0x:./contracts/ecpairing.hex
- contract:1:ecpairing(uint256,bytes):10000000:0x:Precompile
- type: node_type
values:
- geth
Expand Down
1 change: 0 additions & 1 deletion configs/contracts/ecpairing.hex

This file was deleted.

Loading
Loading