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(protocol): Increase the probability of sgx proof for lab proposer #18288

Merged
merged 2 commits into from
Oct 24, 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
26 changes: 16 additions & 10 deletions packages/protocol/contracts/layer1/hekla/HeklaTierProvider.sol
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,23 @@ contract HeklaTierProvider is TierProviderBase, ITierRouter {

/// @inheritdoc ITierProvider
function getMinTier(address _proposer, uint256 _rand) public pure override returns (uint16) {
if (_proposer == LAB_PROPOSER && _rand % 1000 == 0) {
// 0.1% of the total blocks will require ZKVM Risc0 proofs.
return LibTiers.TIER_ZKVM_RISC0;
} else if (_proposer == LAB_PROPOSER && _rand % 1000 == 1) {
// 0.1% of the total blocks will require ZKVM Sp1 proofs.
return LibTiers.TIER_ZKVM_SP1;
} else if (_rand % 2 == 0) {
// 50% of the total blocks will require SGX proofs.
return LibTiers.TIER_SGX;
if (_proposer == LAB_PROPOSER) {
if (_rand % 1000 == 0) {
// 0.1% of the total blocks will require ZKVM Risc0 proofs.
return LibTiers.TIER_ZKVM_RISC0;
} else if (_rand % 1000 == 1) {
// 0.1% of the total blocks will require ZKVM Sp1 proofs.
return LibTiers.TIER_ZKVM_SP1;
} else {
return LibTiers.TIER_SGX;
}
} else {
return LibTiers.TIER_OPTIMISTIC;
if (_rand % 2 == 0) {
// 50% of the total blocks will require SGX proofs.
return LibTiers.TIER_SGX;
} else {
return LibTiers.TIER_OPTIMISTIC;
}
}
}
}
3 changes: 2 additions & 1 deletion packages/protocol/deployments/hekla-contract-logs.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,14 @@

### tierRouter

- impl: `0xE17dBD745f0144b8b7133cbBA044B74Ff34A7aA2`
- impl: `0xACF97d3b3c15c3C009eB04a640954d48237fc3ff`
- logs:
- deployed on Jun 10, 2024 at commit `d5965bb`
- upgraded on Jun 14, 2024 at commit `cc10b04`
- upgraded on Jun 19, 2024 at commit `b7e12e3`
- upgraded on Aug 15, 2024 at commit `05d49b0`
- upgraded on Sep 02, 2024 at commit `9dae5c8`
- upgraded on Oct 24, 2024 at commit `78f9ac0`

### prover_set

Expand Down