-
Notifications
You must be signed in to change notification settings - Fork 51
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
Feature/Fix: Add simulated transaction fee to calculations.csv and fix compute logic #549
Conversation
this conflicts with adjusted early payouts, but not in a big way for now. |
I agree on the renaming of the variables. They need to be expressive. Did you test it with example cycles of certain bakers? A normal transaction is not calculated, right (tz to tz address). Only tz to kt? Is the sum of fees the overall fee of a batch and do you just divide the sum through the items in the batch? |
@nicolasochem should we merge this PR before? The impact on the code is rather minor compared to yours? :) |
@vkresch batch_payer.py has the constants for fee limits. As I read it they are taken as "lowest value" to start every transaction with and adjust the fee in the simulation process. It will be interesting to see what the descrepancy between the set fee and the actual consumed fee will be. |
ce6f55d
to
cc5f9b7
Compare
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.
This PR fills the done payment reports with a value taken from batch_payout.py. For the payout to tz addresses, this value is TZTX_FEE
of 395 mutez, for a payout to a kt1 address it is TZTX_FEE + COST_PER_BYTE * storage limit
if I read the code correctly.
I am not very familiar with tezos fee mechanisms and it is the first time I look at this logic, so beware.
I think I need a better user story than what's currently on #455 to review this. It says "for accounting purposes".
You can configure TRD to pay the fee or take it away from the delegator. Does #455 assume that the bakery pays the fee, so this value is needed for bakery accounting?
If this is the case, should this new column not be filled with zeroes when the baker takes the fee away from the delegator? Or should we have 2 columns "fees_paid_by_delegate" "fees_paid_by_delegator"
Second, this PR populates the column with fee estimates. But the ticket says "actual fees". Is this PR the prelude to another one?
I think it is not possible to accurately estimate the fee for a KT1 payout because the actual fee depends on all transactions in the bloc, not just the one you are signing. But TRD estimates the fee for a KT1 payout and substracts it if configured to do so. Do we want to use this estimate in the payout done column? Is it not better to look at the inclusion block and put the actual fee paid in there? (if at all possible)
@jdsika please clarify
I apologize for the bad user story. You are absolutely right that it is not sufficient!
Yes, I absolutely agree with this. I had the same conversation with @dansan566
Yes, this should be part of the calculations and we need to introduce a post processing step if needed in the payments report later. Steps:
|
ok, so in the absence of bugs, do we want this merged as is? |
Look at my comment. I think there ARE bugs or at least inconsistencies...
What did I find on transaction costs: |
Yes, simulated fee belongs to the calculations csv. Note that instead of 2 columns (paid by delegate/paid by delegator) we could have a column with uppercase letter Some months ago I raised a bug about I am not quite sure what to do with this PR. Perhaps involve the original author of the fee logic? Maybe let's not touch this until tenderbake is done? |
@nicolasochem I just talked to @amzid and he will fix the errors at the weekend! |
…t signal location.
…ezos-reward-distributor-organization/tezos-reward-distributor into feature/transaction_fee_report
@utdrmac I disabled the test now. Otherwise we will never get things running for Tenderbake |
I tried this code out by merging it in my ithaca branch. I saw in the calculation csv that there are 2 new columns
Normally either the delegate or the delegator pay the fee, but here I can see that for my first payout, both delegator and delegate fee are positive. How come? |
The first entry is your baker which displays the sum of all values below. The same way as it sums the overestimate e.g. BTW there are two options in the config:
You can set one to True and the other to False and if there are burn fees then both columns in a row are populated. |
@nicolasochem maybe we have to check for the standard fees here |
Calculations look good between the TRD used in production and this branch. I will run the next payment on this branch (i just need to adjust the changes related to the config reorganisation). |
* fix "not in payment log" status in calculation When adding #540 (advanced early payout) I made an assumption that "payable" should be set to false if the adjustment is bigger than the payout, resulting in an adjusted amount of 0. It turns out, there are other reasons for adjusted_amount to be zero (such as a payout redirect). The code handles it later. The positive check affects this and results in unexpected description of the payout in csv file. Consequently I am removing this >0 check. * Fixed a bug in the validation of args for not existing objects * Contributor: nicolasochem, Effort=Compensated * Reviewer/Debugger: jdsika, Effort=2h
Partial fix for #455
Resolves #567
Resolves #565
Resolves #441
Resolves #512
fixes #430
Proper error message in description fixes #270
The payments have been correct for all tz accounts. kt accounts with burn fees have been incorrect. ONLY the reporting had major bugs in the .csv report. The overall terminal logs have been correct. Reported overall payout amount has been incorrect.
General:
TODO:
Fix:
delegator_pays_ra_fee
(Reactivation fee), fixed documentationAVOIDED
DONE
according to the definitionTests:
test_attempt_single_batch_tz
which test if thetransaction_fee
gets calculated correctlytest_gas_estimation_oven_kt1.py
is now failing as the RPC call never workedNote:
vkresch, Effort=6h
amzid, Effort=2h
jdsika, Effort=32h (from other branch as well)
Remark: jdsika spent hours on phone calls and messages to figure out all the broken parts here and fix them in the PR as well as hours debugging reporting errors.