Skip to content

feat: allow components with duplicate procedure roots to be merged#2164

Merged
bobbinth merged 24 commits intonextfrom
pgackst-allow-duplicate-procedure-roots
Dec 13, 2025
Merged

feat: allow components with duplicate procedure roots to be merged#2164
bobbinth merged 24 commits intonextfrom
pgackst-allow-duplicate-procedure-roots

Conversation

@PhilippGackstatter
Copy link
Contributor

@PhilippGackstatter PhilippGackstatter commented Dec 11, 2025

Allow components with duplicate procedure roots to be merged.

For #1329, named storage slots should technically solve the issue, because each getter will commit to the slot name it accesses. If we assume each component contains unique storage slots, then everything should work out fine (without this PR).

Thinking in terms of sharing slots between components #1394 (comment), I could imagine edge cases where it happens that two components have a procedure or getter that is identical. Merging these components would fail due to the duplicate root. I believe we could safely allow merging these after #2162, since there will no longer be any storage offset or size that would get overwritten, which is what this check was previously preventing.

cc @igamigo

closes #1329

Copy link
Collaborator

@igamigo igamigo left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@bobbinth bobbinth left a comment

Choose a reason for hiding this comment

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

Looks good! Thank you! The changes in this PR by itself are fine, but I do think that we can simplify ProcedureInfoBuilder to be:

struct ProcedureInfoBuilder {
    procedures: BTreeSet<AccountProcedureRoot>,
}

And also, it is not clear to me whether the ProcedureInfoBuilder name is appropriate any more, and maybe we can refactor this structure to be more in-line with the new approach.

I left a comment about this in the base PR - so, we can do it either there or here.

Base automatically changed from pgackst-remove-procedure-offset-and-size to next December 13, 2025 18:17
@bobbinth bobbinth merged commit 551fa0b into next Dec 13, 2025
17 checks passed
@bobbinth bobbinth deleted the pgackst-allow-duplicate-procedure-roots branch December 13, 2025 18:56
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.

3 participants