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: re-enable relevant record pricing as the basis for cost/storage #1497

Closed
wants to merge 3 commits into from

Conversation

joshuef
Copy link
Contributor

@joshuef joshuef commented Mar 25, 2024

Description

reviewpad:summary

@joshuef joshuef marked this pull request as ready for review March 25, 2024 06:05
Copy link
Member

@maqi maqi left a comment

Choose a reason for hiding this comment

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

I'd suggest to split this PR into three:
1, lower the exponential pricing trigger to be 60%
2, remove payment_received times factor in pricing
3, re-introduce relevant records calculation

so that they can be better discussed/approved and merged better and quicker

@joshuef
Copy link
Contributor Author

joshuef commented Mar 26, 2024

@maqi I appreciate that separating things out might clarify each, but I'm not clear what's contentious in those parts?

for me:

2, remove payment_received times factor in pricing

This has to go as is subjective to the node and cannot be verified. (It was added as a simple way to get nodes paid sooner, but it plays with pricing in odd ways, so best to get rid).

3, re-introduce relevant records calculation

This is probably the most controversial? It's a simple change we'll need to evaluate though, so I wouldn't be shy about adding it back in, myself.

and 1 is something else to test, 90 felt too slow, so Let's try 60? Again, something to feel out, but now sure separate PRs is worthwhile (removing the payment_received times is a whack of refactoring on its own, so I'd like to avoid it if we can :D

self.received_payment_count);
NanoTokens::from(cost)
}
let record_keys_as_hashset: HashSet<Key> = self.records.keys().cloned().collect();
Copy link
Member

Choose a reason for hiding this comment

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

I think we can prevent a clone here if we just collect the &Key. You might have to modify get_records_within_distance_range to accept references of keys.

/// Notify the node received a payment.
pub(crate) fn payment_received(&mut self) {
self.received_payment_count = self.received_payment_count.saturating_add(1);
if let Some(distance_range) = self.distance_range {
Copy link
Member

Choose a reason for hiding this comment

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

I think the distance_range is not set until we have reached the max num of records inside prune_storage_if_needed_for_record. So think we might have to tweak how we set the distance_range value.

@JasonPaulGithub JasonPaulGithub added the Medium Medium sized PR label Mar 27, 2024
@joshuef joshuef closed this Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Medium Medium sized PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants