Skip to content

Commit

Permalink
refactor(protocol): remove LibTokenomics from LibProposing (#13801)
Browse files Browse the repository at this point in the history
  • Loading branch information
dantaik authored May 23, 2023
1 parent 34de89c commit b5f22e5
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 8 deletions.
4 changes: 1 addition & 3 deletions packages/protocol/contracts/L1/libs/LibProposing.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ pragma solidity ^0.8.18;
import {AddressResolver} from "../../common/AddressResolver.sol";
import {LibAddress} from "../../libs/LibAddress.sol";
import {LibEthDepositing} from "./LibEthDepositing.sol";
import {LibTokenomics} from "./LibTokenomics.sol";
import {LibUtils} from "./LibUtils.sol";
import {SafeCastUpgradeable} from
"@openzeppelin/contracts-upgradeable/utils/math/SafeCastUpgradeable.sol";
Expand Down Expand Up @@ -61,8 +60,7 @@ library LibProposing {
meta.gasLimit = input.gasLimit;
meta.beneficiary = input.beneficiary;
meta.treasury = resolver.resolve(config.chainId, "treasury", false);
meta.depositsProcessed =
LibEthDepositing.processDeposits(state, config, input.beneficiary);
meta.depositsProcessed = LibEthDepositing.processDeposits(state, config, input.beneficiary);

unchecked {
meta.timestamp = uint64(block.timestamp);
Expand Down
3 changes: 1 addition & 2 deletions packages/protocol/contracts/L1/libs/LibProving.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ pragma solidity ^0.8.18;

import {AddressResolver} from "../../common/AddressResolver.sol";
import {LibMath} from "../../libs/LibMath.sol";
import {LibTokenomics} from "./LibTokenomics.sol";
import {LibUtils} from "./LibUtils.sol";
import {TaikoData} from "../../L1/TaikoData.sol";

Expand Down Expand Up @@ -164,7 +163,7 @@ library LibProving {
uint256(uint160(address(resolver.resolve(config.chainId, "signal_service", false))));
inputs[2] = uint256(uint160(address(resolver.resolve(config.chainId, "taiko", false))));

inputs[3] = uint256(blk.metaHash);
inputs[3] = uint256(evidence.metaHash);
inputs[4] = uint256(evidence.parentHash);
inputs[5] = uint256(evidence.blockHash);
inputs[6] = uint256(evidence.signalRoot);
Expand Down
1 change: 0 additions & 1 deletion packages/protocol/contracts/L1/libs/LibUtils.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ pragma solidity ^0.8.18;

import {LibMath} from "../../libs/LibMath.sol";
import {LibEthDepositing} from "./LibEthDepositing.sol";
import {LibTokenomics} from "./LibTokenomics.sol";
import {SafeCastUpgradeable} from
"@openzeppelin/contracts-upgradeable/utils/math/SafeCastUpgradeable.sol";
import {TaikoData} from "../TaikoData.sol";
Expand Down
2 changes: 1 addition & 1 deletion packages/protocol/script/DetermineNewProofTimeIssued.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ uint16 constant DESIRED_PROOF_TIME_TARGET = 500;
uint8 constant ADJUSTMENT_QUOTIENT = 16;

contract DetermineProofTimeIssued is Script {
function run() public {
function run() public view {
uint16 proofTimeTarget = DESIRED_PROOF_TIME_TARGET; // Approx. value which close to what is in the simulation
uint64 feeBase = 1e8; // 1 TKO
uint64 initProofTimeIssued =
Expand Down
3 changes: 2 additions & 1 deletion packages/protocol/test/TaikoL1.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,8 @@ contract TaikoL1Test is TaikoL1TestBase {
// Expected: 0x8117066d69ff650d78f0d7383a10cc802c2b8c0eedd932d70994252e2438c636 (pre calculated with these values)
//console2.logBytes32(meta.depositsRoot);
assertEq(
LibEthDepositing.hashEthDeposits(meta.depositsProcessed), 0x8117066d69ff650d78f0d7383a10cc802c2b8c0eedd932d70994252e2438c636
LibEthDepositing.hashEthDeposits(meta.depositsProcessed),
0x8117066d69ff650d78f0d7383a10cc802c2b8c0eedd932d70994252e2438c636
);
}
}

0 comments on commit b5f22e5

Please sign in to comment.