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

docs: config update #141

Merged
merged 14 commits into from
Oct 5, 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
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ PRIVATE_KEY=
ETHERSCAN_API_KEY=

# OP Proposer
L2OO_ADDRESS=
L2OO_ADDRESS=0x0E8d5C8041bc99E1869bdE4d7384AD00C41865b

# Proof Server
PROVER_NETWORK_RPC=
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ execution-reports/
**/rollup-config.json

# DB
db/proofs.db
db/*

**/bin/op-proposer

Expand Down
File renamed without changes.
20 changes: 11 additions & 9 deletions rollup-configs/13269.json → configs/13269/rollup.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
{
"genesis": {
"l1": {
"hash": "0x327e6431af3e1e05df17598ae31977cd545ea996f2755920fe75fb9fb65941e3",
"number": "0x62fd94"
"number": 6487444,
"hash": "0x327e6431af3e1e05df17598ae31977cd545ea996f2755920fe75fb9fb65941e3"
},
"l2": {
"hash": "0xa3344560b989c772875de98d68ccc3f8b5503c94e2e4ad2f403bca6bb186c6bf",
"number": "0x0"
"number": 0,
"hash": "0xa3344560b989c772875de98d68ccc3f8b5503c94e2e4ad2f403bca6bb186c6bf"
},
"l2_time": 1723487352,
"system_config": {
"batcherAddr": "0x6322c47fee60e15fc1b7ba65f1cfd66201e4c61d",
"batcherAddr": "0x6322c47FEE60e15FC1B7ba65f1cfd66201E4c61d",
"overhead": "0xbc",
"scalar": "0xa6fe0",
"gasLimit": 30000000,
"baseFeeScalar": null,
"blobBaseFeeScalar": null
"blobBaseFeeScalar": null,
"eip1559Denominator": null,
"eip1559Elasticity": null
}
},
"block_time": 2,
Expand All @@ -39,8 +41,8 @@
"ecotone_time": 0,
"fjord_time": 0,
"granite_time": 1725984001,
"batch_inbox_address": "0x136b12db1fbac1d6aa6d0a1d2b724892c6fba921",
"deposit_contract_address": "0x16839f9f6a11195a72b88744336edff036e7b3d5",
"l1_system_config_address": "0x19145e3aee49c40d9f499f705f25ac1ea7409834",
"batch_inbox_address": "0x136B12DB1FbaC1d6Aa6D0a1D2b724892c6FbA921",
"deposit_contract_address": "0x16839f9F6a11195A72B88744336EDFf036e7B3d5",
"l1_system_config_address": "0x19145e3aEe49C40D9f499F705F25ac1eA7409834",
"protocol_versions_address": "0x0000000000000000000000000000000000000000"
}
14 changes: 7 additions & 7 deletions contracts/opsuccinctl2ooconfig.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"chainId": 10,
"chainId": 13269,
"challenger": "0x0000000000000000000000000000000000000000",
"finalizationPeriod": 0,
"l2BlockTime": 2,
"owner": "0xDEd0000E32f8F40414d3ab3a830f735a3553E18e",
"proposer": "0xDEd0000E32f8F40414d3ab3a830f735a3553E18e",
"rollupConfigHash": "0xaaa6ae5735fc2cd9d94d361a8208946371cc689e4c03e45be9dd7a3ea866ab2f",
"startingBlockNumber": 126147850,
"startingOutputRoot": "0xc6722f65202d9971ff736f449973d72ade2268e29945a5753c5a3be8d6b15a97",
"startingTimestamp": 1727894477,
"rollupConfigHash": "0x50efb1261373319cd7ba429612d9a18e585627618ec04560e7d27ba7e36d4c05",
"startingBlockNumber": 2298536,
"startingOutputRoot": "0x39d791dc827d53c4add5a213148b9633bb1e74a4b3fb61e1fa699a6465ad4be3",
"startingTimestamp": 1728084424,
"submissionInterval": 1000,
"verifierGateway": "0x3B6041173B80E77f038f3F2C0f9744f04837185e",
"aggregationVkey": "0x004c04e3eab8ea57cd1f9076cf1b3b87e1e7155776a64ae101e0a39d9098c676",
"rangeVkeyCommitment": "0x50b251451a821c18594f0ae7267b5ac2072e308a03c540552c1d754f2103b460"
"aggregationVkey": "0x00e4dc504bcd3355a4bf7382ba15d74e058aa144948edb753879055d243ebad0",
"rangeVkeyCommitment": "0x58660c1a1ab2cc77620b051a4d9006883dcb81fa5a856f654bbc5f8739d83868"
}
8 changes: 7 additions & 1 deletion contracts/test/helpers/Utils.sol
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ contract Utils is Test, JSONDecoder {

// This script updates the rollup config hash and the block number in the config.
function updateRollupConfig() public {
// If ENV_FILE is set, pass it to the fetch-rollup-config binary.
string memory envFile = vm.envOr("ENV_FILE", string(".env.conduit"));

// Build the fetch-rollup-config binary. Use the quiet flag to suppress build output.
string[] memory inputs = new string[](6);
inputs[0] = "cargo";
Expand All @@ -85,13 +88,16 @@ contract Utils is Test, JSONDecoder {

// Run the fetch-rollup-config binary which updates the rollup config hash and the block number in the config.
// Use the quiet flag to suppress build output.
string[] memory inputs2 = new string[](6);
string[] memory inputs2 = new string[](9);
inputs2[0] = "cargo";
inputs2[1] = "run";
inputs2[2] = "--bin";
inputs2[3] = "fetch-rollup-config";
inputs2[4] = "--release";
inputs2[5] = "--quiet";
inputs2[6] = "--";
inputs2[7] = "--env-file";
inputs2[8] = envFile;

vm.ffi(inputs2);
}
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
context: .
dockerfile: ./proposer/succinct/Dockerfile
env_file:
- .env
- ${ENV_FILE:-.env}
restart: unless-stopped
ports:
- "3000:3000"
Expand All @@ -16,7 +16,7 @@ services:
context: .
dockerfile: ./proposer/op/Dockerfile.op_proposer
env_file:
- .env
- ${ENV_FILE:-.env}
restart: unless-stopped
depends_on:
- op-succinct-server
Expand Down
Binary file modified elf/aggregation-elf
Binary file not shown.
7 changes: 5 additions & 2 deletions proposer/db-utils/query_proofs.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,17 @@ def query_agg_proofs(db_path) -> [ProofRequest]:
raise ValueError("L2OO_ADDRESS not found in .env file")

print(f"L2OO_ADDRESS: {L2OO_ADDRESS}")
db_path = "../../db/proofs.db"
db_path = "../../db/11155420/proofs.db"

# Get all span proofs
print("\nSpan Proofs:")
span_proofs = query_span_proofs(db_path)

for proof in span_proofs:
print(f"Request ID: {proof.id}, Type: {proof.type}, Start Block: {proof.start_block}, End Block: {proof.end_block}, Status: {proof.status}, Prover Request ID: {proof.prover_request_id}, Time: {proof.request_added_time}")
proof_time_difference = None
if proof.proof_request_time is not None:
proof_time_difference = proof.proof_request_time - proof.request_added_time
print(f"Request ID: {proof.id}, Type: {proof.type}, Start Block: {proof.start_block}, End Block: {proof.end_block}, Status: {proof.status}, Prover Request ID: {proof.prover_request_id}, Request Added Time: {proof.request_added_time}, Proof Request Time: {proof.proof_request_time}, Proof Time Difference: {proof_time_difference}")

# Query for aggregation proofs
print("\nAggregation Proofs:")
Expand Down
2 changes: 1 addition & 1 deletion proposer/op/Dockerfile.op_proposer
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ COPY --from=optimism-builder /optimism/op-proposer/proposer/bin/op-proposer /usr
COPY ./proposer/op/op_proposer.sh /usr/local/bin/op_proposer.sh

# Copy the rollup configs
COPY ../rollup-configs /rollup-configs
COPY ../configs /configs

# Make the binary and entrypoint executable.
RUN ls -l /usr/local/bin/
Expand Down
2 changes: 1 addition & 1 deletion proposer/op/Dockerfile.span_batch_server
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ WORKDIR /app
COPY ./proposer/op /app/op-proposer-go

# Copy the rollup configs
COPY ../rollup-configs /rollup-configs
COPY ../configs /configs

# Change to the server directory and build the application
WORKDIR /app/op-proposer-go/server
Expand Down
4 changes: 4 additions & 0 deletions proposer/op/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,10 @@ github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKl
github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI=
github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I=
github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/status-im/keycard-go v0.2.0 h1:QDLFswOQu1r5jsycloeQh3bVU8n/NatHHaZobtDnDzA=
github.com/status-im/keycard-go v0.2.0/go.mod h1:wlp8ZLbsmrF6g6WjugPAx+IzoLrkdf9+mHxBEeo3Hbg=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
Expand Down
15 changes: 14 additions & 1 deletion proposer/op/proposer/db/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"fmt"
"os"
"path/filepath"
"time"

"github.com/succinctlabs/op-succinct-go/proposer/db/ent"
Expand All @@ -23,6 +24,13 @@ func InitDB(dbPath string, useCachedDb bool) (*ProofDB, error) {
} else {
fmt.Printf("Using cached DB at %s\n", dbPath)
}

// Create the intermediate directories if they don't exist
dir := filepath.Dir(dbPath)
if err := os.MkdirAll(dir, 0755); err != nil {
return nil, fmt.Errorf("failed to create directories for DB: %w", err)
}

connectionString := fmt.Sprintf("file:%s?_fk=1", dbPath)
client, err := ent.Open("sqlite3", connectionString)
if err != nil {
Expand Down Expand Up @@ -69,6 +77,7 @@ func (db *ProofDB) newEntryWithReqAddedTimestamp(proofType string, start, end, n
SetEndBlock(end).
SetStatus(proofrequest.StatusUNREQ).
SetRequestAddedTime(now).
SetLastUpdatedTime(now).
Save(context.Background())

if err != nil {
Expand Down Expand Up @@ -97,6 +106,7 @@ func (db *ProofDB) UpdateProofStatus(id int, newStatus string) error {
_, err := db.client.ProofRequest.Update().
Where(proofrequest.ID(id)).
SetStatus(pStatus).
SetLastUpdatedTime(uint64(time.Now().Unix())).
Save(context.Background())

return err
Expand All @@ -107,6 +117,7 @@ func (db *ProofDB) SetProverRequestID(id int, proverRequestID string) error {
Where(proofrequest.ID(id)).
SetProverRequestID(proverRequestID).
SetProofRequestTime(uint64(time.Now().Unix())).
SetLastUpdatedTime(uint64(time.Now().Unix())).
Save(context.Background())

if err != nil {
Expand Down Expand Up @@ -149,6 +160,7 @@ func (db *ProofDB) AddProof(id int, proof []byte) error {
UpdateOne(existingProof).
SetProof(proof).
SetStatus(proofrequest.StatusCOMPLETE).
SetLastUpdatedTime(uint64(time.Now().Unix())).
Save(context.Background())

if err != nil {
Expand All @@ -174,6 +186,7 @@ func (db *ProofDB) AddL1BlockInfoToAggRequest(startBlock, endBlock, l1BlockNumbe
).
SetL1BlockNumber(l1BlockNumber).
SetL1BlockHash(l1BlockHash).
SetLastUpdatedTime(uint64(time.Now().Unix())).
Save(context.Background())

if err != nil {
Expand Down Expand Up @@ -227,7 +240,7 @@ func (db *ProofDB) GetWitnessGenerationTimeoutProofsOnServer() ([]*ent.ProofRequ
Where(
proofrequest.StatusEQ(proofrequest.StatusREQ),
proofrequest.ProverRequestIDIsNil(),
proofrequest.RequestAddedTimeLT(uint64(twentyMinutesAgo)),
proofrequest.LastUpdatedTimeLT(uint64(twentyMinutesAgo)),
).
All(context.Background())

Expand Down
1 change: 1 addition & 0 deletions proposer/op/proposer/db/ent/migrate/schema.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading