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

feat(world): add batchCallFrom #1594

Merged
merged 7 commits into from
Sep 25, 2023
Merged

feat(world): add batchCallFrom #1594

merged 7 commits into from
Sep 25, 2023

Conversation

alvrs
Copy link
Member

@alvrs alvrs commented Sep 24, 2023

Fixes #1582

@changeset-bot
Copy link

changeset-bot bot commented Sep 24, 2023

🦋 Changeset detected

Latest commit: 2028558

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 30 packages
Name Type
@latticexyz/world Major
@latticexyz/cli Major
@latticexyz/dev-tools Major
@latticexyz/store-sync Major
@latticexyz/world-modules Major
@latticexyz/store-indexer Major
@latticexyz/abi-ts Major
@latticexyz/block-logs-stream Major
@latticexyz/common Major
@latticexyz/config Major
create-mud Major
@latticexyz/ecs-browser Major
@latticexyz/faucet Major
@latticexyz/gas-report Major
@latticexyz/network Major
@latticexyz/noise Major
@latticexyz/phaserx Major
@latticexyz/protocol-parser Major
@latticexyz/react Major
@latticexyz/recs Major
@latticexyz/schema-type Major
@latticexyz/services Major
@latticexyz/solecs Major
solhint-config-mud Major
solhint-plugin-mud Major
@latticexyz/std-client Major
@latticexyz/std-contracts Major
@latticexyz/store-cache Major
@latticexyz/store Major
@latticexyz/utils Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@alvrs alvrs changed the base branch from main to alvrs/world-codegen September 24, 2023 18:33
@alvrs alvrs marked this pull request as ready for review September 24, 2023 18:39
@alvrs alvrs requested review from dk1a and holic as code owners September 24, 2023 18:39
/**
* Batch calls to multiple systems into a single transaction, return the array of return data.
*/
function batchCallFrom(SystemCallFromData[] calldata systemCalls) public returns (bytes[] memory returnDatas) {
Copy link
Member

Choose a reason for hiding this comment

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

probably best to go with this approach for extensibility/flexibility, but I wonder how often we'll want to batch call from different addresses vs the signature being

function batchCallFrom(address from, SystemCallData[] calldata systemCalls)

Copy link
Member Author

Choose a reason for hiding this comment

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

to get that you can do this:

world.callFrom(from, coreSystemId, abi.encodeCall(BatchCallSystem.batchCall, (systemCalls)));

holic
holic previously approved these changes Sep 24, 2023
@alvrs alvrs force-pushed the alvrs/world-codegen branch from 05a9838 to eed80d1 Compare September 25, 2023 00:04
Base automatically changed from alvrs/world-codegen to main September 25, 2023 00:14
@alvrs alvrs dismissed holic’s stale review September 25, 2023 00:14

The base branch was changed.

@alvrs alvrs force-pushed the alvrs/batchcallfrom branch from 82b6d1f to 2028558 Compare September 25, 2023 00:18
@alvrs alvrs merged commit 5741d53 into main Sep 25, 2023
@alvrs alvrs deleted the alvrs/batchcallfrom branch September 25, 2023 00:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add batchCallFrom to BatchCallSystem
2 participants