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

feat: OP Stack integration test #36

Merged
merged 13 commits into from
Jun 12, 2024
Merged
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
36 changes: 36 additions & 0 deletions .devnet/addresses.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"AddressManager": "0xe4EB561155AFCe723bB1fF8606Fbfe9b28d5d38D",
"AnchorStateRegistry": "0x81C78FE7D7baABd8B6080541F860721a745b7C86",
"AnchorStateRegistryProxy": "0x754A91555a8dd5037315ABFd3702ED49d92887b7",
"DelayedWETH": "0x49BBFf1629824A1e7993Ab5c17AFa45D24AB28c9",
"DelayedWETHProxy": "0x11c81c1A7979cdd309096D1ea53F887EA9f8D14d",
"DisputeGameFactory": "0x20B168142354Cee65a32f6D8cf3033E592299765",
"DisputeGameFactoryProxy": "0xD34052d665891976eE71E097EaAF03Df51e9e3d5",
"L1CrossDomainMessenger": "0x094e6508ba9d9bf1ce421fff3dE06aE56e67901b",
"L1CrossDomainMessengerProxy": "0xd787A42Ee3ac477c46Dd6C912e7af795D44453d5",
"L1ERC721Bridge": "0x5C4F5e749A61a9503c4AAE8a9393e89609a0e804",
"L1ERC721BridgeProxy": "0x4d8eC2972eb0bC4210c64E651638D4a00ad3B400",
"L1StandardBridge": "0xb7900B27Be8f0E0fF65d1C3A4671e1220437dd2b",
"L1StandardBridgeProxy": "0xfe36E31dFE8Cb3A3Aa0CB9f35B191DdB5451b090",
"L2OutputOracle": "0x19652082F846171168Daf378C4fD3ee85a0D4A60",
"L2OutputOracleProxy": "0xfcF38f326CA709b0B04B2215Dbc969fC622775F7",
"Mips": "0x1C0e3B8e58dd91536Caf37a6009536255A7816a6",
"OptimismMintableERC20Factory": "0x39Aea2Dd53f2d01c15877aCc2791af6BDD7aD567",
"OptimismMintableERC20FactoryProxy": "0x072B5bdBFC5e66B55317Ef4B4d1AE7d61592ebB2",
"OptimismPortal": "0xbdD90485FCbcac869D5b5752179815a3103d8131",
"OptimismPortal2": "0xfcbb237388CaF5b08175C9927a37aB6450acd535",
"OptimismPortalProxy": "0x6509f2a854BA7441039fCE3b959d5bAdd2fFCFCD",
"PreimageOracle": "0x3bd7E801E51d48c5d94Ea68e8B801DFFC275De75",
"ProtocolVersions": "0xfbfD64a6C0257F613feFCe050Aa30ecC3E3d7C3F",
"ProtocolVersionsProxy": "0x06d763ED65D2DC08BAc5743bd00AffD764dD80c1",
"ProxyAdmin": "0xcf27F781841484d5CF7e155b44954D7224caF1dD",
"SafeProxyFactory": "0x261D8c5e9742e6f7f1076Fa1F560894524e19cad",
"SafeSingleton": "0xCE3478A9E0167a6Bc5716DC39DbbbfAc38F27623",
"SuperchainConfig": "0x068E44eB31e111028c41598E4535be7468674D0A",
"SuperchainConfigProxy": "0x71F043a9072b5ec430C0a1DD766E1C8C613eDc5d",
"SystemConfig": "0x67866A5052E5302aaD08e9f352331fd8622eB6DC",
"SystemConfigProxy": "0x4af802b3010e07845b2B8C2250126e9Ac0BDb6B9",
"SystemOwnerSafe": "0x410fbB1364c5A3EE879C28673cC21EE5AA8204A5",
"DataAvailabilityChallenge": "0x410fbB1364c5A3EE879C28673cC21EE5AA8204A5",
"DataAvailabilityChallengeProxy": "0x410fbB1364c5A3EE879C28673cC21EE5AA8204A5"
}
1 change: 1 addition & 0 deletions .devnet/allocs-l1.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions .devnet/allocs-l2-delta.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions .devnet/allocs-l2-ecotone.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions .devnet/allocs-l2.json

Large diffs are not rendered by default.

73 changes: 73 additions & 0 deletions .devnet/devnetL1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"l1ChainID": 900,
"l2ChainID": 901,
"l2BlockTime": 2,
"maxSequencerDrift": 300,
"sequencerWindowSize": 200,
"channelTimeout": 120,
"p2pSequencerAddress": "0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc",
"batchInboxAddress": "0xff00000000000000000000000000000000000901",
"batchSenderAddress": "0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC",
"cliqueSignerAddress": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
"l1UseClique": true,
"l1StartingBlockTag": "earliest",
"l2OutputOracleSubmissionInterval": 10,
"l2OutputOracleStartingTimestamp": 0,
"l2OutputOracleStartingBlockNumber": 0,
"l2OutputOracleProposer": "0x70997970C51812dc3A010C7d01b50e0d17dc79C8",
"l2OutputOracleChallenger": "0x15d34AAf54267DB7D7c367839AAf71A00a2C6A65",
"l2GenesisBlockGasLimit": "0x1c9c380",
"l1BlockTime": 3,
"baseFeeVaultRecipient": "0x14dC79964da2C08b23698B3D3cc7Ca32193d9955",
"l1FeeVaultRecipient": "0x23618e81E3f5cdF7f54C3d65f7FBc0aBf5B21E8f",
"sequencerFeeVaultRecipient": "0xa0Ee7A142d267C1f36714E4a8F75612F20a79720",
"baseFeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000",
"l1FeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000",
"sequencerFeeVaultMinimumWithdrawalAmount": "0x8ac7230489e80000",
"baseFeeVaultWithdrawalNetwork": 0,
"l1FeeVaultWithdrawalNetwork": 0,
"sequencerFeeVaultWithdrawalNetwork": 0,
"proxyAdminOwner": "0xa0Ee7A142d267C1f36714E4a8F75612F20a79720",
"finalSystemOwner": "0xa0Ee7A142d267C1f36714E4a8F75612F20a79720",
"superchainConfigGuardian": "0xa0Ee7A142d267C1f36714E4a8F75612F20a79720",
"finalizationPeriodSeconds": 2,
"fundDevAccounts": true,
"l2GenesisBlockBaseFeePerGas": "0x1",
"gasPriceOracleOverhead": 2100,
"gasPriceOracleScalar": 1000000,
"gasPriceOracleBaseFeeScalar": 1368,
"gasPriceOracleBlobBaseFeeScalar": 810949,
"enableGovernance": true,
"governanceTokenSymbol": "OP",
"governanceTokenName": "Optimism",
"governanceTokenOwner": "0xa0Ee7A142d267C1f36714E4a8F75612F20a79720",
"eip1559Denominator": 50,
"eip1559DenominatorCanyon": 250,
"eip1559Elasticity": 6,
"l1GenesisBlockTimestamp": "0x64c811bf",
"l2GenesisRegolithTimeOffset": "0x0",
"l2GenesisDeltaTimeOffset": null,
"l2GenesisCanyonTimeOffset": "0x0",
"systemConfigStartBlock": 0,
"requiredProtocolVersion": "0x0000000000000000000000000000000000000000000000000000000000000000",
"recommendedProtocolVersion": "0x0000000000000000000000000000000000000000000000000000000000000000",
"faultGameAbsolutePrestate": "0x03c7ae758795765c6664a5d39bf63841c71ff191e9189522bad8ebff5d4eca98",
"faultGameMaxDepth": 50,
"faultGameClockExtension": 0,
"faultGameMaxClockDuration": 1200,
"faultGameGenesisBlock": 0,
"faultGameGenesisOutputRoot": "0xDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEF",
"faultGameSplitDepth": 14,
"faultGameWithdrawalDelay": 604800,
"preimageOracleMinProposalSize": 10000,
"preimageOracleChallengePeriod": 120,
"proofMaturityDelaySeconds": 12,
"disputeGameFinalityDelaySeconds": 6,
"respectedGameType": 254,
"useFaultProofs": true,
"usePlasma": true,
"daChallengeWindow": 1,
"daResolveWindow": 1,
"daBondSize": 1000000,
"daResolverRefundPercentage": 0
}
13 changes: 9 additions & 4 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ jobs:
run: |
make test

- name: Run Optimism Test
run: |
make optimism-test

gosec:
runs-on: ubuntu-latest
env:
Expand All @@ -56,7 +60,7 @@ jobs:
with:
args: ./...

e2e-test:
holesky-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -66,13 +70,14 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.21
go-version: 1.21

- name: Install project dependencies
run: |
go mod download
- name: Run E2E Tests

- name: Run holesky tests
env:
SIGNER_PRIVATE_KEY: ${{ secrets.SIGNER_PRIVATE_KEY }}
run: |
SIGNER_PRIVATE_KEY=$SIGNER_PRIVATE_KEY make e2e-test
SIGNER_PRIVATE_KEY=$SIGNER_PRIVATE_KEY make holesky-test
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,7 @@ go.work
.env

## kzg cache
test/resources/SRSTables/
e2e/resources/kzg/SRSTables/

## Vscode
/.vscode
16 changes: 11 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,13 @@ clean:
rm bin/eigenda-proxy

test:
go test -v ./...
go test -v ./... -parallel 4

e2e-test: submodules
go test -timeout 50m -v ./test/e2e_test.go -testnet-integration
optimism-test:
OPTIMISM=true go test -timeout 1m -v ./e2e -deploy-config ../.devnet/devnetL1.json

holesky-test:
TESTNET=true go test -timeout 50m -v ./e2e -parallel 4

.PHONY: lint
lint:
Expand All @@ -45,7 +48,7 @@ lint:
@golangci-lint run

gosec:
@echo "$(GREEN) Running security scan with gosec...$(COLOR_END)"
@echo "Running security scan with gosec..."
gosec ./...

submodules:
Expand All @@ -56,7 +59,10 @@ srs:
cd operator-setup && ./srs_setup.sh; \
fi

op-devnet-allocs:
@echo "Generating devnet allocs..."
@./scripts/op-devnet-allocs.sh

.PHONY: \
op-batcher \
clean \
test
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ An ephemeral memory store backend can be used for faster feedback testing when p
## Running Locally

1. Compile binary: `make eigenda-proxy`
2. Run binary; e.g: `./bin/eigenda-proxy --addr 127.0.0.1 --port 5050 --eigenda-rpc 127.0.0.1:443 --eigenda-status-query-timeout 45m --eigenda-g1-path test/resources/g1.point --eigenda-g2-tau-path test/resources/g2.point.powerOf2 --eigenda-use-tls true`
2. Run binary; e.g: `./bin/eigenda-proxy --addr 127.0.0.1 --port 5050 --eigenda-rpc 127.0.0.1:443 --eigenda-status-query-timeout 45m --eigenda-g1-path e2e/resources/kzg/g1.point --eigenda-g2-tau-path e2e/resources/kzg/g2.point.powerOf2 --eigenda-use-tls true`

**Env File**
An env file can be provided to the binary for runtime process ingestion; e.g:
Expand Down Expand Up @@ -67,14 +67,17 @@ The `raw commitment` for EigenDA is encoding certificate and kzg fields.

## Testing

Some unit tests have been introduced to assert the correctness of:
### Unit
Unit tests can be ran via invoking `make test`.

* DA Certificate encoding/decoding logic
* commitment verification logic
### Holesky
A holesky integration test can be ran using `make holesky-test` to assert proper dispersal/retrieval against a public network. Please **note** that EigenDA Holesky network which is subject to rate-limiting and slow confirmation times *(i.e, >10 minutes per blob confirmation)*. Please advise EigenDA's [inabox](https://github.com/Layr-Labs/eigenda/tree/master/inabox#readme) if you'd like to spin-up a local DA network for faster iteration testing.

Unit tests can be ran via `make test`.

Otherwise E2E tests (`test/e2e_test.go`) exists which asserts that a commitment can be generated when inserting some arbitrary data to the server and can be read using the commitment for a key lookup via the client. These can be ran via `make e2e-test`. Please **note** that this test uses the EigenDA Holesky network which is subject to rate-limiting and slow confirmation times *(i.e, >10 minutes per blob confirmation)*. Please advise EigenDA's [inabox](https://github.com/Layr-Labs/eigenda/tree/master/inabox#readme) if you'd like to spin-up a local DA network for faster iteration testing.
### Optimism
An E2E test exists which spins up a local OP sequencer instance using the [op-e2e](https://github.com/ethereum-optimism/optimism/tree/develop/op-e2e) framework for asserting correct interaction behaviors with batch submission and state derivation. These tests can be ran via `make optimism-test`.

**NOTE:**

## Downloading Mainnet SRS

Expand Down
5 changes: 5 additions & 0 deletions common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,8 @@ func ParseBytesAmount(s string) (uint64, error) {
return 0, fmt.Errorf("unsupported unit: %s", unit)
}
}

type Stats struct {
Entries int
Reads int
}
2 changes: 2 additions & 0 deletions common/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import (
)

func TestParseByteAmount(t *testing.T) {
t.Parallel()

testCases := []struct {
input string
expected uint64
Expand Down
22 changes: 22 additions & 0 deletions e2e/main_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package e2e_test

import (
"os"
"testing"
)

var (
runOptimismIntegrationTests bool
runTestnetIntegrationTests bool
)

func ParseEnv() {
runOptimismIntegrationTests = os.Getenv("OPTIMISM") == "true" || os.Getenv("OPTIMISM") == "1"
runTestnetIntegrationTests = os.Getenv("TESTNET") == "true" || os.Getenv("TESTNET") == "1"
}

func TestMain(m *testing.M) {
ParseEnv()
code := m.Run()
os.Exit(code)
}
Loading
Loading