Skip to content

Conversation

@KolbyML
Copy link
Member

@KolbyML KolbyML commented Jan 5, 2026

@KolbyML KolbyML changed the title Increase Stylus smart contract size limit via merge-on-activate core, params: Increase Stylus smart contract size limit via merge-on-activate Jan 5, 2026
@KolbyML KolbyML marked this pull request as ready for review January 5, 2026 18:47
@KolbyML KolbyML requested a review from pmikolajczyk41 January 9, 2026 23:15
@KolbyML KolbyML assigned pmikolajczyk41 and unassigned KolbyML Jan 9, 2026
@KolbyML
Copy link
Member Author

KolbyML commented Jan 9, 2026

@pmikolajczyk41 ready for another look 🫡

pmikolajczyk41
pmikolajczyk41 previously approved these changes Jan 12, 2026
Copy link
Member

@pmikolajczyk41 pmikolajczyk41 left a comment

Choose a reason for hiding this comment

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

good stuff 👌

@KolbyML KolbyML assigned tsahee and unassigned KolbyML Jan 12, 2026
}

// checks if a valid Stylus prefix is present
func IsStylusProgram(b []byte) bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

remove the IsStylusProgram function and replace it with something with a different name, that way, anywhere that called IsStylusProgram in the previous code will pop out and we can see what needs to be changed.

specifically - in go-ethereum/core/vm/instructions.go: opSelfdestruct6780 - we must not allow self-destruct of any stylus componenet (program / fragment / root)

@tsahee tsahee assigned KolbyML and unassigned tsahee Jan 23, 2026
@KolbyML KolbyML requested a review from tsahee January 23, 2026 21:29
@KolbyML KolbyML assigned tsahee and unassigned KolbyML Jan 23, 2026
@KolbyML
Copy link
Member Author

KolbyML commented Jan 23, 2026

@tsahee I believe I resolved your concern, ready for another look 🧐

core/vm/evm.go Outdated
if len(ret) >= 1 && ret[0] == 0xEF && evm.chainRules.IsLondon {
// Arbitrum: retain Stylus programs and instead store them in the DB alongside normal EVM bytecode.
if !(evm.chainRules.IsStylus && state.IsStylusProgram(ret)) {
if !(evm.chainRules.IsStylus && state.IsStylusComponentPrefix(ret)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Here we should actually have different behavior per arbos version.
possibly, the best way is to add arbosVersion to IsStylusComponentPrefix function

Copy link
Contributor

Choose a reason for hiding this comment

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

note: I think this is the only place where arbos-version dependency is a must. Other places only affect deployed code, which will not be possible for a stylus program not supported by current arbos.. but if not too complicated it's probably more elegant to add arbos-version dependency as well

@KolbyML KolbyML requested a review from tsahee January 24, 2026 00:23
@KolbyML
Copy link
Member Author

KolbyML commented Jan 24, 2026

@tsahee ready for another look, I believe I resolved your concern, and I also added some regression tests for safe keeping


// IsStylusDeployableProgramPrefix reports whether the bytecode starts with a
// deployable Stylus program prefix (classic program or root program).
func IsStylusDeployableProgramPrefix(b []byte) bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

for completeness, I think this one should also accept arbos version

@tsahee tsahee merged commit 26ec784 into master Jan 28, 2026
17 checks passed
@tsahee tsahee deleted the prototype-stylus-contract-increase branch January 28, 2026 00:53
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.

4 participants