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

Use CreateActionID to give simulated actions unique actionID #1644

Merged
merged 4 commits into from
Oct 10, 2024

Conversation

aaronbuchwald
Copy link
Collaborator

This PR uses chain.CreateActionID(ids.Empty, actionIndex) to make sure that each simulated action gets a unique actionID that won't conflict w/ any previous actionID.

@containerman17
Copy link
Contributor

The code LGTM

containerman17
containerman17 previously approved these changes Oct 10, 2024
@@ -194,8 +194,8 @@ func (cli *JSONRPCClient) GetABI(ctx context.Context) (abi.ABI, error) {
return resp.ABI, err
}

func (cli *JSONRPCClient) Execute(ctx context.Context, actor codec.Address, actions []chain.Action) ([][]byte, error) {
actionsMarshaled := make([][]byte, 0)
func (cli *JSONRPCClient) ExecuteActions(ctx context.Context, actor codec.Address, actions []chain.Action) ([][]byte, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm happy it's been renamed back.

if len(args.Actions) == 0 {
return errNoActionsToExecute
}
if maxActionsPerTx := int(j.vm.Rules(time.Now().Unix()).GetMaxActionsPerTx()); len(args.Actions) > maxActionsPerTx {
Copy link
Contributor

Choose a reason for hiding this comment

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

Good catch!

// Get expected state keys
stateKeysWithPermissions := action.StateKeys(args.Actor)

// flatten the map to a slice of keys
storageKeysToRead := make([][]byte, 0)
storageKeysToRead := make([][]byte, 0, len(stateKeysWithPermissions))
Copy link
Contributor

Choose a reason for hiding this comment

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

TIL

@aaronbuchwald aaronbuchwald merged commit 725a589 into main Oct 10, 2024
16 checks passed
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.

2 participants