-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Conversation
Codecov Report
@@ 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
*This pull request uses carry forward flags. Click here to find out more.
... 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)) |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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]; |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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 ?
No description provided.