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): Auctioning - DRAFT, not ready #13811

Closed
wants to merge 12 commits into from
Closed

Conversation

cyberhorsey
Copy link
Contributor

No description provided.

@cyberhorsey cyberhorsey marked this pull request as draft May 24, 2023 22:57
@codecov
Copy link

codecov bot commented May 24, 2023

Codecov Report

Merging #13811 (0ced3d5) into main (ccecd70) will decrease coverage by 0.02%.
The diff coverage is n/a.

❗ Current head 0ced3d5 differs from pull request most recent head 841badf. Consider uploading reports for the commit 841badf to get more accurate results

@@            Coverage Diff             @@
##             main   #13811      +/-   ##
==========================================
- Coverage   47.24%   47.22%   -0.02%     
==========================================
  Files         131      131              
  Lines        3357     3354       -3     
  Branches      310      309       -1     
==========================================
- Hits         1586     1584       -2     
+ Misses       1668     1667       -1     
  Partials      103      103              
Flag Coverage Δ *Carryforward flag
bridge-ui 96.16% <ø> (ø) Carriedforward from 33d8710
eventindexer 82.08% <ø> (ø)
protocol 0.00% <ø> (ø) Carriedforward from 33d8710
relayer 60.58% <ø> (-0.14%) ⬇️
ui 100.00% <ø> (ø) Carriedforward from 33d8710

*This pull request uses carry forward flags. Click here to find out more.

Impacted Files Coverage Δ
packages/protocol/contracts/L1/TaikoL1.sol 0.00% <ø> (ø)
...ckages/protocol/contracts/L1/libs/LibProposing.sol 0.00% <ø> (ø)
packages/protocol/contracts/L1/libs/LibProving.sol 0.00% <ø> (ø)
packages/protocol/contracts/L1/libs/LibUtils.sol 0.00% <ø> (ø)
...ckages/protocol/contracts/L1/libs/LibVerifying.sol 0.00% <ø> (ø)
...ages/protocol/contracts/common/AddressResolver.sol 0.00% <ø> (ø)
...es/protocol/contracts/common/EssentialContract.sol 0.00% <ø> (ø)
...ackages/protocol/contracts/test/L1/TestTaikoL1.sol 0.00% <ø> (ø)
.../contracts/test/L1/TestTaikoL1EnableTokenomics.sol 0.00% <ø> (ø)

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

) internal view {
TaikoData.Bid memory currentBid = state.bids[blockId];
// if theres no bids, revert, nobody is able to prove this block yet.
if (currentBid.bidder == address(0) || LibAuction.isBiddingOpenForBlock(config, currentBid))
Copy link
Contributor

@adaki2004 adaki2004 May 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

currentBid.bidder == address(0) is also checked in LibAuction.isBiddingOpenForBlock().

Question also: if there are no bids (noone wants to bid) we are not closing the auction window ? Simply leave it open until a bid comes in ?

view
returns (bool)
{
if (currentBid.bidder == address(0)) return true;
Copy link
Contributor

@adaki2004 adaki2004 May 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, it is an 'open ended' auction window (lemme know if blind on here). If yes, are we sure we want this ? I mean, something like a fallback solution.. ? (if X minutes there is no bid, we dont wait and 'free market', others can submit proofs.

view
returns (uint256)
{
TaikoData.Bid memory bid = state.bids[blockId];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it be blockId % config.ringBufferSize ? Or simply passing currentBid memory var from line 54 if this is an internal only function - if not or later on will / can be public, i guess then fine but still need % ringbuffer

return 0;
}

return bid.minFeePerGasAcceptedInWei + ((bid.minFeePerGasAcceptedInWei * 1000) / 10000);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • should not we deduct instead of sum here, because if someone bidded 100, the max possible should be 90 now, no ?
  • bid.minFeePerGasAcceptedInWei has to be over 10 always, cause the second part would be always 0, but usually (basefee + tip) is a small number anyways, (fixed point 18 arithmetic would help tho on this resolution).

}

// transfer deposit from bidder to this contract
tkoToken.transferFrom(msg.sender, address(this), msg.value);
Copy link
Contributor

@adaki2004 adaki2004 May 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know we dont know gas yet, but we somehow need to check if msg.value is enough covering the cost, if he/she is a malicious prover, no ? 🤔


(state.proofTimeIssued, state.blockFee) =
LibTokenomics.getNewBlockFeeAndProofTimeIssued(state, config, proofTime);
uint256 reward = uint256(fc.gasUsed) * winningBid.minFeePerGasAcceptedInWei;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How to convert ether to TKO here ? Or would it be an off-chain thing ? Ppl. calculate X gwei in ETH to Y gwei in TKO and submit the bid that way ?

@dantaik dantaik deleted the auctioning branch September 25, 2023 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants