Skip to content
This repository has been archived by the owner on Jun 6, 2023. It is now read-only.

BatchBalancer fee charged on precommit aggregate #1497

Merged
merged 10 commits into from
Oct 1, 2021

Conversation

ZenGround0
Copy link
Contributor

WIP #1492

@codecov-commenter
Copy link

codecov-commenter commented Sep 26, 2021

Codecov Report

Merging #1497 (0ed36e0) into master (ea6fa6b) will increase coverage by 0.0%.
The diff coverage is 100.0%.

@@          Coverage Diff           @@
##           master   #1497   +/-   ##
======================================
  Coverage    71.5%   71.5%           
======================================
  Files          72      72           
  Lines        8612    8620    +8     
======================================
+ Hits         6159    6167    +8     
  Misses       1563    1563           
  Partials      890     890           

@ZenGround0 ZenGround0 force-pushed the feat/batch-balancer-in-precommit branch from e586232 to 88ee459 Compare October 1, 2021 14:15
@ZenGround0 ZenGround0 marked this pull request as ready for review October 1, 2021 14:47
@ZenGround0 ZenGround0 requested a review from a team as a code owner October 1, 2021 14:47
@ZenGround0 ZenGround0 force-pushed the feat/batch-balancer-in-precommit branch from 0a70226 to 26fc40a Compare October 1, 2021 14:52
return AggregateNetworkFee(aggregateSize, EstimatedSinglePreCommitGasUsage, baseFee)
}

func AggregateNetworkFee(aggregateSize int, gasUsage big.Int, baseFee abi.TokenAmount) abi.TokenAmount {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we not export this? I don't think it's needed, and it's only too easy for something (Lotus) to misuse this since it shares a name with the v5 method

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no problem

@@ -211,15 +211,25 @@ func LockedRewardFromReward(reward abi.TokenAmount) (abi.TokenAmount, *VestSpec)
}

var EstimatedSingleProofGasUsage = big.NewInt(65733297) // PARAM_SPEC
var BatchDiscount = builtin.BigFrac{ // PARAM_SPEC
var EstimatedSingleProveCommitGasUsage = big.NewInt(49299973)
Copy link
Collaborator

Choose a reason for hiding this comment

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

  1. You should be able to nuke EstimatedSingleProofGasUsage above^
  2. Out of curiosity, where do these numbers come from?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They are rough estimates of the mean gas used per single PreCommit and ProveCommit. Empirically measured from tests and validated with small samples of on chain gas values. Wouldn't be surprised if they need tweaking down the line.

@ZenGround0 ZenGround0 force-pushed the feat/batch-balancer-in-precommit branch from 7c7f2ad to 0ed36e0 Compare October 1, 2021 16:34
@ZenGround0 ZenGround0 merged commit a2369c5 into master Oct 1, 2021
@ZenGround0 ZenGround0 added this to the Network v14 milestone Oct 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants