Skip to content

Commit

Permalink
remove deposit for now
Browse files Browse the repository at this point in the history
  • Loading branch information
dantaik committed Nov 27, 2022
1 parent 6b0c3f8 commit 900d6ab
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 22 deletions.
3 changes: 1 addition & 2 deletions packages/protocol/contracts/L1/LibData.sol
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,9 @@ library LibData {
uint64 commitSlot;
}

// 3 slots
// 2 slots
struct ProposedBlock {
bytes32 metaHash;
uint256 deposit;
address proposer;
uint64 proposedAt;
}
Expand Down
4 changes: 2 additions & 2 deletions packages/protocol/contracts/L1/TaikoL1.sol
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,8 @@ contract TaikoL1 is EssentialContract, IHeaderSync, V1Events {
return V1Proving.isProverWhitelisted(state, prover);
}

function getBlockFees() public view returns (uint256 fee, uint256 deposit) {
(, fee, deposit) = V1Proposing.getBlockFees(state);
function getBlockFees() public view returns (uint256 fee) {
(, fee) = V1Proposing.getBlockFees(state);
}

function getProofReward(
Expand Down
9 changes: 3 additions & 6 deletions packages/protocol/contracts/L1/v1/V1Proposing.sol
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,13 @@ library V1Proposing {
meta.mixHash = bytes32(block.difficulty);
}

uint256 deposit;
if (LibConstants.K_TOKENOMICS_ENABLED) {
uint256 fee;
uint256 premiumFee;
(fee, premiumFee, deposit) = getBlockFees(state);
(fee, premiumFee) = getBlockFees(state);
TkoToken(resolver.resolve("tko_token")).burn(
msg.sender,
premiumFee + deposit
premiumFee
);

// Update feeBase and avgBlockTime
Expand All @@ -117,7 +116,6 @@ library V1Proposing {
state.nextBlockId,
LibData.ProposedBlock({
metaHash: LibData.hashMetadata(meta),
deposit: deposit,
proposer: msg.sender,
proposedAt: meta.timestamp
})
Expand All @@ -129,7 +127,7 @@ library V1Proposing {

function getBlockFees(
LibData.State storage state
) public view returns (uint256 fee, uint256 premiumFee, uint256 deposit) {
) public view returns (uint256 fee, uint256 premiumFee) {
fee = V1Utils.getTimeAdjustedFee({
state: state,
isProposal: true,
Expand All @@ -140,7 +138,6 @@ library V1Proposing {
});
premiumFee = V1Utils.getSlotsAdjustedFee(state, true, fee);
premiumFee = V1Utils.getBootstrapDiscountedFee(state, premiumFee);
deposit = (premiumFee * LibConstants.K_PROPOSER_DEPOSIT) / 100;
}

function isCommitValid(
Expand Down
11 changes: 0 additions & 11 deletions packages/protocol/contracts/L1/v1/V1Verifying.sol
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,6 @@ library V1Verifying {
// Reward multiple provers
_rewardProvers(fc, premiumReward, tkoToken);

// Return proposer deposit
_refundProposerDeposit(target, fc.provenAt, tkoToken);

// Update feeBase and avgProofTime
state.feeBase = V1Utils.movingAverage({
maValue: state.feeBase,
Expand Down Expand Up @@ -152,14 +149,6 @@ library V1Verifying {
10000;
}

function _refundProposerDeposit(
LibData.ProposedBlock storage target,
uint256 provenAt,
TkoToken tkoToken
) private {
// TODO
}

function _rewardProvers(
LibData.ForkChoice storage fc,
uint256 premiumReward,
Expand Down
1 change: 0 additions & 1 deletion packages/protocol/contracts/libs/LibConstants.sol
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ library LibConstants {
uint256 public constant K_TX_MIN_GAS_LIMIT = 21000; // TODO
uint256 public constant K_REWARD_BURN_POINTS = 100; // 1%
uint256 public constant K_ANCHOR_TX_GAS_LIMIT = 250000;
uint256 public constant K_PROPOSER_DEPOSIT = 100;

// Moving average factors
uint256 public constant K_FEE_BASE_MAF = 1024;
Expand Down

0 comments on commit 900d6ab

Please sign in to comment.