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

[CHECKLIST] Service pallet features for pre-launch #783

Open
3 of 8 tasks
drewstone opened this issue Oct 7, 2024 · 0 comments
Open
3 of 8 tasks

[CHECKLIST] Service pallet features for pre-launch #783

drewstone opened this issue Oct 7, 2024 · 0 comments
Assignees

Comments

@drewstone
Copy link
Contributor

drewstone commented Oct 7, 2024

Checklist

Notes

Service pallet updates / flows

  • Selecting the assets backing a service instance and answering questions below
  • How will we price selecting assets in a service?
  • How will we reward restakers of different assets of a service?

Separating the Blueprint contract from the ServiceInstance contract.

  • BlueprintManager.sol - responsible for registration and request hook definition. Responsible for developer settings like payments, incentives, etc.
  • InstanceManager.sol - responsible for managing a single specific instance. Should have access to precompile functions which grab metadata of the instance such as restaked assets, operators of the instance, etc.
  • Decide if BlueprintManager “knows” about its instances or if it doesn’t need to. Perhaps BlueprintManager.sol deploys InstanceManager.sol upon successful instancing of the service.
  • InstanceManager.sol - contains the job calls / verify fns for the system. The runtime IMO should either handle this or the Blueprint manager can delegate through its mappings.
    mapping(uint64 => address) public instanceManagers;

    function onJobCallResult(
        uint64 serviceId,
        uint8 job,
        uint64 _jobCallId,
        bytes calldata participant,
        bytes calldata _inputs,
        bytes calldata _outputs
    ) public virtual override onlyFromRootChain {
        // Call the instance manager's onJobCallResult function
        address instanceManager = instanceManagers[serviceId];
        IInstanceManager(instanceManager).onJobCallResult(
            serviceId,
            job,
            _jobCallId,
            participant,
            _inputs,
            _outputs
        );
    }

    function verifyJobCallResult(
        uint64 serviceId,
        uint8 job,
        uint64 jobCallId,
        bytes calldata participant,
        bytes calldata inputs,
        bytes calldata outputs
    ) public view virtual override onlyFromRootChain returns (bool) {
        // Call the instance manager's verifyJobCallResult function
        address instanceManager = instanceManagers[serviceId];
        return IInstanceManager(instanceManager).verifyJobCallResult(
            serviceId,
            job,
            jobCallId,
            participant,
            inputs,
            outputs
        );
    }

Slashing logic on services pallet (using the extrinsics as you had mentioned)

  • Identify security implications of runtime slashing vs precompile slashing. See if we can design a secure precompile for triggering slashing.
  • Slashing should happen on the InstanceManager.sol. The Blueprint developer should consider what context needs to be maintained on specific instances and not.
@shekohex shekohex pinned this issue Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: EPICS 🚀
Development

No branches or pull requests

3 participants