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

Feat: extend EIP-7702 #73

Merged
merged 19 commits into from
Jan 14, 2025
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion evm-tests/EIP-152/src/portable.rs
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@

use crate::{IV, SIGMA};

/// The G mixing function. See https://tools.ietf.org/html/rfc7693#section-3.1
/// The G mixing function. See <https://tools.ietf.org/html/rfc7693#section-3.1>
#[inline(always)]
fn g(v: &mut [u64], a: usize, b: usize, c: usize, d: usize, x: u64, y: u64) {
v[a] = v[a].wrapping_add(v[b]).wrapping_add(x);
2 changes: 1 addition & 1 deletion evm-tests/ethjson/src/bytes.rs
Original file line number Diff line number Diff line change
@@ -84,7 +84,7 @@ impl<'a> Deserialize<'a> for Bytes {

struct BytesVisitor;

impl<'a> Visitor<'a> for BytesVisitor {
impl Visitor<'_> for BytesVisitor {
type Value = Bytes;

fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
2 changes: 1 addition & 1 deletion evm-tests/ethjson/src/uint.rs
Original file line number Diff line number Diff line change
@@ -64,7 +64,7 @@ impl<'a> Deserialize<'a> for Uint {

struct UintVisitor;

impl<'a> Visitor<'a> for UintVisitor {
impl Visitor<'_> for UintVisitor {
type Value = Uint;

fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
4 changes: 2 additions & 2 deletions fuzzer/src/main.rs
Original file line number Diff line number Diff line change
@@ -2,9 +2,9 @@ use evm_core::Machine;
use std::rc::Rc;

fn find_subsequence(haystack: &[u8], needle: &[u8]) -> Option<usize> {
return haystack
haystack
.windows(needle.len())
.position(|window| window == needle);
.position(|window| window == needle)
}

fn split_at_delim(sequence: &[u8], delim: &[u8]) -> (Vec<u8>, Vec<u8>) {
2 changes: 1 addition & 1 deletion gasometer/src/lib.rs
Original file line number Diff line number Diff line change
@@ -937,7 +937,7 @@ struct Inner<'config> {
config: &'config Config,
}

impl<'config> Inner<'config> {
impl Inner<'_> {
fn memory_gas(&self, memory: MemoryCost) -> Result<u64, ExitError> {
let from = memory.offset;
let len = memory.len;
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[toolchain]
channel = "1.82.0"
channel = "1.84.0"
profile = "minimal"
components = ["rustfmt", "clippy"]
4 changes: 2 additions & 2 deletions src/backend/memory.rs
Original file line number Diff line number Diff line change
@@ -96,7 +96,7 @@ impl<'vicinity> MemoryBackend<'vicinity> {
}
}

impl<'vicinity> Backend for MemoryBackend<'vicinity> {
impl Backend for MemoryBackend<'_> {
#[allow(clippy::misnamed_getters)]
fn gas_price(&self) -> U256 {
self.vicinity.effective_gas_price
@@ -186,7 +186,7 @@ impl<'vicinity> Backend for MemoryBackend<'vicinity> {
}
}

impl<'vicinity> ApplyBackend for MemoryBackend<'vicinity> {
impl ApplyBackend for MemoryBackend<'_> {
fn apply<A, I, L>(&mut self, values: A, logs: L, delete_empty: bool)
where
A: IntoIterator<Item = Apply<I>>,
12 changes: 6 additions & 6 deletions src/executor/stack/executor.rs
Original file line number Diff line number Diff line change
@@ -1360,8 +1360,8 @@ impl<'config, 'precompiles, S: StackState<'config>, P: PrecompileSet>
}
}

impl<'config, 'precompiles, S: StackState<'config>, P: PrecompileSet> InterpreterHandler
for StackExecutor<'config, 'precompiles, S, P>
impl<'config, S: StackState<'config>, P: PrecompileSet> InterpreterHandler
for StackExecutor<'config, '_, S, P>
{
#[inline]
fn before_eval(&mut self) {}
@@ -1442,8 +1442,8 @@ pub struct StackExecutorCallInterrupt<'borrow>(TaggedRuntime<'borrow>);

pub struct StackExecutorCreateInterrupt<'borrow>(TaggedRuntime<'borrow>);

impl<'config, 'precompiles, S: StackState<'config>, P: PrecompileSet> Handler
for StackExecutor<'config, 'precompiles, S, P>
impl<'config, S: StackState<'config>, P: PrecompileSet> Handler
for StackExecutor<'config, '_, S, P>
{
type CreateInterrupt = StackExecutorCreateInterrupt<'static>;
type CreateFeedback = Infallible;
@@ -1802,8 +1802,8 @@ struct StackExecutorHandle<'inner, 'config, 'precompiles, S, P> {
is_static: bool,
}

impl<'inner, 'config, 'precompiles, S: StackState<'config>, P: PrecompileSet> PrecompileHandle
for StackExecutorHandle<'inner, 'config, 'precompiles, S, P>
impl<'config, S: StackState<'config>, P: PrecompileSet> PrecompileHandle
for StackExecutorHandle<'_, 'config, '_, S, P>
{
// Perform subcall in provided context.
/// Precompile specifies in which context the subcall is executed.
4 changes: 2 additions & 2 deletions src/executor/stack/memory.rs
Original file line number Diff line number Diff line change
@@ -519,7 +519,7 @@ pub struct MemoryStackState<'backend, 'config, B> {
substate: MemoryStackSubstate<'config>,
}

impl<'backend, 'config, B: Backend> Backend for MemoryStackState<'backend, 'config, B> {
impl<B: Backend> Backend for MemoryStackState<'_, '_, B> {
fn gas_price(&self) -> U256 {
self.backend.gas_price()
}
@@ -596,7 +596,7 @@ impl<'backend, 'config, B: Backend> Backend for MemoryStackState<'backend, 'conf
}
}

impl<'backend, 'config, B: Backend> StackState<'config> for MemoryStackState<'backend, 'config, B> {
impl<'config, B: Backend> StackState<'config> for MemoryStackState<'_, 'config, B> {
fn metadata(&self) -> &StackSubstateMetadata<'config> {
self.substate.metadata()
}
4 changes: 2 additions & 2 deletions src/maybe_borrowed.rs
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ pub enum MaybeBorrowed<'a, T> {
Owned(T),
}

impl<'a, T> core::ops::Deref for MaybeBorrowed<'a, T> {
impl<T> core::ops::Deref for MaybeBorrowed<'_, T> {
type Target = T;

fn deref(&self) -> &Self::Target {
@@ -25,7 +25,7 @@ impl<'a, T> core::ops::Deref for MaybeBorrowed<'a, T> {
}
}

impl<'a, T> core::ops::DerefMut for MaybeBorrowed<'a, T> {
impl<T> core::ops::DerefMut for MaybeBorrowed<'_, T> {
fn deref_mut(&mut self) -> &mut Self::Target {
match self {
Self::Borrowed(x) => x,