Skip to content

Remove EOF#16584

Open
rodiazet wants to merge 8 commits into
developfrom
remove-eof
Open

Remove EOF#16584
rodiazet wants to merge 8 commits into
developfrom
remove-eof

Conversation

@rodiazet
Copy link
Copy Markdown
Contributor

@rodiazet rodiazet commented Apr 9, 2026

This PR removes EOF entirely from the compiler. Last commit also removes redundant vector storing code sections in the Assembly class. It’s splitted into a couple of separated commits. Each commits covers changes in each solidity library and tests. It’s better to review each commit separately.

Closes: #16593

@github-actions
Copy link
Copy Markdown

This pull request is stale because it has been open for 14 days with no activity.
It will be closed in 7 days unless the stale label is removed.

@github-actions github-actions Bot added the stale The issue/PR was marked as stale because it has been open for too long. label Apr 28, 2026
@rodiazet rodiazet removed the stale The issue/PR was marked as stale because it has been open for too long. label May 4, 2026
@rodiazet rodiazet force-pushed the remove-eof branch 2 times, most recently from 0067b76 to 9685176 Compare May 8, 2026 12:17
@rodiazet rodiazet marked this pull request as ready for review May 8, 2026 12:22
@rodiazet rodiazet changed the title Remove eof Remove EOF May 8, 2026
@rodiazet rodiazet added medium effort Default level of effort medium impact Default level of impact must have eventually Something we consider essential but not enough to prevent us from releasing Solidity 1.0 without it. EOF labels May 8, 2026
Copy link
Copy Markdown
Contributor

@nikola-matic nikola-matic left a comment

Choose a reason for hiding this comment

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

Niceeee. By the way - we have multiple references to EOF in the changelog, so in this case it would appropriate to add one saying it was removed.

Comment thread libevmasm/Assembly.cpp
Comment on lines 820 to 840
if (deduplicator.deduplicate())
{
for (auto const& replacement: deduplicator.replacedTags())
{
assertThrow(
replacement.first <= std::numeric_limits<size_t>::max() && replacement.second <= std::numeric_limits<size_t>::max(),
OptimizerException,
"Invalid tag replacement."
);
assertThrow(
!tagReplacements.count(replacement.first),
OptimizerException,
"Replacement already known."
);
tagReplacements[replacement.first] = replacement.second;
if (_tagsReferencedFromOutside.erase(static_cast<size_t>(replacement.first)))
_tagsReferencedFromOutside.insert(static_cast<size_t>(replacement.second));
}
count++;
}
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

shift+tab

Comment thread libyul/backends/evm/AbstractAssembly.h Outdated
/// Appends EOF contract return instruction which returns a subcontainer ID (_containerID) with auxiliary data filled in.
virtual void appendReturnContract(ContainerID _containerID) = 0;
/// Appends data to the very end of the bytecode. Repeated calls concatenate.
/// EOF auxiliary data in data section and the auxiliary data are different things.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
/// EOF auxiliary data in data section and the auxiliary data are different things.

@rodiazet rodiazet force-pushed the remove-eof branch 4 times, most recently from edf4bca to 31a616e Compare May 9, 2026 10:56
@rodiazet rodiazet requested a review from nikola-matic May 11, 2026 11:58
Copy link
Copy Markdown
Contributor

@matheusaaguiar matheusaaguiar left a comment

Choose a reason for hiding this comment

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

I found some other places where we have EOF related code, but looks good.

Comment thread libyul/backends/evm/EVMBuiltins.h Outdated
Comment on lines 68 to 69
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We can also remove this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good point. Haven’t noticed this one.

Comment thread test/EVMHost.cpp
}
}

solAssert(message.kind != EVMC_EOFCREATE);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we just remove the enum value from evmc.h ?
Also, here in line 1383 we have this enum value in a switch case, so I think we should either assert or remove it there.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I will assert because evmc.h is a header copied from evmone implementation.

Copy link
Copy Markdown
Collaborator

@cameel cameel May 14, 2026

Choose a reason for hiding this comment

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

Can we just remove the enum value from evmc.h ?

I'd keep the evmc modifications to a minimum. This is external code. The more independent changes we have to track the harder it is to update. And it will be gone when we update anyway.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I haven’t change evmc.h.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Well, just assert then since EOF is dead?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I’m lost :) So what exactly?

Copy link
Copy Markdown
Contributor

@matheusaaguiar matheusaaguiar May 20, 2026

Choose a reason for hiding this comment

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

I guess no harm in asserting, but not necessary too.

matheusaaguiar
matheusaaguiar previously approved these changes May 15, 2026
Comment thread libyul/backends/evm/EVMBuiltins.h Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
std::bitset<3> value;

matheusaaguiar
matheusaaguiar previously approved these changes May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

EOF medium effort Default level of effort medium impact Default level of impact must have eventually Something we consider essential but not enough to prevent us from releasing Solidity 1.0 without it.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ICE with bytecode larger than 2^16 bytes on EOF

5 participants