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

Add vesting precompile #661

Merged
merged 47 commits into from
Jul 19, 2024
Merged

Add vesting precompile #661

merged 47 commits into from
Jul 19, 2024

Conversation

luispdm
Copy link
Contributor

@luispdm luispdm commented Jul 9, 2024

#615

  • A minimal pallet called benchmark (at pallets/benchmark/src) is required to benchmark precompiles whose code is not included in this repo (i.e. the vesting pallet in this PR)
  • The benchmark pallet is included in the LAOS config but it doesn't have any extrinsics, so it cannot be used by anyone in production
  • Precompile code can be found at pallets/benchmark/src/precompiles/vesting

@luispdm luispdm linked an issue Jul 9, 2024 that may be closed by this pull request
@asiniscalchi
Copy link
Member

/review

Copy link

PR Reviewer Guide 🔍

⏱️ Estimated effort to review: 4 🔵🔵🔵🔵⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Key issues to review

Performance Concern
The weight functions in pallet_benchmark use hardcoded values for reads and writes, which might not accurately reflect the actual cost of operations on different storage items. Consider dynamically calculating these values based on the actual storage access patterns and data sizes involved.

Missing Error Handling
The benchmarking code for vesting precompiles does not handle potential errors from external calls or internal logic failures. Ensure that all possible error paths are accounted for to avoid panics or undefined behavior during benchmarks.

Error Handling
The VestingPrecompile module's methods do not consistently handle errors or revert transactions when conditions are not met. This could lead to unexpected state changes or failures. Review and ensure that all methods properly handle errors and revert as necessary.

magecnion
magecnion previously approved these changes Jul 19, 2024
@asiniscalchi asiniscalchi merged commit e832eb5 into main Jul 19, 2024
7 of 8 checks passed
@asiniscalchi asiniscalchi deleted the feature/vesting-precompile branch July 19, 2024 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Vesting precompile
4 participants