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: signers #44

Merged
merged 44 commits into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
eb44578
init
DaniPopes Nov 22, 2023
809a4d3
setup
DaniPopes Nov 23, 2023
ed1d797
wip
DaniPopes Nov 23, 2023
fd82f7b
cfg stuff
DaniPopes Nov 23, 2023
f8c6554
chore: clippy
DaniPopes Nov 23, 2023
15ddd9b
signature methods, tests
DaniPopes Nov 23, 2023
5ff9a66
fix mnemonic test
DaniPopes Nov 24, 2023
a9a3685
fixes
DaniPopes Nov 24, 2023
9a90a52
wip: split to crates
DaniPopes Nov 24, 2023
ebccc56
fixes
DaniPopes Nov 24, 2023
9b0952d
chore: clippy
DaniPopes Nov 24, 2023
49e8a35
sort
DaniPopes Nov 24, 2023
8254a51
chore: consolidate aws to a single file
DaniPopes Nov 24, 2023
1d7aa37
rename `{Ledger,Trezor}` to `{Ledger,Trezor}Signer`
DaniPopes Nov 24, 2023
d5e3aa4
restructure
DaniPopes Nov 24, 2023
42e1824
add `set_chain_id`, provide a default `with_chain_id`
DaniPopes Nov 24, 2023
01b6086
bump AWS to 1.0
DaniPopes Nov 24, 2023
7a27dfb
better default impls for trait methods, sync feature
DaniPopes Nov 27, 2023
e6b16b5
remove Error GAT
DaniPopes Nov 27, 2023
0514193
remove chain_id
DaniPopes Nov 27, 2023
2e5734d
chore: clippy
DaniPopes Nov 27, 2023
19328b4
feats
DaniPopes Nov 27, 2023
e2709bf
msrv
DaniPopes Nov 27, 2023
3878e88
deps
DaniPopes Nov 27, 2023
49961f2
wazm
DaniPopes Nov 27, 2023
2ec2b60
stop failing
DaniPopes Nov 27, 2023
a8a946b
asynctrait
DaniPopes Nov 27, 2023
ec9cf02
tracing
DaniPopes Nov 27, 2023
26bf3b6
update ledger
DaniPopes Nov 29, 2023
447982c
Revert "remove chain_id"
DaniPopes Nov 29, 2023
493538b
split signer into two traits
DaniPopes Nov 29, 2023
579717d
make async the default method name
DaniPopes Nov 29, 2023
f814a92
docs
DaniPopes Nov 29, 2023
d701a79
make signature copy
DaniPopes Nov 29, 2023
61911f6
wallet error module
DaniPopes Nov 29, 2023
05d1978
docs
DaniPopes Nov 30, 2023
1551501
Merge branch 'main' into dani/signers
DaniPopes Dec 7, 2023
15bee3b
update ledger tests
DaniPopes Dec 7, 2023
e58bcae
update ledger tests again
DaniPopes Dec 7, 2023
a36d51a
use serial
DaniPopes Dec 7, 2023
4cdc706
fix
DaniPopes Dec 7, 2023
aded01f
todos
DaniPopes Dec 11, 2023
e11de38
Merge branch 'main' into dani/signers
DaniPopes Dec 11, 2023
e06356a
auto_impl
DaniPopes Dec 11, 2023
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
24 changes: 15 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ jobs:
strategy:
fail-fast: false
matrix:
rust: ["stable", "beta", "nightly", "1.65"] # MSRV
rust: ["stable", "beta", "nightly", "1.68"] # MSRV
flags: ["--no-default-features", "", "--all-features"]
exclude:
# Skip because some features have highest MSRV.
- rust: "1.65" # MSRV
# Some features have higher MSRV.
- rust: "1.68" # MSRV
flags: "--all-features"
steps:
- uses: actions/checkout@v3
Expand All @@ -39,10 +39,10 @@ jobs:
cache-on-failure: true
# Only run tests on latest stable and above
- name: build
if: ${{ matrix.rust == '1.65' }} # MSRV
if: ${{ matrix.rust == '1.68' }} # MSRV
run: cargo build --workspace ${{ matrix.flags }}
- name: test
if: ${{ matrix.rust != '1.65' }} # MSRV
if: ${{ matrix.rust != '1.68' }} # MSRV
run: cargo test --workspace ${{ matrix.flags }}

wasm:
Expand All @@ -52,13 +52,19 @@ jobs:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
target: wasm32-unknown-unknown
- uses: taiki-e/install-action@cargo-hack
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- name: check
# Do not run WASM checks on IPC as it doesn't make sense
run: cargo check --workspace --target wasm32-unknown-unknown --exclude "alloy-transport-ipc"
- name: cargo hack
run: |
cargo hack check --workspace --target wasm32-unknown-unknown \
--exclude alloy-transport-ipc \
--exclude alloy-signer \
--exclude alloy-signer-aws \
--exclude alloy-signer-ledger \
--exclude alloy-signer-trezor

feature-checks:
runs-on: ubuntu-latest
Expand Down
49 changes: 38 additions & 11 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ resolver = "2"
[workspace.package]
version = "0.1.0"
edition = "2021"
rust-version = "1.65"
rust-version = "1.68"
authors = ["Alloy Contributors"]
license = "MIT OR Apache-2.0"
homepage = "https://github.com/alloy-rs/next"
Expand All @@ -18,31 +18,58 @@ rustdoc-args = ["--cfg", "docsrs"]

[workspace.dependencies]
alloy-json-rpc = { version = "0.1.0", path = "crates/json-rpc" }
alloy-transport = { version = "0.1.0", path = "crates/transport" }
alloy-networks = { version = "0.1.0", path = "crates/networks" }
alloy-pubsub = { version = "0.1.0", path = "crates/pubsub" }
alloy-rpc-client = { version = "0.1.0", path = "crates/rpc-client" }
alloy-rpc-types = { version = "0.1.0", path = "crates/rpc-types" }
alloy-signer = { version = "0.1.0", path = "crates/signer" }
alloy-signer-aws = { version = "0.1.0", path = "crates/signer-aws" }
alloy-signer-ledger = { version = "0.1.0", path = "crates/signer-ledger" }
alloy-signer-trezor = { version = "0.1.0", path = "crates/signer-trezor" }
alloy-transport = { version = "0.1.0", path = "crates/transport" }
alloy-transport-http = { version = "0.1.0", path = "crates/transport-http" }
alloy-transport-ipc = { version = "0.1.0", path = "crates/transport-ipc" }
alloy-transport-ws = { version = "0.1.0", path = "crates/transport-ws" }
alloy-networks = { version = "0.1.0", path = "crates/networks" }
alloy-rpc-types = { version = "0.1.0", path = "crates/rpc-types" }
alloy-rpc-client = { version = "0.1.0", path = "crates/rpc-client" }

alloy-primitives = { version = "0.5.1", features = ["serde"] }
alloy-primitives = { version = "0.5.1", default-features = false, features = ["std"] }
alloy-sol-types = { version = "0.5.1", default-features = false, features = ["std"] }
alloy-rlp = "0.3"

# crypto
elliptic-curve = { version = "0.13.5", default-features = false, features = ["std"] }
generic-array = { version = "0.14.7", default-features = false, features = ["std"] }
k256 = { version = "0.13.2", default-features = false, features = ["ecdsa", "std"] }
sha2 = { version = "0.10.8", default-features = false, features = ["std"] }
spki = { version = "0.7.2", default-features = false, features = ["std"] }

# async
async-trait = "0.1.74"
base64 = "0.21"
bimap = "0.6"
futures = "0.3.29"
futures-util = "0.3.29"
futures-executor = "0.3.29"

hyper = "0.14.27"
tokio = "1.33"
tower = { version = "0.4.13", features = ["util"] }

tracing = "0.1.40"
tracing-subscriber = "0.3.18"

tempfile = "3.8"

auto_impl = "1.1"
assert_matches = "1.5"
base64 = "0.21"
bimap = "0.6"
itertools = "0.12"
pin-project = "1.1"
rand = "0.8.5"
reqwest = "0.11.18"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
serde_with = "3.4"
home = "0.5"
semver = "1.0"
serial_test = "2.0"
thiserror = "1.0"
tokio = { version = "1.33", features = ["sync", "macros"] }
tower = { version = "0.4.13", features = ["util"] }
tracing = "0.1.40"
url = "2.4"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ When updating this, also update:

Alloy will keep a rolling MSRV (minimum supported rust version) policy of **at
least** 6 months. When increasing the MSRV, the new Rust version must have been
released at least six months ago. The current MSRV is 1.65.0.
released at least six months ago. The current MSRV is 1.68.
Copy link
Member Author

Choose a reason for hiding this comment

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

aws-sdk-kms 1.68, with msrv at 1.70 in readme. I think we'll want to bump this to latest stable for AFIT anyway


Note that the MSRV is not increased automatically, and only as part of a minor
release.
Expand Down
2 changes: 1 addition & 1 deletion clippy.toml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
msrv = "1.65"
msrv = "1.68"
2 changes: 1 addition & 1 deletion crates/json-rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ repository.workspace = true
exclude.workspace = true

[dependencies]
alloy-primitives.workspace = true
alloy-primitives = { workspace = true, features = ["serde"] }
serde.workspace = true
serde_json = { workspace = true, features = ["raw_value"] }
thiserror.workspace = true
2 changes: 1 addition & 1 deletion crates/pubsub/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ alloy-transport.workspace = true
bimap.workspace = true
futures.workspace = true
serde_json.workspace = true
tokio.workspace = true
tokio = { workspace = true, features = ["macros", "sync"] }
tower.workspace = true
tracing.workspace = true
30 changes: 30 additions & 0 deletions crates/signer-aws/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[package]
name = "alloy-signer-aws"
description = "Ethereum AWS KMS signer"

version.workspace = true
edition.workspace = true
rust-version.workspace = true
authors.workspace = true
license.workspace = true
homepage.workspace = true
repository.workspace = true
exclude.workspace = true

[dependencies]
alloy-primitives.workspace = true
alloy-signer.workspace = true

async-trait.workspace = true
aws-sdk-kms = { version = "1.1", default-features = false }
k256.workspace = true
spki.workspace = true
thiserror.workspace = true
tracing.workspace = true

[dev-dependencies]
tokio = { workspace = true, features = ["macros", "rt-multi-thread"] }
aws-config = { version = "1.0", default-features = false }

[features]
eip712 = ["alloy-signer/eip712"]
5 changes: 5 additions & 0 deletions crates/signer-aws/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# alloy-signer-aws

Ethereum [AWS KMS] signer.

[AWS KMS]: https://aws.amazon.com/kms
22 changes: 22 additions & 0 deletions crates/signer-aws/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#![doc = include_str!("../README.md")]
#![doc(
html_logo_url = "https://raw.githubusercontent.com/alloy-rs/core/main/assets/alloy.jpg",
html_favicon_url = "https://raw.githubusercontent.com/alloy-rs/core/main/assets/favicon.ico"
)]
#![warn(
missing_copy_implementations,
missing_debug_implementations,
missing_docs,
unreachable_pub,
clippy::missing_const_for_fn,
rustdoc::all
)]
#![cfg_attr(not(test), warn(unused_crate_dependencies))]
#![deny(unused_must_use, rust_2018_idioms)]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]

#[macro_use]
extern crate tracing;

mod signer;
pub use signer::{AwsSigner, AwsSignerError};
Loading