-
Notifications
You must be signed in to change notification settings - Fork 554
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
docs: document everything, dedup existing docs #741
Conversation
@@ -183,17 +179,9 @@ impl Memory { | |||
} | |||
} | |||
|
|||
/// Rounds up `x` to the closest multiple of 32. If `x % 32 == 0` then `x` is returned. | |||
#[inline] | |||
pub(crate) fn next_multiple_of_32(x: usize) -> Option<usize> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to revm_primitives
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Related only to Interpreter so it was left there, does not make sense imo to move it to primitives
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
love the additional docs,
what's the reason for dropping the _
from the unused references?
As this one is a bigger PR, would leave it after the release and alloy merge. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is probably mergeable now!
InstructionResult, | ||
}; | ||
use alloc::vec::Vec; | ||
use core::fmt; | ||
|
||
/// The EVM stack limit, in number of items. | ||
pub const STACK_LIMIT: usize = 1024; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Related to the stack, soo imo stack.rs
is a good place for it.
crates/primitives/src/constants.rs
Outdated
/// EVM Interpreter stack limit. | ||
pub const STACK_LIMIT: usize = 1024; | ||
|
||
/// EVM call stack limit. | ||
pub const CALL_STACK_LIMIT: u64 = 1024; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CALL_STACK_LIMIT is only used inside revm
crate so this should've its place
@rakita I moved the constants and util to primitives because there were some duplicates, I think they make more sense since it has a constants and utils module and I felt they don't really belong in random modules of other crates. WDYT? |
If we had only one lib sure, if maybe there is an intention to be used somewhere else sure. Duplicates should of course be removed. |
#[doc(inline)]
duplicates all docs so one has to be careful using it (fix(doc): Inline documentation of re-exports #560)pub mod x;
andpub use x::*;
is redundant and creates 2 paths from where an item can be imported, so I opted to keep the glob export.