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.
Checklist
Notes
Service pallet updates / flows
Separating the Blueprint contract from the ServiceInstance contract.
Slashing logic on services pallet (using the extrinsics as you had mentioned)