-
Notifications
You must be signed in to change notification settings - Fork 224
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
Min max delegation amounts #4569
Min max delegation amounts #4569
Conversation
… min_max_delegation_amounts
… min_max_delegation_amounts
… min_max_delegation_amounts
… min_max_delegation_amounts
… min_max_delegation_amounts
@mpapierski ping |
@mpapierski We added the forced undelegation process as discussed last week in f1a1400 |
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.
Looking good code-wise. It'd be a good idea to measure how many delegators will be unbonded when 500 CSPR minimum delegation is enforced. Queueing unbonding requests for too many delegators at once may affect the network performance for some time until the queue is cleared.
… min_max_delegation_amounts
… min_max_delegation_amounts
… min_max_delegation_amounts
… min_max_delegation_amounts
Timed out. |
… min_max_delegation_amounts
bors r+ |
… min_max_delegation_amounts
Canceled. |
bors r+ |
4569: Min max delegation amounts r=mpapierski a=moubctez Implements casper-network/ceps#90 Co-authored-by: Adam Ciarciński <aciarcinski@teonite.com> Co-authored-by: Maciek <tapczan666+github@gmail.com> Co-authored-by: Maciej Wójcik <wojcik91@gmail.com>
Build failed: |
… min_max_delegation_amounts
🔒 Permission denied Existing reviewers: click here to make moubctez a reviewer |
bors r+ |
4569: Min max delegation amounts r=mpapierski a=moubctez Implements casper-network/ceps#90 Co-authored-by: Adam Ciarciński <aciarcinski@teonite.com> Co-authored-by: Maciek <tapczan666+github@gmail.com> Co-authored-by: Maciej Wójcik <wojcik91@gmail.com>
Timed out. |
… min_max_delegation_amounts
bors r+ |
4569: Min max delegation amounts r=mpapierski a=moubctez Implements casper-network/ceps#90 Co-authored-by: Adam Ciarciński <aciarcinski@teonite.com> Co-authored-by: Maciek <tapczan666+github@gmail.com> Co-authored-by: Maciej Wójcik <wojcik91@gmail.com>
Timed out. |
… min_max_delegation_amounts
// Avoids allocation with 0 bytes and a call to get_named_arg | ||
Vec::new() | ||
}; | ||
bytesrepr::deserialize(arg_bytes).unwrap_or_revert_with(ApiError::InvalidArgument) |
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.
@moubctez Hi, something is strange here I don't get this function to work as I understood its purpose, not sure if this is on my contract but I get reverted with InvalidArgument passing value, according to the comment (not an Option though)
I would invite to test this function again because according to my test get_named_arg and try_get_named_arg do the exact same thing with Option for get_named_arg, while try_get_named_arg should handle absence of argument (not None) as per code comment.
test calling
let _ = args.insert("TEST1", None::<u64>);
let _ = args.insert("TEST2", None::<u64>);
let _ = args.insert("TEST3", 111_u64);
let _ = args.insert("TEST4", Some(111_u64));
let _ = args.insert("TEST5", 111_u64);
contract
let test1: Option<u64> = get_named_arg("TEST1");
let test2: Option<u64> = try_get_named_arg("TEST2");
let test3: u64 = get_named_arg("TEST3");
let test4: Option<u64> = try_get_named_arg("TEST4");
runtime::print(&format!("{:?}", test1));
runtime::print(&format!("{:?}", test2));
runtime::print(&format!("{:?}", test3));
runtime::print(&format!("{:?}", test4));
let test5: Option<u64> = try_get_named_arg("TEST5");
runtime::print(&format!("will revert, never printed{:?}", test5));
Regards
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've re-examined the code and as far as I can recall this is a leftover from my attempt to handle optional arguments that is not used anywhere and can be removed.
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.
Hi, I believe try_get_named_arg
intention was to handle no-value/value but now it deals with no-value/Some(value) which is not really expected on usage. get_named_arg deals with None/Some(value) which requires the parameter to be given has Option in any case.
There is however a use case thus for an get_optional_named_arg not expecting an Option but I think right now it's indeed better to remove this function as confusing.
As not handling no-value / value but no-value/Some(value) unused yet
Implements casper-network/ceps#90
Resolves #4860 [Issue created retrospectively]