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

Check for typos in CI #1686

Merged
merged 1 commit into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
16 changes: 16 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,19 @@ jobs:
with:
components: rustfmt
- run: cargo fmt --all --check

typos-check:
needs: [skip_check]
if: |
github.event.pull_request.draft == false &&
(github.event.action == 'ready_for_review' || needs.skip_check.outputs.should_skip != 'true')
name: TyposCheck
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: crate-ci/typos@v1.22.7
with:
config: ./typos.toml
isolated: true

13 changes: 13 additions & 0 deletions Typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[default]
extend-ignore-identifiers-re = [
"[sS]imular",
"ba",
"modul"
]

[files]
extend-exclude = [
"CHANGELOG.md",
"tests"
]

4 changes: 2 additions & 2 deletions crates/interpreter/src/instructions/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ pub fn data_copy<H: Host + ?Sized>(interpreter: &mut Interpreter, _host: &mut H)
gas!(interpreter, VERYLOW);
pop!(interpreter, mem_offset, offset, size);

// sizes more than u64::MAX will spend all the gas in memmory resize.
// sizes more than u64::MAX will spend all the gas in memory resize.
let size = as_usize_or_fail!(interpreter, size);
// size of zero should not change the memory
if size == 0 {
Expand All @@ -75,7 +75,7 @@ pub fn data_copy<H: Host + ?Sized>(interpreter: &mut Interpreter, _host: &mut H)
let offset = as_usize_saturated!(offset);
let data = interpreter.contract.bytecode.eof().expect("eof").data();

// set data from the eof to the shared memory. Padd it with zeros.
// set data from the eof to the shared memory. Padded it with zeros.
interpreter
.shared_memory
.set_data(mem_offset, offset, size, data);
Expand Down
6 changes: 3 additions & 3 deletions crates/interpreter/src/interpreter/analysis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ pub fn validate_raw_eof_inner(
/// Only place where validation happen is in Creating Transaction.
/// Because of that we are assuming CodeType is ReturnContract.
///
/// Note: If neeed we can make a flag that would assume ReturnContract CodeType.
/// Note: If needed we can make a flag that would assume ReturnContract CodeType.
pub fn validate_eof(eof: &Eof) -> Result<(), EofError> {
validate_eof_inner(eof, Some(CodeType::ReturnContract))
}
Expand Down Expand Up @@ -224,7 +224,7 @@ impl std::error::Error for EofError {}

#[derive(Debug, Hash, PartialEq, Eq, PartialOrd, Ord, Clone, Copy)]
pub enum EofValidationError {
FalsePossitive,
FalsePositive,
/// Opcode is not known. It is not defined in the opcode table.
UnknownOpcode,
/// Opcode is disabled in EOF. For example JUMP, JUMPI, etc.
Expand Down Expand Up @@ -398,7 +398,7 @@ impl fmt::Display for EofValidationError {
f,
"{}",
match self {
Self::FalsePossitive => "False positive",
Self::FalsePositive => "False positive",
Self::UnknownOpcode => "Opcode is not known",
Self::OpcodeDisabled => "Opcode is disabled",
Self::InstructionNotForwardAccessed => "Should have forward jump",
Expand Down
2 changes: 1 addition & 1 deletion crates/interpreter/src/interpreter_action.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use std::boxed::Box;
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub enum InterpreterAction {
/// CALL, CALLCODE, DELEGATECALL, STATICCALL
/// or EOF EXT instuction called.
/// or EOF EXT instruction called.
Call { inputs: Box<CallInputs> },
/// CREATE or CREATE2 instruction called.
Create { inputs: Box<CreateInputs> },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ impl Default for EOFCreateKind {
pub struct EOFCreateInputs {
/// Caller of Eof Craate
pub caller: Address,
/// Values of ether transfered
/// Values of ether transferred
pub value: U256,
/// Gas limit for the create call.
pub gas_limit: u64,
Expand Down
2 changes: 1 addition & 1 deletion crates/primitives/src/env/handler_cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ impl Deref for CfgEnvWithHandlerCfg {
/// Evm environment with the chain spec id.
#[derive(Clone, Debug, Default, Eq, PartialEq)]
pub struct EnvWithHandlerCfg {
/// Evm enironment.
/// Evm environment.
pub env: Box<Env>,
/// Handler configuration fields.
pub handler_cfg: HandlerCfg,
Expand Down
2 changes: 1 addition & 1 deletion crates/primitives/src/result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ pub enum HaltReason {
OutOfFunds,
CallTooDeep,

/// Aux data overflow, new aux data is larger tha u16 max size.
/// Aux data overflow, new aux data is larger than u16 max size.
EofAuxDataOverflow,
/// Aud data is smaller then already present data size.
EofAuxDataTooSmall,
Expand Down
4 changes: 2 additions & 2 deletions crates/revm/src/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ impl<'a, EXT, DB: Database> EvmHandler<'a, EXT, DB> {
if out.is_some() {
let registers = core::mem::take(&mut self.registers);
let mut base_handler = Handler::mainnet_with_spec(self.cfg.spec_id);
// apply all registers to default handeler and raw mainnet instruction table.
// apply all registers to default handler and raw mainnet instruction table.
for register in registers {
base_handler.append_handler_register(register)
}
Expand All @@ -190,7 +190,7 @@ impl<'a, EXT, DB: Database> EvmHandler<'a, EXT, DB> {
pub fn create_handle_generic<SPEC: Spec>(&mut self) -> EvmHandler<'a, EXT, DB> {
let registers = core::mem::take(&mut self.registers);
let mut base_handler = Handler::mainnet::<SPEC>();
// apply all registers to default handeler and raw mainnet instruction table.
// apply all registers to default handler and raw mainnet instruction table.
for register in registers {
base_handler.append_handler_register(register)
}
Expand Down
2 changes: 1 addition & 1 deletion crates/revm/src/optimism/fast_lz.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ mod tests {
#[rstest]
#[case::empty(&[], 0)]
#[case::thousand_zeros(&[0; 1000], 21)]
#[case::thousand_fourty_twos(&[42; 1000], 21)]
#[case::thousand_forty_twos(&[42; 1000], 21)]
#[case::short_hex(&bytes!("FACADE"), 4)]
#[case::sample_contract_call(&bytes!("02f901550a758302df1483be21b88304743f94f80e51afb613d764fa61751affd3313c190a86bb870151bd62fd12adb8e41ef24f3f000000000000000000000000000000000000000000000000000000000000006e000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e5831000000000000000000000000000000000000000000000000000000000003c1e5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000148c89ed219d02f1a5be012c689b4f5b731827bebe000000000000000000000000c001a033fd89cb37c31b2cba46b6466e040c61fc9b2a3675a7f5f493ebd5ad77c497f8a07cdf65680e238392693019b4092f610222e71b7cec06449cb922b93b6a12744e"), 202)]
#[case::base_0x5dadeb52979f29fc7a7494c43fdabc5be1d8ff404f3aafe93d729fa8e5d00769(&bytes!("b9047c02f904788221050883036ee48409c6c87383037f6f941195cf65f83b3a5768f3c496d3a05ad6412c64b78644364c5bb000b90404d123b4d80000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000038000000000000000000000000000000000f6476f90447748c19248ccaa31e6b8bfda4eb9d830f5f47df7f0998f7c2123d9e6137761b75d3184efb0f788e3b14516000000000000000000000000000000000000000000000000000044364c5bb000000000000000000000000000f38e53bd45c8225a7c94b513beadaa7afe5d222d0000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000024000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000002e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000084d6574614d61736b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000035697066733a2f2f516d656852577a743347745961776343347564745657557233454c587261436746434259416b66507331696f48610000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000cd0d83d9e840f8e27d5c2e365fd365ff1c05b2480000000000000000000000000000000000000000000000000000000000000ce40000000000000000000000000000000000000000000000000000000000000041e4480d358dbae20880960a0a464d63b06565a0c9f9b1b37aa94b522247b23ce149c81359bf4239d1a879eeb41047ec710c15f5c0f67453da59a383e6abd742971c00000000000000000000000000000000000000000000000000000000000000c001a0b57f0ff8516ea29cb26a44ac5055a5420847d1e16a8e7b03b70f0c02291ff2d5a00ad3771e5f39ccacfff0faa8c5d25ef7a1c179f79e66e828ffddcb994c8b512e"), 471)]
Expand Down
2 changes: 1 addition & 1 deletion documentation/src/crates/interpreter/memory.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Is a memory localized to the current Interpreter context. Interpreter context is a call or create frame. It is used by opcodes to store or format data that are more then 32 bytes long, for example calls to format input, return output or for logs data. Revm has a shared memory between all the Interpreters but Interpreter loop only see the part it is allocated to it.

Extending memory is paid by the gas. It consumes 3 gas per word plus square of the number of words added divided by `512` (`3*N+ N^2/512`). There is no limit on the size of the memory, but it is limited by logaritmic growth of the gas cost. For 30M there is a calculated max memory of 32MB (Blog post by ramco: [Upper bound for transaction memory](https://xn--2-umb.com/22/eth-max-mem/)).
Extending memory is paid by the gas. It consumes 3 gas per word plus square of the number of words added divided by `512` (`3*N+ N^2/512`). There is no limit on the size of the memory, but it is limited by logarithmic growth of the gas cost. For 30M there is a calculated max memory of 32MB (Blog post by ramco: [Upper bound for transaction memory](https://xn--2-umb.com/22/eth-max-mem/)).

## Opcodes

Expand Down
2 changes: 1 addition & 1 deletion documentation/src/crates/primitives.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ It is set up to be compatible with environments that do not include Rust's stand
- [specification](./primitives/specifications.md): This module defines types related to Ethereum specifications (also known as hard forks).
- [state](./primitives/state.md): This module provides types and functions for managing Ethereum state, including accounts and storage.
- [utilities](./primitives/utils.md): This module provides utility functions used in multiple places across the EVM implementation.
- [kzg](./primitives/kzg.md): This module provides types and functions related to KZG commitment, it is empolyed visibly in the Point Evalution Precompile.
- [kzg](./primitives/kzg.md): This module provides types and functions related to KZG commitment, it is empolyed visibly in the Point Evaluation Precompile.

### External Crates:

Expand Down
2 changes: 1 addition & 1 deletion documentation/src/crates/primitives/kzg.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# KZG

With the introduction of [EIP4844](https://eips.ethereum.org/EIPS/eip-4844), this use of blobs for a more efficent short term storage is employed, the validity of this blob stored in the consensus layer is verified using the `Point Evaluation` pre-compile, a fancy way of verifing that and evaluation at a given point of a commited polynomial is vaild, in a much more bigger scale, implies that `Data is Available`.
With the introduction of [EIP4844](https://eips.ethereum.org/EIPS/eip-4844), this use of blobs for a more efficient short term storage is employed, the validity of this blob stored in the consensus layer is verified using the `Point Evaluation` pre-compile, a fancy way of verifying that and evaluation at a given point of a committed polynomial is valid, in a much more bigger scale, implies that `Data is Available`.

This module houses;

Expand Down
Loading