Skip to content

Commit

Permalink
chore: update configs
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtaikocha committed May 25, 2023
1 parent 81ca1cf commit 1f6eed5
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 20 deletions.
6 changes: 3 additions & 3 deletions packages/protocol/contracts/L1/TaikoConfig.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ library TaikoConfig {
function getConfig() internal pure returns (TaikoData.Config memory) {
return TaikoData.Config({
chainId: 167005,
// Two weeks if avg block time is 3 seconds (is it reasonable?)
// Two weeks if avg block time is 3 seconds
maxNumProposedBlocks: 403200,
ringBufferSize: 403200 + 10,
// Each time one more block is verified, there will be ~20k
Expand All @@ -24,7 +24,7 @@ library TaikoConfig {
// Set it to 79 (+1 TaikoL2.anchor transaction = 80),
// and 80 is the upper limit of the Alpha-3 testnet's circuits.
maxTransactionsPerBlock: 79,
minEthDepositsPerBlock: 8,
minEthDepositsPerBlock: 1,
maxEthDepositsPerBlock: 32,
maxEthDepositAmount: 10000 ether,
minEthDepositAmount: 0.1 ether,
Expand All @@ -41,7 +41,7 @@ library TaikoConfig {
ethDepositGas: 21000,
ethDepositMaxFee: 1 ether / 10,
txListCacheExpiry: 0,
adjustmentQuotient: 16,
adjustmentQuotient: 16, // https://github.com/taikoxyz/taiko-mono/pull/13809
relaySignalRoot: false
});
}
Expand Down
4 changes: 2 additions & 2 deletions packages/protocol/script/DeployOnL1.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ contract DeployOnL1 is Script {

address public sharedSignalService = vm.envAddress("SHARED_SIGNAL_SERVICE");

address public treasury = vm.envAddress("TREASURY"); // Q: which address will we use?
address public treasury = vm.envAddress("TREASURY"); // 0xdf09A0afD09a63fb04ab3573922437e1e637dE8b

address public taikoTokenPremintRecipient = vm.envAddress("TAIKO_TOKEN_PREMINT_RECIPIENT");

Expand All @@ -49,7 +49,7 @@ contract DeployOnL1 is Script {
// For testnet it could be somewhere 85-100s
// For mainnet it could be around 1800 s (30mins)
// Can be adjusted later with setters
uint64 public INITIAL_PROOF_TIME_TARGET = uint64(vm.envUint("INITIAL_PROOF_TIME_TARGET")); // Q: INITIAL_PROOF_TIME_TARGET=`120s`? => initProofTimeIssued will be `49883`
uint64 public INITIAL_PROOF_TIME_TARGET = uint64(vm.envUint("INITIAL_PROOF_TIME_TARGET")); // 160s

TaikoL1 taikoL1;
address public addressManagerProxy;
Expand Down
30 changes: 19 additions & 11 deletions packages/protocol/test/Taiko1559Params.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,23 @@ import {SafeCastUpgradeable} from
contract TestTaiko1559Params is Test {
using SafeCastUpgradeable for uint256;

function testAndVerifyTaiko1559Params() external {
// Assume we scale L1 throughput by 10 times.
uint64 scaleFactor = 10;
function run() external {
this.testAndVerifyTaiko1559Params();
}

// We make gasIssuedPerSecond 2,000,000 gas/s == 4 L2 blocks of 6M gas/L1 block,
// and leave the costFactor as it is.
function testAndVerifyTaiko1559Params() external {
// Assume we lower the L1 transaction cost by 25 times.
uint64 costFactor = 25;

// Calculate gas space issuance per second
uint64 ethereumBlockGasTarget = 15000000;
uint64 ethereumBlockTime = 12;

// https://ultrasound.money/
uint64 ethereumBasefeeNow = 28000000000; // 28Gwei

uint64 gasIssuedPerSecond = (scaleFactor * ethereumBlockGasTarget) / ethereumBlockTime;
uint64 gasIssuedPerSecond = 4 * 6000000 / ethereumBlockTime; // We make gasIssuedPerSecond 2,000,000 gas/s == 4 L2 blocks of 6M gas/L1 block

// Tune this number manually so ratio2x1x is ~112.5%.
uint64 maxSeconds = 7272;
Expand All @@ -42,19 +44,25 @@ contract TestTaiko1559Params is Test {
ratio2x1x: 11250 // ~12.5% increase
});

TaikoL2 L2 = new TaikoL2();
L2.init(address(1), param1559); // Dummy address manager address.

console2.log("basefee :", param1559.basefee);
console2.log("gasIssuedPerSecond:", param1559.gasIssuedPerSecond);
console2.log("gasExcessMax :", param1559.gasExcessMax);
console2.log("gasTarget :", param1559.gasTarget);
console2.log("ratio2x1x :", param1559.ratio2x1x);
console2.log("yscale :", L2.yscale());
console2.log("xscale :", L2.xscale());
console2.log("gasExcess :", L2.gasExcess());

// basefee : 1120000000
// gasIssuedPerSecond: 12500000
// gasExcessMax : 90900000000
// gasTarget : 150000000
// gasIssuedPerSecond: 2000000
// gasExcessMax : 14544000000
// gasTarget : 24000000
// ratio2x1x : 11250

TaikoL2 L2 = new TaikoL2();
L2.init(address(1), param1559); // Dummy address manager address.
// yscale : 2239367572216867291982809680751
// xscale : 9303217778
// gasExcess : 7272000000
}
}
8 changes: 4 additions & 4 deletions packages/protocol/test/genesis/test_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@
"SignalServiceProxy": "0x1000777700000000000000000000000000000007"
},
"param1559": {
"yscale": "358298803609133338137582400989", // Q: do we need to change this?
"xscale": "1488514844", // Q: do we need to change this?
"gasIssuedPerSecond": "2000000", // If we assume the avg block time is 3s (is it reasonable?) , and each block is full (block.gasLimit=6m)
"gasExcess": "45450000000" // Q: do we need to change this?
"yscale": "2239367572216867291982809680751",
"xscale": "9303217778",
"gasIssuedPerSecond": "2000000",
"gasExcess": "7272000000"
},
"predeployERC20": true
}

0 comments on commit 1f6eed5

Please sign in to comment.