Skip to content
This repository was archived by the owner on Apr 25, 2026. It is now read-only.

feat: slashing precompile#795

Merged
drewstone merged 5 commits into
service-updatefrom
shady/slashing-precompile
Oct 18, 2024
Merged

feat: slashing precompile#795
drewstone merged 5 commits into
service-updatefrom
shady/slashing-precompile

Conversation

@shekohex

@shekohex shekohex commented Oct 17, 2024

Copy link
Copy Markdown
Contributor

Summary of changes
Changes introduced in this pull request:

This pull request introduces several key changes across multiple files, primarily focusing on updating submodules, refactoring contract inheritance, and enhancing the service pallet with new hooks and error handling. The most important changes include updating submodule references, modifying contract inheritance, refactoring function names and hooks, and adding new error types and events.

Submodule Updates:

  • Updated submodule references in forge/lib/forge-std, forge/lib/openzeppelin-contracts, and forge/lib/tnt-core to their latest commits. (forge/lib/forge-std [1] forge/lib/openzeppelin-contracts [2] forge/lib/tnt-core [3]

Contract Refactoring:

  • Changed inheritance in CGGMP21Blueprint.sol from BlueprintServiceManager to BlueprintServiceManagerBase and made minor code adjustments. (forge/src/cggmp21/CGGMP21Blueprint.sol [1] [2]

Function and Hook Refactoring:

  • Renamed functions and hooks in pallets/services/src/functions.rs to follow a more consistent naming convention and updated related logic. (pallets/services/src/functions.rs [1] [2] [3]
  • Added new hooks for querying slashing and dispute origins, including the necessary EVM calls and decoding logic. (pallets/services/src/functions.rs pallets/services/src/functions.rsL240-R352)

Error Handling and Events:

  • Introduced new error types and events in pallets/services/src/lib.rs to handle slashing and dispute scenarios more effectively. (pallets/services/src/lib.rs [1] [2]

Storage Enhancements:

These changes aim to improve code clarity, update dependencies, and enhance the functionality of the service pallet.
Reference issue to close (if applicable)

Closes

@shekohex shekohex marked this pull request as ready for review October 18, 2024 17:59

@drewstone drewstone left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good but you are not adding enough tests to this type of work. Please add cases that fail too.

@shekohex shekohex requested a review from drewstone October 18, 2024 19:43

@drewstone drewstone left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good, need some docs on functions.rs and then this is good if CI passes.

@drewstone drewstone merged commit 8cec2ea into service-update Oct 18, 2024
@drewstone drewstone deleted the shady/slashing-precompile branch October 18, 2024 19:57
drewstone added a commit that referenced this pull request Oct 22, 2024
* feat: Slashing Queue (#793)

* feat: Slashing Queue

* feat: Per Service restaking percentage exposure

* test: add more tests for the unapplied slash

* feat: slashing precompile (#795)

* feat: slashing precompile

* feat: Slashing and Dispute precompiles

* Update subxt

* test: add more tests to cover more cases

* doc: Update internal functions docs

* chore: Update toml formatting

* lint: fix clippy

* chore: update tangle-subxt version

---------

Co-authored-by: shekohex <dev+github@shadykhalifa.me>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants