Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
ratankaliani committed Sep 11, 2024
1 parent 104edf6 commit 9f8c9a4
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 58 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ OP Succinct turns any OP stack rollup into a full type-1 zkEVM Rollup in 1 hour

> [!CAUTION]
>
> This repository is still an active work-in-progress and is not audited or meant for production usage.
> This repository is not meant for production usage.
## Getting Started

Expand Down
4 changes: 2 additions & 2 deletions contracts/script/ZKDeployer.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ contract ZKDeployer is Script, Utils {
vm.startBroadcast();

Config memory config = readJsonWithRPCFromEnv("zkconfig.json");
// TODO: This seems wrong. Why are we using the msg.sender as a proxy?
config.l2OutputOracleProxy = address(new Proxy(msg.sender));
// Note: The owner of the proxy shouldn't be the msg.sender.
config.l2OutputOracleProxy = address(new Proxy(config.owner));

address zkL2OutputOracleImpl = address(new ZKL2OutputOracle());

Expand Down
25 changes: 0 additions & 25 deletions contracts/test/Upgrade.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,31 +14,6 @@ contract UpgradeTest is Test, Utils {
assertEq(config.proposer, address(0));
}

// TODO: These tests are failing because we need to figure out which chain they're associated with.
// function testFetchOutputRoot() public {
// Config memory config = readJsonWithRPCFromEnv("zkconfig.json");
// (bytes32 root, uint256 ts) = fetchOutputRoot(config);
// assertEq(root, 0x6a2fb9128c8bc82eed49ee590fba3e975bd67fede20535d0d20b3000ea6d99b1);
// assertEq(ts, 1691802540);
// }

// function testUpgradeWorks() public {
// vm.createSelectFork("https://eth.llamarpc.com", 20528129);

// Config memory config = readJsonWithRPCFromEnv("zkconfig.json");
// config.l2OutputOracleProxy = 0xdfe97868233d1aa22e815a266982f2cf17685a27;

// address optimismProxyAdmin = 0x543bA4AADBAb8f9025686Bd03993043599c6fB04;
// address newImpl = address(new ZKL2OutputOracle());

// upgradeAndInitialize(newImpl, config, optimismProxyAdmin, bytes32(0), 0);

// ZKL2OutputOracle l2oo = ZKL2OutputOracle(config.l2OutputOracleProxy);
// assertEq(l2oo.owner(), address(0));
// assertEq(address(l2oo.verifierGateway()), 0x3B6041173B80E77f038f3F2C0f9744f04837185e);
// assertEq(l2oo.proposer(), address(0));
// }

function testFreshDeployment() public {
bytes32 exampleOutputRoot = keccak256("output root");
vm.warp(12345678);
Expand Down
4 changes: 0 additions & 4 deletions programs/aggregation/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ use sha2::{Digest, Sha256};
/// The verification key for the multi-block program.
///
/// Whenever the multi-block program changes, you will need to update this.
///
/// TODO: The aggregation program should take in an arbitrary vkey digest and the smart contract
/// should verify the proof matches the arbitrary vkey digest stored in the contract. This means
/// that the aggregate program would no longer need to update this value.
const MULTI_BLOCK_PROGRAM_VKEY_DIGEST: [u32; 8] =
[941772999, 1277538870, 1655999821, 1372179823, 58726408, 594788167, 675948275, 736718718];

Expand Down
33 changes: 7 additions & 26 deletions proposer/op/proposer/prove.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,32 +86,13 @@ func (l *L2OutputSubmitter) RetryRequest(req *ent.ProofRequest) error {
return err
}
} else {
// If a SPAN proof failed, assume it was too big and the SP1 runtime OOM'd.
// Therefore, create two new entries for the original proof split in half.
if req.StartBlock+1 == req.EndBlock {
// If the start and end block are consecutive, we can't split the proof in half.
l.Log.Info("Span proof failed. Start and end block are consecutive. Adding to DB to retry.", "req", req)
err := l.db.NewEntryWithReqAddedTimestamp("SPAN", req.StartBlock, req.EndBlock, 0)
if err != nil {
l.Log.Error("failed to add new proof request", "err", err)
return err
}
} else {
// We split in half to retry by default in case the runtime OOM'd.
l.Log.Info("Span proof failed. Start and end block are not consecutive. Splitting in half to retry.", "req", req)
midPoint := req.StartBlock + ((req.EndBlock - req.StartBlock) / 2)

err := l.db.NewEntryWithReqAddedTimestamp("SPAN", req.StartBlock, midPoint, 0)
if err != nil {
l.Log.Error("failed to add first half proof request", "err", err)
return err
}

err = l.db.NewEntryWithReqAddedTimestamp("SPAN", midPoint+1, req.EndBlock, 0)
if err != nil {
l.Log.Error("failed to add second half proof request", "err", err)
return err
}
// Always just retry SPAN proofs to avoid spamming the cluster with requests.
// TODO: We may need to split the SPAN proof in half to avoid OOMing the SP1 runtime.
l.Log.Info("Span proof failed. Adding to DB to retry.", "req", req)
err := l.db.NewEntryWithReqAddedTimestamp("SPAN", req.StartBlock, req.EndBlock, 0)
if err != nil {
l.Log.Error("failed to add new proof request", "err", err)
return err
}
}

Expand Down

0 comments on commit 9f8c9a4

Please sign in to comment.