mirror of
https://github.com/scroll-tech/scroll.git
synced 2026-04-23 03:00:50 -04:00
Rollup
This directory contains the three essential rollup services for the Scroll chain:
- Event Watcher (event_watcher): watches the events emitted from the L1 and L2 contracts and updates the event database.
- Gas Oracle (gas_oracle): monitors the L1 and L2 gas price and sends transactions to update the gas price oracle contracts on L1 and L2.
- Rollup Relayer (rollup_relayer): consists of three components: chunk and batch proposer and a relayer.
- The chunk and batch proposer proposes new chunks and batches that sends Commit Transactions for data availability and Finalize Transactions for proof verification and state finalization.
Dependency
abigen
go install -v github.com/scroll-tech/go-ethereum/cmd/abigen
solc
Ensure you install the version of solc required by MockBridge.sol (e.g., 0.8.24). See https://docs.soliditylang.org/en/latest/installing-solidity.html
Build
make clean
make mock_abi
make rollup_bins
Start
(Note: make sure you use different private keys for different senders in config.json.)
./build/bin/event_watcher --config ./conf/config.json
./build/bin/gas_oracle --config ./conf/config.json
./build/bin/rollup_relayer --config ./conf/config.json
Running unit tests
Follow these steps to run unit tests, in the repo's root dir:
wget https://github.com/scroll-tech/da-codec/releases/download/v0.0.0-rc0-ubuntu20.04/libzktrie.so
sudo mv libzktrie.so /usr/local/lib
wget https://github.com/scroll-tech/da-codec/releases/download/v0.0.0-rc0-ubuntu20.04/libscroll_zstd.so
sudo mv libscroll_zstd.so /usr/local/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
go test -v -race ./...