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

docs: document everything, dedup existing docs #741

Merged
merged 5 commits into from Oct 5, 2023

Conversation

DaniPopes
Copy link
Collaborator

@DaniPopes DaniPopes commented Sep 22, 2023

  • Not actually everything, just adding one liner descriptions where I could.
  • Adding #[doc(inline)] duplicates all docs so one has to be careful using it (fix(doc): Inline documentation of re-exports #560)
  • Having both pub mod x; and pub use x::*; is redundant and creates 2 paths from where an item can be imported, so I opted to keep the glob export.

@@ -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> {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Moved to revm_primitives

Copy link
Member

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

Copy link
Collaborator

@mattsse mattsse left a 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?

crates/revm/src/inspector.rs Show resolved Hide resolved
crates/revm/src/inspector.rs Outdated Show resolved Hide resolved
@rakita
Copy link
Member

rakita commented Sep 27, 2023

As this one is a bigger PR, would leave it after the release and alloy merge.

Copy link
Contributor

@Evalir Evalir left a 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;
Copy link
Member

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/precompile/Cargo.toml Outdated Show resolved Hide resolved
/// EVM Interpreter stack limit.
pub const STACK_LIMIT: usize = 1024;

/// EVM call stack limit.
pub const CALL_STACK_LIMIT: u64 = 1024;
Copy link
Member

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

@DaniPopes
Copy link
Collaborator Author

@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?

@rakita
Copy link
Member

rakita commented Oct 4, 2023

@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.
but these are very specific constants and they are not put in the random modules but in the module that uses them.

Duplicates should of course be removed.
Made PR here: DaniPopes#1

@rakita rakita merged commit 8418558 into bluealloy:main Oct 5, 2023
8 checks passed
@DaniPopes DaniPopes deleted the docs branch October 17, 2023 09:48
@github-actions github-actions bot mentioned this pull request Jan 12, 2024
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.

None yet

4 participants