feat(cli): add the batch registration feature to systems, accesses, functions and tables #1871
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes issue #1645.
There are some parts that can be further examined.
One is the
batchCall
functiin, which is not easy to invoke correctly in Typescript. To address this, I added a helper functiongetBatchCallData
to alleviate this issue.The other part is the granularity of batching. For systems and access controls, I batched the system and its corresponding access changes together. This approach ensures atomicity of the system and its access control changes, resulting in the invocation of a number of system transactions.
For function registrations, I batched the functions per system, as it seems that a system can naturally divide the functions.
For table registrations, I used a static slicing approach. The number of packed registrations for now is 10, which is a conservative figure designed to adapt to most chain environments. This number could be added to advanced configurations in the future.
PS: I have temporarily set aside the part related to modules, as there is currently no filter available for installedModules.