Skip to content

fix(cfgtransformer): GroupSigners should be assigned in reverse order#216

Merged
gustavogama-cll merged 1 commit into
mainfrom
fix-configtransformer-groupsigner-assignment
Jan 28, 2025
Merged

fix(cfgtransformer): GroupSigners should be assigned in reverse order#216
gustavogama-cll merged 1 commit into
mainfrom
fix-configtransformer-groupsigner-assignment

Conversation

@gustavogama-cll

@gustavogama-cll gustavogama-cll commented Jan 4, 2025

Copy link
Copy Markdown
Contributor

The current ConfigTransformer.ToConfig implementation does not properly set nested GroupSigner attributes because it copies the group's reference before the attribute is assigned:

1. group1.GroupSigners = append(group1.GroupSigners, group2)  // appends copy of group2
2. group2.GroupSigners = ...                                  // modifies original

This patch fixes the issue by processing groups in the reverse order:

1. group2.GroupSigners = ...                                  // modifies original
2. group1.GroupSigners = append(group1.GroupSigners, group2)  // appends (modified)copy of group2

@changeset-bot

changeset-bot Bot commented Jan 4, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: fc73249

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

This PR includes changesets to release 1 package
Name Type
@smartcontractkit/mcms Patch

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

@gustavogama-cll gustavogama-cll force-pushed the fix-configtransformer-groupsigner-assignment branch from 5102b15 to ea70d40 Compare January 4, 2025 06:36
@gustavogama-cll gustavogama-cll force-pushed the feat-solana-mcm-set-config branch 3 times, most recently from 2fb35b1 to d10fb4c Compare January 8, 2025 22:31
Base automatically changed from feat-solana-mcm-set-config to main January 9, 2025 15:28
@gustavogama-cll gustavogama-cll force-pushed the fix-configtransformer-groupsigner-assignment branch 2 times, most recently from 4c89477 to 4b76811 Compare January 27, 2025 18:42
@gustavogama-cll gustavogama-cll marked this pull request as ready for review January 27, 2025 18:42
@gustavogama-cll gustavogama-cll requested a review from a team as a code owner January 27, 2025 18:42
The current ConfigTransformer.ToConfig implementation does not properly
set nested `GroupSigner` attributes because it copies the group's
reference before the attribute is assigned:

```
1. group1.GroupSigners = append(group1.GroupSigners, group2)  // appends copy of group2
2. group2.GroupSigners = ...                                  // modifies original
```

This patch fixes the issue by processing groups in the reverse order;

```
1. group2.GroupSigners = ...                                  // modifies original
2. group1.GroupSigners = append(group1.GroupSigners, group2)  // appends (modified)copy of group2
```
@gustavogama-cll gustavogama-cll force-pushed the fix-configtransformer-groupsigner-assignment branch from 4b76811 to fc73249 Compare January 27, 2025 18:42
@cl-sonarqube-production

Copy link
Copy Markdown

@gustavogama-cll

Copy link
Copy Markdown
Contributor Author

@ecPablo, when you have a chance, could you take another look at this?

@gustavogama-cll gustavogama-cll added this pull request to the merge queue Jan 28, 2025
Merged via the queue into main with commit a481d17 Jan 28, 2025
@gustavogama-cll gustavogama-cll deleted the fix-configtransformer-groupsigner-assignment branch January 28, 2025 19:43
friedemannf pushed a commit that referenced this pull request Jan 29, 2025
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @smartcontractkit/mcms@0.7.0

### Minor Changes

- [#255](#255)
[`e38816f`](e38816f)
Thanks [@ecPablo](https://github.com/ecPablo)! - Add config transformer
functionality for solana.

- [#257](#257)
[`31f1e09`](31f1e09)
Thanks [@akhilchainani](https://github.com/akhilchainani)! - Return
generic transaction object instead of just hash

### Patch Changes

- [#270](#270)
[`d6d880c`](d6d880c)
Thanks [@graham-chainlink](https://github.com/graham-chainlink)! - fix:
incorporate timelock converter breaking api changes for scheduled
operations

- [#264](#264)
[`8849c73`](8849c73)
Thanks [@graham-chainlink](https://github.com/graham-chainlink)! -
fix(executor): callproxy as config

- [#216](#216)
[`a481d17`](a481d17)
Thanks [@gustavogama-cll](https://github.com/gustavogama-cll)! - Fix
assignment of `GroupSigners` in `ConfigTransformer.ToConfig()`

- [#268](#268)
[`d28b0df`](d28b0df)
Thanks [@gustavogama-cll](https://github.com/gustavogama-cll)! - Return
the solana.rpc.GetTransactionResult struct as the raw transaction of the
Solana SDK.

Co-authored-by: app-token-issuer-engops[bot] <144731339+app-token-issuer-engops[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants