Skip to content
This repository has been archived by the owner on Aug 2, 2024. It is now read-only.

feat: Indexing configs #1018

Merged
merged 73 commits into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from 61 commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
11a34e8
initial index file
d-roak Aug 18, 2023
f7b2f15
rm unused assets at genesis
d-roak Aug 18, 2023
41eda2e
configs url
d-roak Aug 18, 2023
22111ca
Added fetching and file hash validation
d-roak Aug 22, 2023
c8eb583
adjust configs index and constants
d-roak Aug 22, 2023
440aaee
replace Proxy.json; adjust hashes; change chain spec fetching logic
d-roak Aug 22, 2023
2da78fe
Merge branch 'main' into feat/configs-index
d-roak Aug 22, 2023
91a97b4
readme; fix linters and formatters
d-roak Aug 22, 2023
af87342
change genesis paths
d-roak Aug 22, 2023
02643d9
add missing path
d-roak Aug 22, 2023
cd42a18
rm println; make file hash optional
d-roak Aug 22, 2023
15b2010
Update configs.md
d-roak Aug 22, 2023
1664ed5
reorder flags; force update on fetch and verify
d-roak Aug 22, 2023
5332221
prettier, linter and fmt
d-roak Aug 22, 2023
a4caf59
add logs to ci
d-roak Aug 22, 2023
30b7a06
fix genesis.json hash
d-roak Aug 22, 2023
7570e04
disable logging; bugfix on non madara-path genesis loading
d-roak Aug 22, 2023
12c8f53
update package-lock
d-roak Aug 22, 2023
24544bd
rm tmp TODO; working as supposed
d-roak Aug 23, 2023
8dde928
add verifiers in the ci; rm pr close workflow
d-roak Aug 23, 2023
8ebb405
specify origin/main
d-roak Aug 23, 2023
9bdb002
2nd try to fix git diff
d-roak Aug 23, 2023
655c52a
fetch whole git history
d-roak Aug 23, 2023
3217e83
rm head ref
d-roak Aug 23, 2023
06254eb
Merge branch 'main' into feat/configs-index
d-roak Aug 23, 2023
21e2921
fix merge conflict
d-roak Aug 24, 2023
361879c
add disable madara configs flag
d-roak Aug 25, 2023
300970c
comment unused stuff
d-roak Aug 25, 2023
905b9f2
new flag docs; improve code readability; refactor for build-spec
d-roak Aug 25, 2023
c130616
set chain spec with match
d-roak Aug 25, 2023
8d58d50
clippy
d-roak Aug 25, 2023
e7a3dde
review adjustments
d-roak Aug 25, 2023
b937fda
add early return
d-roak Aug 25, 2023
a8c1abc
applying changed requests
d-roak Aug 28, 2023
ff16036
rm configs docs; add default value to madara_path
d-roak Aug 29, 2023
03559d6
short base path assign
d-roak Aug 29, 2023
5b2469b
rm chain specs from the indexer; change the flow for `setup` and `run`
d-roak Sep 1, 2023
f4f5f76
better separation of the args for the subcommands
d-roak Sep 3, 2023
8f686d8
Merge branch 'main' into feat/configs-index
d-roak Sep 3, 2023
eec3cae
drop chain specs verification in the ci
d-roak Sep 3, 2023
8ac9a81
fix linting issues; add setup for ci flows
d-roak Sep 3, 2023
ece6b64
Merge branch 'main' into feat/configs-index
d-roak Sep 14, 2023
430edf4
adjustments to the merge with main; change docs to include setup and run
d-roak Sep 14, 2023
93f1dd5
make testnet and chain exclusive; rm clone from fetch_madara_configs
d-roak Sep 14, 2023
d284017
run prettier and fmt
d-roak Sep 14, 2023
5150e8c
replace match with if
d-roak Sep 14, 2023
0bd8cae
use if in the non conjuction
d-roak Sep 14, 2023
f984b90
clippy
d-roak Sep 14, 2023
d9bd2a3
fix bug while running flags
d-roak Sep 14, 2023
edd71e7
add setup and run on tests
d-roak Sep 14, 2023
2e373c9
ignore eslint
d-roak Sep 14, 2023
1eaa054
delete println
d-roak Sep 17, 2023
7a6666f
Merge branch 'main' into feat/configs-index
d-roak Sep 17, 2023
1555cc5
merge main
d-roak Sep 18, 2023
0c29e0b
merge pulled
d-roak Sep 18, 2023
f661388
fix genesis hash
d-roak Sep 18, 2023
7362d25
change from cairo-contracts to genesis assets
d-roak Sep 18, 2023
b5f3afd
fix genesis hash
d-roak Sep 18, 2023
b28f96d
readd coverage to workflows
d-roak Sep 18, 2023
b8d4b33
comment coverage while main doesnt have rust tests
d-roak Sep 18, 2023
3caebb0
Merge branch 'main' into feat/configs-index
d-roak Sep 20, 2023
02d0def
fix conversations about expect messages and functions inputs
d-roak Sep 22, 2023
1c2ee5e
fix merge conflicts
d-roak Sep 22, 2023
87f4e31
wrap madara path string in a function
d-roak Sep 22, 2023
b67ef98
Merge branch 'main' into feat/configs-index
d-roak Sep 22, 2023
0d7485b
changed conversion of madara path to string
d-roak Sep 25, 2023
87424cb
Merge branch 'feat/configs-index' of github.com:d-roak/madara into fe…
d-roak Sep 25, 2023
3b20480
fmt and cargo lock
d-roak Sep 25, 2023
0751eee
Update crates/node/src/command.rs
d-roak Sep 27, 2023
d789c39
merge main
d-roak Sep 27, 2023
21303a2
re-add flamegraph to readme
d-roak Sep 27, 2023
03927cb
rustdoc for get madara path str
d-roak Sep 27, 2023
32f33e4
rustdoc for get madara path str
d-roak Sep 27, 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
32 changes: 32 additions & 0 deletions .github/workflows/configs-verifier.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: Task - Configs Verifier

on:
workflow_dispatch:
workflow_call:

jobs:
genesis-docs:
name: Genesis documentation
runs-on: ubuntu-latest
if: ${{ github.event.label.name != 'ignore-docs' }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Ensure docs changes
run: |
if [[ -n $(git diff --name-only origin/main | grep configs/genesis-assets/genesis.json) ]]; then
git diff --name-only origin/main | grep docs/genesis.md
fi

configs-hashes:
name: Verify genesis-assets hashes
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Verify hashes
run: |
for f in $(find configs/genesis-assets/ -type f -not -path configs/index.json); do
cat configs/index.json | grep $(md5sum $f | awk '{print $1}')
done
38 changes: 38 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Task - Integration Tests

on:
workflow_dispatch:
workflow_call:

jobs:
coverage:
# sadly, for now we have to "rebuild" for the coverage
runs-on: ubuntu-latest-32-cores
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key:
${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}-${{
github.run_id }}
fail-on-cache-miss: true
- name: Setup build deps
run: |
sudo apt-get update
sudo apt-get install -y clang llvm libudev-dev protobuf-compiler
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Coverage
run: cargo llvm-cov --codecov --output-path codecov.json
- name: Upload coverage to codecov.io
uses: codecov/codecov-action@v3
with:
files: codecov.json
fail_ci_if_error: false
5 changes: 3 additions & 2 deletions .github/workflows/madara-commands.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ jobs:
${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}-${{
github.run_id }}
fail-on-cache-miss: true
- name: Run setup
run: |
target/release/madara setup
- name: Create build-spec (plain)
run: |
target/release/madara build-spec --chain local > chain-plain.json
- name: Create build-spec (raw)
run: |
target/release/madara build-spec --chain chain-plain.json --raw > chain-raw.json

# TODO: add remaining commands
24 changes: 0 additions & 24 deletions .github/workflows/pull-request-close.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,3 @@ jobs:
steps:
- name: Check out code
uses: actions/checkout@v3

- name: Generate a token
id: generate_token
uses: getsentry/action-github-app-token@v2
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.PRIV_KEY }}

- name: Cleanup
run: |
gh extension install actions/gh-actions-cache
BRANCH="refs/pull/${{ github.event.pull_request.number }}/merge"
echo "Fetching list of cache key"
cacheKeysForPR=$(gh actions-cache list -B $BRANCH --key ${{ runner.os }}-cargo- | cut -f 1 )
set +e
echo "Deleting caches..."
for cacheKey in $cacheKeysForPR
do
echo "Deleting cache $cacheKey"
gh actions-cache delete $cacheKey -B $BRANCH --confirm
done
echo "Done"
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
15 changes: 13 additions & 2 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,19 @@ jobs:
name: Enforce CHANGELOG
uses: ./.github/workflows/changelog.yml

configs-verifier:
name: Verify configs
uses: ./.github/workflows/configs-verifier.yml

linters:
name: Run linters
uses: ./.github/workflows/linters.yml
needs: changelog
needs: [changelog, configs-verifier]

rust_build:
name: Build Rust project
uses: ./.github/workflows/rust-build.yml
needs: changelog
needs: [changelog, configs-verifier]

madara_commands:
name: Test Madara commands
Expand All @@ -31,6 +35,13 @@ jobs:
uses: ./.github/workflows/linters-cargo.yml
needs: rust_build

# TODO: Unlock when rust tests are working on main
# coverage:
# name: Run coverage
# uses: ./.github/workflows/coverage.yml
# needs: [madara_commands, linters_cargo]

# https://github.com/keep-starknet-strange/madara/issues/1097
# benchmark:
# name: Run benchmarks
# uses: ./.github/workflows/benchmarks.yml
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Next release

- ci: disable pr close workflow
tdelabro marked this conversation as resolved.
Show resolved Hide resolved
- ci: add ci verification for detecting genesis changes and config hashes
- feat: better management of custom configurations for genesis assets
- fix: use specific commit for avail and celestia
- fix: change dep of rustdoc on push
- feat: modify the hash_bytes functions in `poseidon` and `pedersen` for dynamic
Expand Down
7 changes: 7 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ jsonrpsee = { version = "0.16.3", default-features = false }
clap = { version = "4.4.2", default-features = false }
futures = { version = "0.3.28", default-features = false }
futures-timer = { version = "3.0.2", default-features = false }
md5 = { version = "0.7.0", default-features = false }
reqwest = { version = "0.11.20", default-features = false }
serde = { version = "1.0.188", default-features = false }
serde_json = { version = "1.0.107", default-features = false }
Expand Down
10 changes: 0 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,16 +141,6 @@ production environment, the relative changes and trends over time are what we
focus on. This way, we can ensure that Madara is always improving, and that we
maintain a high standard of performance as the project evolves.

One can use flamegraph-rs to generate flamegraphs and look for the performance
d-roak marked this conversation as resolved.
Show resolved Hide resolved
bottlenecks of the system by running the following :

```bash
flamegraph --root --open -- ./target/release/madara --dev --pool-limit=100000 --pool-kbytes=500000 --rpc-methods=unsafe --rpc-cors=all --in-peers=0 --out-peers=1 --no-telemetry
```

In parallel to that, run `npm run test` within the `benchmarking` folder. Once
you stop the node, the flamegraph will open in your browser.

## 🌐 Connect to the dev webapp

Once your Madara node is up and running, you can connect to our Dev Frontend App
Expand Down
Loading