-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update documentation Signed-off-by: Fabio Di Fabio <[email protected]> * minor edits --------- Signed-off-by: Fabio Di Fabio <[email protected]> Co-authored-by: Sally MacFarlane <[email protected]>
- Loading branch information
Showing
3 changed files
with
98 additions
and
202 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,32 @@ | ||
# Besu Plugins related to tracer and sequencer functionality | ||
|
||
A Linea tracing implementation for [Hyperledger Besu](https://github.com/hyperledger/besu) based on | ||
an [existing implementation in Go](https://github.com/Consensys/zk-evm/). | ||
A set of Linea plugins for the sequencer and RPC nodes. | ||
|
||
## Quickstart - Running Besu with Linea Plugins | ||
## Quickstart - Running [Linea Besu](https://github.com/ConsenSys/linea-besu) with plugins | ||
|
||
- compile linea-plugins `gradlew installDist` | ||
- copy jar file to besu runtime plugins/ directory (where you will run besu from, not where you're building besu) | ||
- add `ROLLUP` to besu config to enable the plugin RPC methods | ||
- rpc-http-api=\["ADMIN","ETH","NET","WEB3","ROLLUP"\] | ||
- add `LINEA` to besu config to enable the plugin RPC methods | ||
- rpc-http-api=\["ADMIN","ETH","NET","WEB3","LINEA"\] | ||
- start besu (command line or from IDE) and you should see plugins registered at startup | ||
- call the RPC endpoint eg | ||
- call the RPC endpoint eg: | ||
|
||
```shell | ||
curl --location --request POST 'http://localhost:8545' --data-raw '{ | ||
"jsonrpc": "2.0", | ||
"method": "rollup_generateConflatedTracesToFileV0", | ||
"params": [0, 0, "6.16.0"], | ||
"method": "linea_estimateGas", | ||
"params": [ | ||
"from": "0x73b2e0E54510239E22cC936F0b4a6dE1acf0AbdE", | ||
"to": "0xBb977B2EE8a111D788B3477D242078d0B837E72b", | ||
"value": "0x123" | ||
], | ||
"id": 1 | ||
}' | ||
``` | ||
|
||
## Development Setup | ||
|
||
### Install Java 17 | ||
|
||
``` | ||
brew install openjdk@17 | ||
``` | ||
### Install Java 21 | ||
|
||
### Native Lib Prerequisites | ||
|
||
|
@@ -40,98 +39,18 @@ Windows | |
|
||
On release native libs are built for all the supported platforms, | ||
if you want to test this process locally run `./gradlew -PreleaseNativeLibs jar`, | ||
jar is generated in `arithmetization/build/libs`. | ||
|
||
### Install Rust | ||
|
||
``` | ||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh | ||
# Use local git executable to fetch from repos (needed for private repos) | ||
echo "net.git-fetch-with-cli=true" >> .cargo/config.toml | ||
``` | ||
|
||
### Install Corset | ||
|
||
```shell | ||
cargo install --git ssh://[email protected]/Consensys/corset | ||
``` | ||
|
||
### Update Constraints [Submodule](https://github.com/Consensys/zkevm-constraints/) | ||
|
||
```shell | ||
git submodule update --init --recursive | ||
``` | ||
|
||
### Install [pre-commit](https://pre-commit.com/) | ||
|
||
```shell | ||
pip install --user pre-commit | ||
|
||
# For macOS users. | ||
brew install pre-commit | ||
``` | ||
|
||
Then run `pre-commit install` to set up git hook scripts. | ||
Used hooks can be found [here](.pre-commit-config.yaml). | ||
|
||
______________________________________________________________________ | ||
|
||
NOTE | ||
|
||
> `pre-commit` aids in running checks (end of file fixing, | ||
> markdown linting, linting, runs tests, json validation, etc.) | ||
> before you perform your git commits. | ||
______________________________________________________________________ | ||
jar is generated in `sequencer/build/libs`. | ||
|
||
### Run tests | ||
|
||
```shell | ||
# Run all tests | ||
./gradlew clean test | ||
|
||
# Run only unit tests | ||
./gradlew clean unitTests | ||
|
||
# Run only acceptance tests | ||
./gradlew clean acceptanceTests | ||
|
||
# Run EVM test suite BlockchainTests | ||
./gradlew clean referenceBlockchainTests | ||
|
||
# Run EVM test suite GeneralStateTests | ||
./gradlew clean referenceGeneralStateTests | ||
|
||
# Run all EVM test suite reference tests | ||
./gradlew clean referenceTests | ||
|
||
# Run single reference test via gradle, e.g for net.consensys.linea.generated.blockchain.BlockchainReferenceTest_583 | ||
./gradlew :reference-tests:referenceTests --tests "net.consensys.linea.generated.blockchain.BlockchainReferenceTest_583" | ||
``` | ||
|
||
______________________________________________________________________ | ||
|
||
NOTE | ||
|
||
> Please be aware if the reference test code generation tasks `blockchainReferenceTests` and | ||
> `generalStateReferenceTests` do not generate any java code, then probably you are missing the Ethereum tests" | ||
> submodule which you can clone via `git submodule update --init --recursive`. | ||
______________________________________________________________________ | ||
|
||
### Capturing a replay | ||
|
||
For debugging and inspection purposes, it is possible to capture a _replay_, _i.e._ all the minimal information required to replay a series of blocks as they played on the blockchain, which is done with `scripts/capture.pl`. | ||
|
||
A typical invocation would be: | ||
|
||
``` | ||
scripts/capture.pl --start 1300923 | ||
``` | ||
|
||
which would capture a replay of block #1300923 and store it in `arithmetization/src/test/resources/replays`. More options are available, refer to `scripts/capture.pl -h`. | ||
|
||
## IntelliJ IDEA Setup | ||
|
||
### Enable Annotation Processing | ||
|
@@ -160,30 +79,11 @@ NOTE | |
______________________________________________________________________ | ||
|
||
### Set Up IDE Code Re-formatting | ||
|
||
- Install [Checkstyle](https://plugins.jetbrains.com/plugin/1065-checkstyle-idea) plugin and set IDE code | ||
reformatting to comply with the project's Checkstyle configuration: | ||
|
||
- Go to `Settings | Editor | Code Style | Java | <hamburger menu> | Import Scheme | Checkstyle configuration`: | ||
|
||
![idea_checkstyle_reformat.png](images/idea_checkstyle_reformat.png) | ||
|
||
and select `<project_root>/config/checkstyle.xml`. | ||
|
||
### Install Optional Plugins | ||
|
||
- Install [Spotless Gradle](https://plugins.jetbrains.com/plugin/18321-spotless-gradle) plugin to re-format through | ||
the IDE according to spotless configuration. | ||
|
||
## Debugging Traces | ||
|
||
- JSON files can be debugged with the following command: | ||
|
||
```shell | ||
corset check -T <JSON_FILE> -v zkevm-constraints/zkevm.bin | ||
``` | ||
|
||
## Plugins | ||
|
||
Plugins are documented [here](PLUGINS.md). | ||
|
Binary file not shown.