Skip to content

Commit

Permalink
Unify terminology and naming (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
iamrecursion committed Oct 23, 2023
1 parent ea5d3e6 commit d265df5
Show file tree
Hide file tree
Showing 45 changed files with 281 additions and 279 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# The package section specifies metadata and configuration for the entire package.
[package]
# Basic metadata for the package.
name = "storage-layout-analyzer"
name = "storage-layout-extractor"
version = "0.5.0"
homepage = "https://github.com/smlxlio/storage-layout-extractor"
repository = "https://github.com/smlxlio/storage-layout-extractor"
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ though more complex ones can be found in the [tests](tests).
The primary means of extending this library to get better layouts is by extending the type inference
engine. This is done by either writing new **lifting passes** or **inference rules**, and you can
find more information on this process in the documentation
on [extending the analyzer](./docs/Extending%20the%20Analyzer.md).
on [extending the library](./docs/Extending%20the%20Library.md).

## Contributing

If you want to contribute code or documentation (non-code contributions are _always_ welcome) to
this project, please take a look at our [contributing](./docs/CONTRIBUTING.md) documentation. It
provides an overview of how to get up and running, as well as what the contribution process looks
like for the analyzer.
like for the library.
4 changes: 2 additions & 2 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ currently being supported with security updates.

## Reporting a Vulnerability

Vulnerabilities can currently be reported as normal
[issues](https://github.com/smlxlio/storage-layout-analyzer/issues) as the repository is private.
Vulnerabilities can currently be reported as security advisories at
[this link](https://github.com/smlxl/storage-layout-extractor/security/advisories/new).
16 changes: 8 additions & 8 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Contributing

This document exists as a brief introduction to how you can contribute to the storage layout
analyzer project. It includes a guide to [getting started](#setting-up-for-development) and
extractor project. It includes a guide to [getting started](#setting-up-for-development) and
[contributing to `main`](#getting-your-work-on-main), as well as a [code tour](#code-tour) that
briefly goes over the major components of the library.

Expand All @@ -16,13 +16,13 @@ Getting set up with this project is pretty simple.
1. Clone the repository. If you don't want to contribute directly you can use HTTPS clones:

```shell
git clone https://github.com/smlxlio/storage-layout-analyzer.git
git clone https://github.com/smlxlio/storage-layout-extractor
```

If you _do_ want to contribute directly to the tree, we recommend cloning over SSH:

```shell
git clone git@github.com:smlxlio/storage-layout-analyzer.git
git clone git@github.com:smlxlio/storage-layout-extractor.git
```

2. Building the project is then as simple as entering the project directory and using `cargo`.
Expand All @@ -40,7 +40,7 @@ Getting set up with this project is pretty simple.
## Getting Your Work on `main`

For contributions this repository works on a
[Pull Request](https://github.com/smlxl/storage-layout-analyzer/pulls) and subsequent review
[Pull Request](https://github.com/smlxl/storage-layout-extractor/pulls) and subsequent review
model, supported by CI to check that things avoid being broken. The process works as follows:

1. If necessary, you fork the repository, but if you have access please create a branch.
Expand All @@ -54,10 +54,7 @@ model, supported by CI to check that things avoid being broken. The process work
The code in this repository is primarily structured around each of the phases described in
the [readme](../README.md).

- `analyzer`: This contains the [driver](../src/analyzer/mod.rs) for the analyzer itself, as well
as the implementation of the analysis state machine that makes it harder to get into broken states
while analysing a [contract](../src/analyzer/contract.rs).
- `data`: This contains useful data structures necessary for the implementation of the analyzer.
- `data`: This contains useful data structures necessary for the implementation of the library.
- `disassembly`: This contains the implementation of
the [disassembler](../src/disassembly/disassembler.rs) and
the [instruction stream](../src/disassembly/mod.rs) used during execution.
Expand All @@ -66,6 +63,9 @@ the [readme](../README.md).
error representations for each "phase" of the analysis. This portion of the library also
implements conversions between the various error types, and mechanisms for locating errors in
bytecode.
- `extractor`: This contains the [driver](../src/extractor/extractor) for the library itself, as well
as the implementation of the analysis state machine that makes it harder to get into broken states
while analysing a [contract](../src/extractor/contract.rs).
- `inference`: This contains the [type checker](../src/tc/mod.rs), as well as the
[type language](../src/tc/expression.rs) used by the library. It also contains the
[lifting passes](../src/tc/lift/mod.rs) and the [inference rules](../src/tc/rule/mod.rs) used by
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Extending the Analyzer
# Extending the Extractor

The primary extension point for this library comes in the form of improving the type inference
process. This process is made up of three major parts, two of which serve as extension points:
Expand Down Expand Up @@ -39,7 +39,7 @@ their [definition](../src/tc/expression.rs):
as a mapping on the EVM.
- `DynamicArray`: This expression says that the type variable whose inference list it appears in is
used as a dynamically-sized array on the EVM.
- `Conflict`: It is possible that the analyzer finds inferences that cannot be resolved. In that
- `Conflict`: It is possible that the extractor finds inferences that cannot be resolved. In that
case, a conflict is produced. This is not an element of the language that should be created
manually.

Expand Down
2 changes: 1 addition & 1 deletion src/constant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ pub const DEFAULT_CONDITIONAL_JUMP_PER_TARGET_FORK_LIMIT: usize = 50;
/// culled.
pub const DEFAULT_VALUE_SIZE_LIMIT: usize = 250;

/// The default number of loop iterations the analyzer will wait before polling
/// The default number of loop iterations the extractor will wait before polling
/// the watchdog.
pub const DEFAULT_WATCHDOG_POLL_LOOP_ITERATIONS: usize = 100;

Expand Down
2 changes: 1 addition & 1 deletion src/data/combine.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! This module contains the definition of the [`Combine`] trait (a monoid) as
//! well as some default implementations of that trait for useful types in the
//! context of the analyzer.
//! context of the extractor.

use std::{
collections::HashSet,
Expand Down
2 changes: 1 addition & 1 deletion src/data/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//! This module contains custom data structures used in the implementation of
//! the analyzer.
//! the extractor.

pub mod combine;
pub mod disjoint_set;
Expand Down
7 changes: 4 additions & 3 deletions src/error/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//! This module contains the primary error type for the analyzer's interface. It
//! also re-exports the more specific error types that are subsystem-specific.
//! This module contains the primary error type for the extractor's interface.
//! It also re-exports the more specific error types that are
//! subsystem-specific.

pub mod container;
pub mod disassembly;
Expand Down Expand Up @@ -65,7 +66,7 @@ impl container::Locatable for Error {
/// A library error with an associated bytecode location.
pub type LocatedError = container::Located<Error>;

/// A container of errors that may occur in the analyzer.
/// A container of errors that may occur in the extractor.
pub type Errors = container::Errors<LocatedError>;

/// Allow simple conversions from located disassembly errors by re-wrapping the
Expand Down
2 changes: 1 addition & 1 deletion src/analyzer/chain/mod.rs → src/extractor/chain/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

pub mod version;

use crate::analyzer::chain::version::EthereumVersion;
use crate::extractor::chain::version::EthereumVersion;

/// A representation of the chain on which the contract is running.
#[derive(Clone, Debug, Eq, PartialEq)]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! This module contains versioning information for the various EVM-compatible
//! blockchains. It is intended to be used alongside
//! [`crate::analyzer::chain::Chain`] to configure the behaviour of the
//! analyser.
//! [`crate::extractor::chain::Chain`] to configure the behaviour of the
//! library.
//!
//! For now we only support Shanghai on Ethereum main-net, but this will change
//! in the future.
Expand Down
2 changes: 1 addition & 1 deletion src/analyzer/contract.rs → src/extractor/contract.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! This module contains types useful for dealing with concrete contracts that
//! you want to analyze.

use crate::analyzer::chain::Chain;
use crate::extractor::chain::Chain;

/// The contract that is to be analyzed by the library.
///
Expand Down
Loading

0 comments on commit d265df5

Please sign in to comment.