You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Instead of mapping to a resource, the function selector could map direcly to a system function, which would save one sload per call, but add some complexity to upgrading systems. See WorldRegistrationSystem.registerFunctionSelector
The text was updated successfully, but these errors were encountered:
If we wanted to map function selectors directly to system addresses we'd introduce a lot of additional complexity:
duplicating the access control logic: if a system is not registered as openAccess, we'd have to load the resource selector from storage and perform access control checks based on it.
duplicating the logic when to call a system via delegatecall or call (which is currently determined based on the resource selector). Probably would have to store it as a flag in the function selector table, so there is not a single source of truth anymore for whether a system is a root system.
increased complexity for upgrades: instead of just pointing the resource selector to a new address, we now would have to set up a reverse mapping for which function selectors are registered for a given address, and change all those references to the new address too
increased "conceptual complexity" - instead of once concept for systems (resource selector) we would have two concepts and two sources of truth (ie "a system is a root system if it is registered in the root namespace or if there is a flag in the function selector table saying so")
To avoid all of this complexity I think it's a worthwhile tradeoff to accept a single additional sload and keep pointing function selectors to resource selectors.
Instead of mapping to a resource, the function selector could map direcly to a system function, which would save one sload per call, but add some complexity to upgrading systems. See
WorldRegistrationSystem.registerFunctionSelector
The text was updated successfully, but these errors were encountered: