Skip to content

Conversation

CertainLach
Copy link

Allow address to be marked as reserved, deployments to reserved addresses will fail with CreateCollision.

Signed-off-by: Yaroslav Bolyukin <[email protected]>
@CertainLach CertainLach changed the title Address reservation hooks Address reservation hook Feb 27, 2023
if self.state.is_reserved(address)
|| self.code_size(address) != U256::zero()
|| self.nonce(address) > U256::zero()
{
let _ = self.exit_substate(StackExitKind::Failed);
return Capture::Exit((ExitError::CreateCollision.into(), None, Vec::new()));
Copy link
Member

Choose a reason for hiding this comment

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

Might add a new ExitError variant.

@sorpaas
Copy link
Member

sorpaas commented Aug 18, 2025

In v1.0, you can use RuntimeBaseBackend::can_create for this use case.

You'll likely use your own Backend (see InMemoryBackend for how to implement one). In the implementation, add an additional check in RuntimeBaseBackend::can_create.

Note that you must have config.runtime.eip7610_create_check_storage enabled. Otherwise, OverlayedBackend::can_create will take over the check and won't call the underlying backend's can_create.

You can also wrap around OverlayedBackend and modify can_create there directly. The type is generic in the interpreter and you can pass it directly to evm::transact.

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