Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about ApplyBackend for v1.0.0 #270

Open
mrLSD opened this issue Jan 11, 2024 · 1 comment
Open

Question about ApplyBackend for v1.0.0 #270

mrLSD opened this issue Jan 11, 2024 · 1 comment

Comments

@mrLSD
Copy link
Contributor

mrLSD commented Jan 11, 2024

Question

In the previous versions (for example v0.41) was trait:

/// EVM backend that can apply changes.
pub trait ApplyBackend {
	/// Apply given values and logs at backend.
	fn apply<A, I, L>(&mut self, values: A, logs: L, delete_empty: bool)
	where
		A: IntoIterator<Item = Apply<I>>,
		I: IntoIterator<Item = (H256, H256)>,
		L: IntoIterator<Item = Log>;
}

Current version v1.0.0-alpha.2 completely rafactored.

❓ Question is: as far as we will need to transfer from v0.x ➡️ v1.0 we need to understand clearly how to do that. Actually for ApplyBackend it's unclear. It seems apply logic was completely changed. I would be pleased for some advice on that point.

@mrLSD
Copy link
Contributor Author

mrLSD commented Jan 11, 2024

As it is provided new trait: https://github.com/rust-ethereum/evm/blob/master/src/backend/mod.rs

And it is really unclear, because previously:
https://github.com/rust-ethereum/evm/blob/v0.36.0/src/backend/mod.rs#L30C13-L30C13

for apply operation was provided:

pub enum Apply<I> {
	/// Modify or create at address.
	Modify {
		/// Address.
		address: H160,
		/// Basic information of the address.
		basic: Basic,
		/// Code. `None` means leaving it unchanged.
		code: Option<Vec<u8>>,
		/// Storage iterator.
		storage: I,
		/// Whether storage should be wiped empty before applying the storage
		/// iterator.
		reset_storage: bool,
	},
	/// Delete address.
	Delete {
		/// Address.
		address: H160,
	},
}

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

No branches or pull requests

1 participant