Skip to content
This repository was archived by the owner on Aug 4, 2025. It is now read-only.

Commit f06b07a

Browse files
authored
Upload go filler (#147)
* update * update readme and remove test code * remove * add disclaimer to prover package
1 parent 0d57596 commit f06b07a

36 files changed

Lines changed: 8273 additions & 0 deletions

services/go-filler/Makefile

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
ORG := base-org
2+
PROJECT := RRC-7755-poc
3+
VERSION := $(shell git describe --tags)
4+
BUILD := $(shell git rev-parse --short HEAD)
5+
6+
#
7+
# Tool Prerequisites Check
8+
# This ensures that you have the necessary executables installed to run this makefile.
9+
#
10+
GEN_PREREQUISITES = mockgen
11+
BUILD_PREREQUISITES = git go
12+
VALIDATION_PREREQUISITES = golangci-lint
13+
14+
#
15+
# Build Options
16+
# Typical inputs to the build targets found below.
17+
#
18+
TARGET=target
19+
BIN=$(TARGET)/bin
20+
LDFLAGS=-ldflags "-X=main.Version=$(VERSION) -X=main.Build=$(BUILD)"
21+
22+
23+
#
24+
# Informational Targets
25+
# These rarely change, and only serve to print out helpful details about this makefile.
26+
#
27+
.PHONY: usage
28+
usage:
29+
@ echo "Usage: make [`cat Makefile | grep "^[A-z\%\-]*:" | awk '{print $$1}' | sed "s/://g" | sed "s/%/[1-3]/g" | xargs`]"
30+
31+
.PHONY: info
32+
info:
33+
@ echo ORG: $(ORG)
34+
@ echo PROJECT: $(PROJECT)
35+
@ echo VERSION: $(VERSION)
36+
@ echo BUILD: $(BUILD)
37+
38+
#
39+
# Build Targets
40+
# These are the primary developer workflow targets for building the software.
41+
#
42+
.PHONY: clean
43+
clean: info
44+
@ rm -rf target
45+
@ go mod tidy
46+
47+
.PHONY: build_deps
48+
build_deps: info clean
49+
@ printf $(foreach exec,$(BUILD_PREREQUISITES), \
50+
$(if $(shell which $(exec)),"", \
51+
$(error "No $(exec) in PATH. Prerequisites are: $(BUILD_PREREQUISITES)")))
52+
53+
54+
.PHONY: gen
55+
gen: info clean
56+
@ echo "Generating mocks..."
57+
@ mockgen -destination=internal/client/mocks/eth_client_mock.go -mock_names EthClient=MockEthClient -package=mocks github.com/base-org/RRC-7755-poc/internal/client EthClient
58+
@ mockgen -destination=internal/prover/mocks/eth_rpc_client_mock.go -mock_names EthRPCClient=MockEthRPCClient -package=mocks github.com/base-org/RRC-7755-poc/internal/prover/storage_prover EthRPCClient
59+
@ mockgen -destination=internal/prover/mocks/l1_client_mock.go -mock_names L1Client=MockL1Client -package=mocks github.com/base-org/RRC-7755-poc/internal/prover/l1_state_prover L1Client
60+
61+
.PHONY: install_tools
62+
install_tools:
63+
@echo "--- Installing tools..."
64+
@go install github.com/golang/mock/mockgen@latest
65+
66+
67+
.PHONY: build
68+
build: info build_deps
69+
@ printf "\nBuild app\n"
70+
@ go build $(LDFLAGS) -o $(BIN)/$(PROJECT) cmd/main.go
71+
@ cp -R cmd/config $(BIN)/
72+
73+
run: build
74+
@ printf "\nrunning main directory with go run..."
75+
@ cd cmd && go run main.go
76+
77+
.PHONY: build-contracts
78+
build-contracts:
79+
@ echo "Building contracts..."
80+
@ cd RRC-7755-poc/contracts \
81+
&& forge install \
82+
&& forge build
83+
84+
.PHONY: generate-bindings
85+
generate-bindings:
86+
@ echo "Generating bindings..."
87+
@ go install github.com/ethereum/go-ethereum/cmd/abigen@v1.14.11
88+
@ abigen --abi contracts/out/RRC7755Outbox.sol/RRC7755Outbox.abi.json --pkg rrc_7755_outbox --type RRC7755Outbox --out bindings/rrc_7755_outbox/rrc_7755_outbox.go
89+
@ abigen --abi contracts/out/RRC7755Inbox.sol/RRC7755Inbox.abi.json --pkg rrc_7755_inbox --type RRC7755Inbox --out bindings/rrc_7755_inbox/rrc_7755_inbox.go
90+
@ abigen --abi contracts/out/Entrypoint.sol/Entrypoint.abi.json --pkg entrypoint --type Entrypoint --out bindings/entrypoint/entrypoint.go

services/go-filler/README.md

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# RRC-7755 Go Filler Service
2+
3+
> **DISCLAIMER:** This is a preliminary draft version of a Go implementation for the RRC-7755 filler. It contains experimental and hacky code that is not production-ready. Please do not use the code for any production purposes. This implementation is meant for demonstration and testing purposes only.
4+
>
5+
> **⚠️ IMPORTANT:** Users should understand that:
6+
> - This code is still in early development
7+
> - It may contain bugs or failures.
8+
> - The implementation makes numerous assumptions that might not hold in other environments
9+
> - This code is highly imperfect and is generated in a hackathon-like development environment. It does not represent Base's engineering standards or best practices
10+
> - It is provided solely as a reference implementation for experimental purposes
11+
> - No warranty or official support is provided for this code
12+
>
13+
> Please use this implementation wisely and only for exploratory purposes. Do not deploy it in production environments.
14+
15+
The Go Filler service is part of the RRC-7755 proof-of-concept implementation. It listens for message events from Outbox contracts on source chains and fulfills those messages on destination chains.
16+
17+
## Features
18+
19+
### What is included in the go-filler
20+
21+
1. Outbox package:
22+
- Listen to requests from outbox
23+
- Validate request content
24+
- Send fulfillment to inbox
25+
26+
2. Prover package:
27+
- Generate proof of fulfillment on arbitrum as a destination chain on devnet (disclaimer: unit tested but not E2E tested onchain)
28+
29+
### What is not included yet
30+
31+
- Usage of service frameworks
32+
- Storage for outbox requests
33+
- Submission of proof to the outbox to claim rewards
34+
- Mainnet storage proof
35+
36+
37+
## Prerequisites
38+
39+
- Go 1.20 or later
40+
- Access to Ethereum RPC endpoints
41+
42+
## Environment Setup
43+
44+
Create a `.env` file in the project root directory with the following variables:
45+
46+
```
47+
# RPC endpoints for different chains (examples)
48+
SEPOLIA_RPC=wss://ethereum-sepolia-rpc.publicnode.com
49+
BASE_SEPOLIA_RPC=wss://base-sepolia-rpc.publicnode.com
50+
ARBITRUM_SEPOLIA_RPC=wss://sepolia-rollup.arbitrum.io/feed
51+
52+
# Wallet configuration
53+
from-address: .env//YOUR_WALLET_ADDR
54+
private-key: .env//YOUR_WALLET_PRIVATE_KEY
55+
recipient-address: .env//RECIPIENT_ADDR
56+
```
57+
58+
## Configuration
59+
60+
The service uses YAML configuration files located in `services/go-filler/cmd/config/`. The main configuration file is `local.yaml`, which includes:
61+
62+
- Chain configurations (chain IDs, RPC URLs, contract addresses)
63+
- Wallet configuration
64+
- Outbox and Inbox address mappings
65+
66+
## Building and Running
67+
68+
### Using Make
69+
70+
The project includes a Makefile with several useful commands:
71+
72+
```bash
73+
# Run the service
74+
make run
75+
```
76+
77+
### Manual Running
78+
79+
If you prefer to run the service manually:
80+
81+
```bash
82+
cd services/go-filler
83+
go build -o bin/filler cmd/main.go
84+
./bin/filler
85+
```
86+
87+
## Troubleshooting
88+
89+
### Common Issues
90+
91+
- **Connection issues**: Check your RPC endpoint URLs and ensure they're accessible from your environment.
92+
- **Insufficient funds**: Ensure your wallet has enough funds on the destination chains to cover transaction costs.
93+
94+

services/go-filler/bindings/entrypoint/entrypoint.go

Lines changed: 2521 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)