This repository has been archived by the owner on Nov 2, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 440
Add spend transaction fees to host financial metrics after completion… #3092
Open
nielscastien
wants to merge
1
commit into
NebulousLabs:master
Choose a base branch
from
nielscastien:add-txnfee
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 don't think that this change is correct. It assumes that we never add the storage obligation's
TransactionFeesAdded
field to the host's financial metrics which is not correct. In fact we already add that field to the storage obligation when it is created or modified.The real problem seems to be that we potentially modify the
so.TransactionFeesAdded
field after adding it to the host's financial metrics in 'threadedHandleActionItem', resulting in the host's financial metrics to no longer being accurate.I would like to hear what @DavidVorick and @lukechampine think about it, but I think there are 2 solutions to this.
Either way we would need to add a test that confirms that the host's metrics are accurate. Looks like this is not currently covered by our test suit.
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.
@ChrisSchinnerl thanks for reviewing! You are right that there are several places where
TransactionFeesAdded
are added to the host's financial metrics. The problem is that these fields are always zero. This is true for new contracts as well as for renewed contracts.The current PR adds the transaction fees at the end when the obligation is removed from the host's database. This is the simplest way and we can remove the other lines where the host's financial metrics are updated. The downside is that the value would be lagging.
I think the proposal to update of the financial metrics during
threadedHandleActionItem
is a better solution. If there is consensus about how to update the value I will change and resubmit the PR.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.
Yeah lagging values might be confusing. Depending on @DavidVorick 's plans for the host module, your solution + removing the other lines might be the easiest one if we want to completely overhaul the host module in the future anyway.
If we don't want to overhaul all of it, I would recommend to update the metrics in 'threadedHandleActionItem' and also remove the lines to avoid confusion.