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

Feature/plmc 266 add verification code on extrinsic benchmarks #89

Merged

Conversation

JuaniRios
Copy link
Contributor

No description provided.

@linear
Copy link

linear bot commented Oct 2, 2023

@JuaniRios JuaniRios self-assigned this Oct 2, 2023
@lrazovic lrazovic assigned vstam1 and unassigned JuaniRios Oct 11, 2023
@vstam1 vstam1 marked this pull request as ready for review October 16, 2023 14:26
Evaluations::<T>::get((project_id, evaluator.clone(), evaluation_to_unbond.id)).unwrap();
assert!(stored_evaluation.rewarded_or_slashed);
let slashed_amount = T::EvaluatorSlash::get() * evaluation_to_unbond.original_plmc_bond;
let current_plmc_bond = evaluation_to_unbond.current_plmc_bond.saturating_sub(slashed_amount);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In this case the evaluator is not participating in any other round so its fine.
But keep in mind that evaluators can use their plmc bonded in the evaluation phase to participate in bid/contribution rounds.
If this happens then the current_bond is reduced, even though no slash occured.


// validity checks
assert_eq!(project_status, UpdateType::ProjectDecision(FundingOutcomeDecision::AcceptFunding));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let's add an event to this


// * validity checks *
// Storage
assert!(!Bids::<T>::contains_key((project_id, bidder.clone(), stored_bid.id)));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice check, will def steal it :D

Copy link
Member

@lrazovic lrazovic left a comment

Choose a reason for hiding this comment

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

Solid update on the benchmarks! I've added a few minor comments in addition to Juan's. Please note there are some unnecessary .clone() instances scattered throughout, but they can be addressed in a subsequent PR.

current_plmc_bond,
rewarded_or_slashed,
..
} if project_id == project_id &&
Copy link
Member

Choose a reason for hiding this comment

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

project_id is always equal to itself, or am I missing something?

evaluator == evaluator.clone() &&
original_plmc_bond == plmc_for_evaluating[0].plmc_amount &&
current_plmc_bond == plmc_for_evaluating[0].plmc_amount &&
rewarded_or_slashed == false => {},
Copy link
Member

Choose a reason for hiding this comment

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

nitpick:

Suggested change
rewarded_or_slashed == false => {},
!rewarded_or_slashed => {},

@lrazovic lrazovic self-requested a review October 20, 2023 11:19
@lrazovic lrazovic merged commit 8e6105d into main Oct 20, 2023
1 of 2 checks passed
@lrazovic lrazovic deleted the feature/plmc-266-add-verification-code-on-extrinsic-benchmarks branch October 20, 2023 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants