Skip to content
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

Altda devnet monitoring #11

Draft
wants to merge 27 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
981ee6a
feat: add sol-style-malformed-require locally (#12340)
smartcontracts Oct 7, 2024
b460aa2
contracts-bedrock: cleanup `FeeVault` (#12338)
tynes Oct 7, 2024
35bbd80
contracts-bedrock: fixes `OptimismMintableERC721Factory` test (#12306)
tynes Oct 7, 2024
6d874d5
feat: add sol-style-malformed-revert locally (#12341)
smartcontracts Oct 7, 2024
fb8ac6b
feat(ct): add checks for unused imports (#12348)
smartcontracts Oct 7, 2024
a85ff0a
ci: Fix proofs team CI notification group name (#12362)
pauldowman Oct 7, 2024
77c91d0
fix(ci): add unused imports check to ci (#12360)
smartcontracts Oct 7, 2024
b4171c3
fix(ci): add MIPSInstructions as exception (#12361)
smartcontracts Oct 7, 2024
078e016
OPCM: DepolyOPChain additional testing checks. (#12355)
blmalone Oct 7, 2024
c938fdf
devnet: fix build issue (#12364)
tynes Oct 7, 2024
2412379
fix(ct): deploy MIPS2 properly (#12365)
smartcontracts Oct 8, 2024
8cb56d9
feat: add semgrep-scan-local to justfile (#12366)
smartcontracts Oct 8, 2024
fb7f306
op-program: Avoid parsing op-sepolia and op-mainnet rollup and chain …
ajsutton Oct 8, 2024
2c24e65
txmgr: reinstate fee metrics (#12369)
geoknee Oct 8, 2024
dee44ec
Interop: Update Inputs (rebased) (#12204)
axelKingsley Oct 8, 2024
117c9a4
cannon: Default load-elf to output state.bin.gz (#12367)
ajsutton Oct 8, 2024
d37f753
fix: just build-go-ffi command (#12371)
maurelian Oct 8, 2024
03b526d
MTCannon: Fix `AssertEVMReverts` to correctly construct data (#12200)
joohhnnn Oct 8, 2024
87d0152
feat(ct): port interface checks to go (#12335)
smartcontracts Oct 8, 2024
a05feb3
OPCM: AddressManager and ProxyAdmin assertions. (#12370)
blmalone Oct 8, 2024
52783f0
fix:fix load/store test compatible cannon64 (#12345)
GrapeBaBa Oct 8, 2024
c55dcd2
feat:add movz/movn mips test (#12353)
GrapeBaBa Oct 8, 2024
fb62380
fix(ci): use forge-build in dockerfile (#12377)
smartcontracts Oct 8, 2024
3122237
feat(devnet): UPSTREAM - add monitoring stack
samlaf Sep 27, 2024
1dafc7c
feat(altda): UPSTREAM - add altda metrics to op-batcher
samlaf Sep 23, 2024
111e0f9
feat(altda): UPSTREAM - multiframe altda channel to support large blobs
samlaf Sep 27, 2024
2bd3e06
feat(devnet): use eigenda
samlaf Sep 27, 2024
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
14 changes: 8 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ jobs:
condition: <<parameters.notify>>
steps:
- notify-failures-on-develop:
mentions: "@proofs-squad"
mentions: "@proofs-team"

cannon-build-test-vectors:
docker:
Expand Down Expand Up @@ -721,6 +721,8 @@ jobs:
command: interfaces-check-no-build
- run-contracts-check:
command: size-check
- run-contracts-check:
command: unused-imports-check-no-build

contracts-bedrock-validate-spacers:
docker:
Expand Down Expand Up @@ -1142,7 +1144,7 @@ jobs:
exit 1
fi
- notify-failures-on-develop:
mentions: "@proofs-squad"
mentions: "@proofs-team"

cannon-stf-verify:
docker:
Expand Down Expand Up @@ -1269,7 +1271,7 @@ jobs:
make verify-sepolia
working_directory: op-program
- notify-failures-on-develop:
mentions: "@proofs-squad"
mentions: "@proofs-team"

op-program-compat:
docker:
Expand Down Expand Up @@ -1367,7 +1369,7 @@ jobs:
name: Build contracts
environment:
FOUNDRY_PROFILE: ci
command: just build
command: just forge-build
working_directory: packages/contracts-bedrock
- run:
name: Publish artifacts
Expand Down Expand Up @@ -1420,7 +1422,7 @@ workflows:
- semgrep-scan
- semgrep-scan:
name: semgrep-scan-local
scan_command: semgrep scan --timeout=100 --config=./.semgrep --strict --error .
scan_command: semgrep scan --timeout=100 --config=./.semgrep --error .
- go-lint:
requires:
- go-mod-download
Expand Down Expand Up @@ -1726,7 +1728,7 @@ workflows:
target: test-cannon
parallelism: 8
notify: true
mentions: "@proofs-squad"
mentions: "@proofs-team"
requires:
- contracts-bedrock-build
- cannon-prestate
Expand Down
40 changes: 37 additions & 3 deletions .semgrep/sol-rules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ rules:
- id: sol-safety-deployutils-args
languages: [solidity]
severity: ERROR
pattern-regex: DeployUtils\.(create1|create2|create1AndSave|create2AndSave)\s*\(\s*\{[^}]*?_args\s*:\s*(?!\s*DeployUtils\.encodeConstructor\()\s*[^}]*?\}\s*\)
message: _args parameter should be wrapped with DeployUtils.encodeConstructor
pattern-regex: DeployUtils\.(create1|create2|create1AndSave|create2AndSave)\s*\(\s*\{[^}]*?_args\s*:\s*(?!\s*DeployUtils\.encodeConstructor\()\s*[^}]*?\}\s*\)

- id: sol-style-input-arg-fmt
languages: [solidity]
severity: ERROR
pattern-regex: function\s+\w+\s*\(\s*([^)]*?\b\w+\s+(?!_)(?!memory\b)(?!calldata\b)(?!storage\b)(?!payable\b)\w+\s*(?=,|\)))
message: Named inputs to functions must be prepended with an underscore
pattern-regex: function\s+\w+\s*\(\s*([^)]*?\b\w+\s+(?!_)(?!memory\b)(?!calldata\b)(?!storage\b)(?!payable\b)\w+\s*(?=,|\)))
paths:
exclude:
- op-chain-ops/script/testdata/scripts/ScriptExample.s.sol
Expand All @@ -25,8 +25,8 @@ rules:
- id: sol-style-return-arg-fmt
languages: [solidity]
severity: ERROR
pattern-regex: returns\s*(\w+\s*)?\(\s*([^)]*?\b\w+\s+(?!memory\b)(?!calldata\b)(?!storage\b)(?!payable\b)\w+(?<!_)\s*(?=,|\)))
message: Named return arguments to functions must be appended with an underscore
pattern-regex: returns\s*(\w+\s*)?\(\s*([^)]*?\b\w+\s+(?!memory\b)(?!calldata\b)(?!storage\b)(?!payable\b)\w+(?<!_)\s*(?=,|\)))
paths:
exclude:
- op-chain-ops/script/testdata/scripts/ScriptExample.s.sol
Expand All @@ -47,3 +47,37 @@ rules:
message: vm.expectRevert() must specify the revert reason
patterns:
- pattern: vm.expectRevert()

- id: sol-style-malformed-require
languages: [solidity]
severity: ERROR
message: Require statement style is malformed
patterns:
- pattern: require(..., $ERR);
- pattern-not: require($ERR);
- focus-metavariable: $ERR
- pattern-not-regex: \"(\w+:\s[^"]+)\"
- pattern-not-regex: string\.concat\(\"(\w+:\s[^"]+)\"\,[^"]+\)
- pattern-not-regex: \"([a-zA-Z0-9\s]+-[a-zA-Z0-9\s]+)\"
- pattern-not-regex: \"([a-zA-Z0-9\s]+-[a-zA-Z0-9\s]+-[a-zA-Z0-9\s]+)\"
paths:
exclude:
- packages/contracts-bedrock/src/libraries/Bytes.sol
- packages/contracts-bedrock/src/legacy/LegacyMintableERC20.sol
- packages/contracts-bedrock/src/cannon/MIPS.sol
- packages/contracts-bedrock/src/cannon/MIPS2.sol
- packages/contracts-bedrock/src/cannon/libraries/MIPSMemory.sol
- packages/contracts-bedrock/src/cannon/libraries/MIPSInstructions.sol

- id: sol-style-malformed-revert
languages: [solidity]
severity: ERROR
message: Revert statement style is malformed
patterns:
- pattern: revert($MSG);
- pattern-not: revert $ERR(...);
- focus-metavariable: $MSG
- pattern-not-regex: \"(\w+:\s[^"]+)\"
paths:
exclude:
- packages/contracts-bedrock/src/cannon/libraries/MIPSInstructions.sol
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,12 @@ devnet-up: pre-devnet ## Starts the local devnet
PYTHONPATH=./bedrock-devnet $(PYTHON) ./bedrock-devnet/main.py --monorepo-dir=.
.PHONY: devnet-up

altda-devnet-up:
@( \
set -a; . ./.env; set +a; \
DEVNET_ALTDA=true GENERIC_ALTDA=true TRAFFIC_GEN=true make devnet-up; \
)

devnet-test: pre-devnet ## Runs tests on the local devnet
make -C op-e2e test-devnet
.PHONY: devnet-test
Expand Down
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents**

- [devnet with eigenda alt-da](#devnet-with-eigenda-alt-da)
- [What is Optimism?](#what-is-optimism)
- [Documentation](#documentation)
- [Specification](#specification)
Expand All @@ -26,6 +27,32 @@

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

## devnet with eigenda alt-da

First you will need to build the dev docker image for eigenda-proxy, until we make a new release.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

TODO: change this after we release the new proxy

Copy link
Collaborator

Choose a reason for hiding this comment

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


```bash
git clone https://github.com/Layr-Labs/eigenda-proxy.git
make docker-build
```

Now create a `.env` file in the root of this repository with the following content (you will need to add an ecdsa private key that is authorized on the eigenda disperser, as well as an ethereum rpc endpoint):

```bash
MEMSTORE_ENABLED=false
Copy link
Collaborator

Choose a reason for hiding this comment

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

update the flag to EIGENDA_PROXY_MEMSTORE_ENABLED

EIGENDA_PROXY_EIGENDA_SERVICE_MANAGER_ADDR=0x54A03db2784E3D0aCC08344D05385d0b62d4F432 #holesky preprod
EIGENDA_PROXY_EIGENDA_SIGNER_PRIVATE_KEY_HEX=
EIGENDA_PROXY_EIGENDA_ETH_RPC=
```

Finally run `make altda-devnet-up` to start the devnet with the eigenda proxy as alt-da server, which sends batches to `disperser-preprod-holesky.eigenda.xyz:443`.

This will also start a grafana instance, which you can access at `http://localhost:3000` with user:pw `admin:admin`.

![](./ops-bedrock/monitoring/grafana/grafana-dashboard-overview-high-throughput.png)

The devnet starts an instance of https://github.com/Layr-Labs/evm-tx-load-gen which is submitting transactions with large amounts of calldata to reach 1.5MB/s of throughput.

## What is Optimism?

[Optimism](https://www.optimism.io/) is a project dedicated to scaling Ethereum's technology and expanding its ability to coordinate people from across the world to build effective decentralized economies and governance systems. The [Optimism Collective](https://www.optimism.io/vision) builds open-source software that powers scalable blockchains and aims to address key governance and economic challenges in the wider Ethereum ecosystem. Optimism operates on the principle of **impact=profit**, the idea that individuals who positively impact the Collective should be proportionally rewarded with profit. **Change the incentives and you change the world.**
Expand Down
24 changes: 18 additions & 6 deletions bedrock-devnet/devnet/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
DEVNET_L2OO = os.getenv('DEVNET_L2OO') == "true"
DEVNET_ALTDA = os.getenv('DEVNET_ALTDA') == "true"
GENERIC_ALTDA = os.getenv('GENERIC_ALTDA') == "true"
TRAFFIC_GEN = os.getenv('TRAFFIC_GEN') == "true"

class Bunch:
def __init__(self, **kwds):
Expand Down Expand Up @@ -173,6 +174,12 @@ def devnet_l2_allocs(paths):

# Bring up the devnet where the contracts are deployed to L1
def devnet_deploy(paths):

log.info('Starting peripheral telemetry services.')
run_command(['docker', 'compose', 'up', '-d', 'prometheus', 'grafana', 'loki', 'promtail', 'ethereum-metrics-exporter-l2'], cwd=paths.ops_bedrock_dir, env={
'PWD': paths.ops_bedrock_dir
})

if os.path.exists(paths.genesis_l1_path):
log.info('L1 genesis already generated.')
else:
Expand Down Expand Up @@ -247,11 +254,7 @@ def devnet_deploy(paths):
wait_for_rpc_server('127.0.0.1:9545')

# Print out the addresses being used for easier debugging.
l2_output_oracle = addresses['L2OutputOracleProxy']
dispute_game_factory = addresses['DisputeGameFactoryProxy']
batch_inbox_address = rollup_config['batch_inbox_address']
log.info(f'Using L2OutputOracle {l2_output_oracle}')
log.info(f'Using DisputeGameFactory {dispute_game_factory}')
log.info(f'Using batch inbox {batch_inbox_address}')

# Set up the base docker environment.
Expand All @@ -264,7 +267,11 @@ def devnet_deploy(paths):
# Must be done selectively because op-proposer throws if both are set.
if DEVNET_L2OO:
docker_env['L2OO_ADDRESS'] = l2_output_oracle
l2_output_oracle = addresses['L2OutputOracleProxy']
log.info(f'Using L2OutputOracle {l2_output_oracle}')
else:
dispute_game_factory = addresses['DisputeGameFactoryProxy']
log.info(f'Using DisputeGameFactory {dispute_game_factory}')
docker_env['DGF_ADDRESS'] = dispute_game_factory
docker_env['DG_TYPE'] = '254'
docker_env['PROPOSAL_INTERVAL'] = '12s'
Expand All @@ -287,15 +294,20 @@ def devnet_deploy(paths):
log.info('Bringing up `op-node`, `op-proposer` and `op-batcher`.')
run_command(['docker', 'compose', 'up', '-d', 'op-node', 'op-proposer', 'op-batcher', 'artifact-server'], cwd=paths.ops_bedrock_dir, env=docker_env)

# Optionally bring up traffic-gen.
if TRAFFIC_GEN:
log.info('Bringing up `evm-tx-load-gen`.')
run_command(['docker', 'compose', 'up', '-d', 'evm-tx-load-gen'], cwd=paths.ops_bedrock_dir, env=docker_env)

# Optionally bring up op-challenger.
if not DEVNET_L2OO:
log.info('Bringing up `op-challenger`.')
run_command(['docker', 'compose', 'up', '-d', 'op-challenger'], cwd=paths.ops_bedrock_dir, env=docker_env)

# Optionally bring up Alt-DA Mode components.
if DEVNET_ALTDA:
log.info('Bringing up `da-server`, `sentinel`.') # TODO(10141): We don't have public sentinel images yet
run_command(['docker', 'compose', 'up', '-d', 'da-server'], cwd=paths.ops_bedrock_dir, env=docker_env)
log.info('Bringing up `da-server`, `redis-cache`.') # TODO(10141): We don't have public sentinel images yet
run_command(['docker', 'compose', 'up', '-d', 'da-server', 'redis-cache'], cwd=paths.ops_bedrock_dir, env=docker_env)

# Fin.
log.info('Devnet ready.')
Expand Down
6 changes: 3 additions & 3 deletions cannon/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ cd ../cannon
make cannon

# Transform MIPS op-program client binary into first VM state.
# This outputs state.json (VM state) and meta.json (for debug symbols).
./bin/cannon load-elf --type singlethreaded --path=../op-program/bin/op-program-client.elf
# This outputs state.bin.gz (VM state) and meta.json (for debug symbols).
./bin/cannon load-elf --type singlethreaded-2 --path=../op-program/bin/op-program-client.elf
Copy link
Collaborator

Choose a reason for hiding this comment

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

why change into bin.gz?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ehhh this PR is prob just targeting the wrong commit. :\


# Run cannon emulator (with example inputs)
# Note that the server-mode op-program command is passed into cannon (after the --),
Expand All @@ -45,7 +45,7 @@ make cannon
--proof-at '=<TRACE_INDEX>' \
--stop-at '=<STOP_INDEX>' \
--snapshot-at '%1000000000' \
--input ./state.json \
--input ./state.bin.gz \
-- \
../op-program/bin/op-program \
--network op-mainnet \
Expand Down
2 changes: 1 addition & 1 deletion cannon/cmd/load_elf.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ var (
LoadELFOutFlag = &cli.PathFlag{
Name: "out",
Usage: "Output path to write state to. State is dumped to stdout if set to '-'. Not written if empty. Use file extension '.bin', '.bin.gz', or '.json' for binary, compressed binary, or JSON formats.",
Value: "state.json",
Value: "state.bin.gz",
Required: false,
}
LoadELFMetaFlag = &cli.PathFlag{
Expand Down
1 change: 0 additions & 1 deletion cannon/mipsevm/multithreaded/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,6 @@ func (s *State) EncodeThreadProof() []byte {
out := make([]byte, 0, THREAD_WITNESS_SIZE)
out = append(out, threadBytes[:]...)
out = append(out, otherThreadsWitness[:]...)

return out
}

Expand Down
Loading