Skip to content

Commit

Permalink
chore: initialize repo
Browse files Browse the repository at this point in the history
  • Loading branch information
morph-dev committed May 14, 2024
1 parent 1d4c973 commit 738ce1e
Show file tree
Hide file tree
Showing 10 changed files with 201 additions and 2 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/conventional_commits.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Conventional Commits

on: [push, pull_request]

jobs:
commitlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: webiny/action-conventional-commits@v1.3.0
62 changes: 62 additions & 0 deletions .github/workflows/dependencies.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# This workflow is borrowed from reth: https://github.com/paradigmxyz/reth/blob/e04292247fff14ea93b4b0f6cf427bc9e4365c75/.github/workflows/dependencies.yml
# Automatically run `cargo update` periodically

name: Update Dependencies

on:
schedule:
# Run weekly
- cron: '0 0 * * SUN'
workflow_dispatch:
# Needed so we can run it manually

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: cargo-update
TITLE: 'chore(deps): weekly `cargo update`'
BODY: |
Automation to keep dependencies in `Cargo.lock` current.
<details><summary><strong>cargo update log</strong></summary>
<p>
```log
$cargo_update_log
```
</p>
</details>
jobs:
update:
name: Update
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable

- name: cargo update
# Remove first line that always just says "Updating crates.io index"
run: cargo update --color never 2>&1 | sed '/crates.io index/d' | tee -a cargo_update.log

- name: craft commit message and PR body
id: msg
run: |
export cargo_update_log="$(cat cargo_update.log)"
echo "commit_message<<EOF" >> $GITHUB_OUTPUT
printf "$TITLE\n\n$cargo_update_log\n" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
echo "body<<EOF" >> $GITHUB_OUTPUT
echo "$BODY" | envsubst >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
add-paths: ./Cargo.lock
commit-message: ${{ steps.msg.outputs.commit_message }}
title: ${{ env.TITLE }}
body: ${{ steps.msg.outputs.body }}
branch: ${{ env.BRANCH }}
98 changes: 98 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: Rust

on: [push, pull_request]

jobs:
fmt:
name: Format
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
components: rustfmt
- name: Cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check

check:
name: Check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Cargo check
uses: actions-rs/cargo@v1
with:
command: check
args: --workspace

clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: clippy
- name: Cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all --all-targets --all-features --no-deps -- -D warnings

build:
name: Build Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Cargo build
uses: actions-rs/cargo@v1
with:
command: build
args: --workspace --release

test:
name: Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: 'true'
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Cargo test
uses: actions-rs/cargo@v1
with:
command: test
args: --workspace
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ Cargo.lock

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb

.DS_Store
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[workspace]
members = [ "portal-verkle-trie" ]
resolver = "2"
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# portal-verkle
The implementation of the Portal Network version of Verkle Trie
# Verkle trie in Portal Network

This repository contains Rust implementation of the Verkle trie for usage inside Portal Network.

**This code has not been reviewed and is not safe to use in non-research capacities.**
8 changes: 8 additions & 0 deletions portal-verkle-trie/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[package]
name = "portal-verkle-trie"
version = "0.1.0"
edition = "2021"
description = "Implementation of the Portal Network version of the Verkle trie."
license = "MIT"
readme = "README.md"
keywords = ["ethereum", "portal-network", "verkle"]
3 changes: 3 additions & 0 deletions portal-verkle-trie/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# The Portal Network implementation of the Verkle trie

This crate implements the Portal Network version of the Verkle trie, whose specification can be found [here](https://github.com/ethereum/portal-network-specs/blob/master/state-verkle-network.md).
1 change: 1 addition & 0 deletions portal-verkle-trie/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

6 changes: 6 additions & 0 deletions rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
imports_granularity = "Crate"
comment_width = 100
wrap_comments = true
format_code_in_doc_comments = true
doc_comment_code_block_width = 100
use_field_init_shorthand = true

0 comments on commit 738ce1e

Please sign in to comment.