-
Notifications
You must be signed in to change notification settings - Fork 171
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
Neuron weights set #1150
base: devnet-ready
Are you sure you want to change the base?
Neuron weights set #1150
Conversation
small merge conflict still |
merge conflicts + some unsafe math |
will fix it. |
let mut tmp_vec = [0u8; 2]; | ||
tmp_vec.copy_from_slice(get_slice( | ||
data, | ||
first_position + 62 + i * 32, |
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 think it is possible to execute a transaction that packs 100_000 bytes of data and sets first_position value at 0xFFFF, which will overflow this line and panic. Please use safe math.
Description
Add set_weights, commit_weights, reveal_weights extrinsic in precompile contract
Related Issue(s)
Type of Change
Breaking Change
If this PR introduces a breaking change, please provide a detailed description of the impact and the migration path for existing applications.
Checklist
cargo fmt
andcargo clippy
to ensure my code is formatted and linted correctlyScreenshots (if applicable)
Please include any relevant screenshots or GIFs that demonstrate the changes made.
Additional Notes
Please provide any additional information or context that may be helpful for reviewers.