Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 7687360
Author: Ng Wei Han <[email protected]>
Date:   Thu Dec 12 18:54:32 2024 +0800

    Remove size in OrderedSet (#2319)

commit 65b7507
Author: Ng Wei Han <[email protected]>
Date:   Thu Dec 12 18:20:55 2024 +0800

    Fix and refactor trie proof logics (#2252)

commit 2b1b219
Author: aleven1999 <[email protected]>
Date:   Thu Dec 12 12:11:28 2024 +0400

    Remove unused code (#2318)

commit 0a21162
Author: Daniil Ankushin <[email protected]>
Date:   Thu Dec 12 00:04:08 2024 +0700

    Remove unused code (#2317)

commit 8bf9be9
Author: Rian Hughes <[email protected]>
Date:   Wed Dec 11 14:11:22 2024 +0200

    update invoke v3 txn validation to require sender_address (#2308)

commit 91d0f8e
Author: Kirill <[email protected]>
Date:   Wed Dec 11 16:01:10 2024 +0400

    Add schema_version to output of db info command (#2309)

commit 60e8cc9
Author: AnavarKh <[email protected]>
Date:   Wed Dec 11 16:04:31 2024 +0530

    Update download link for Juno snapshots from dev to io in Readme file (#2314)

commit 8862de1
Author: wojciechos <[email protected]>
Date:   Wed Dec 11 11:20:02 2024 +0100

    Improve binary build workflow for cross-platform releases (#2315)

    - Add proper architecture handling in matrix configuration
    - Implement caching for Go modules and Rust dependencies
    - Streamline dependency installation for both Linux and macOS
    - Improve binary artifact handling and checksums
    - Add retention policy for build artifacts
    - Split build steps for better clarity and maintainability

    This update ensures more reliable and efficient binary builds
    across all supported platforms.

commit e75e504
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Wed Dec 11 07:35:16 2024 +0000

    Bump nanoid from 3.3.7 to 3.3.8 in /docs in the npm_and_yarn group across 1 directory (#2316)

    Bump nanoid in /docs in the npm_and_yarn group across 1 directory

    Bumps the npm_and_yarn group with 1 update in the /docs directory: [nanoid](https://github.com/ai/nanoid).

    Updates `nanoid` from 3.3.7 to 3.3.8
    - [Release notes](https://github.com/ai/nanoid/releases)
    - [Changelog](https://github.com/ai/nanoid/blob/main/CHANGELOG.md)
    - [Commits](ai/nanoid@3.3.7...3.3.8)

    ---
    updated-dependencies:
    - dependency-name: nanoid
      dependency-type: indirect
      dependency-group: npm_and_yarn
    ...

    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit 3a7abeb
Author: wojciechos <[email protected]>
Date:   Tue Dec 10 21:52:49 2024 +0100

    Skip error logs for FGW responses with NOT_RECEIVED status (#2303)

    * Add NotReceived case handling in adaptTransactionStatus

    ---------

    Co-authored-by: Rian Hughes <[email protected]>
  • Loading branch information
weiihann committed Dec 12, 2024
1 parent f997edf commit f1d1ff2
Show file tree
Hide file tree
Showing 28 changed files with 1,650 additions and 2,882 deletions.
57 changes: 41 additions & 16 deletions .github/workflows/build-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,13 @@ jobs:
matrix:
include:
- os: ubuntu-latest
arch: amd64
- os: macos-13
arch: amd64
- os: ubuntu-arm64-4-core
arch: arm64
- os: macos-latest
arch: arm64
runs-on: ${{ matrix.os }}

steps:
Expand All @@ -29,46 +33,67 @@ jobs:
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true

- name: Set up Rust
uses: dtolnay/rust-toolchain@stable

- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
with:
workspaces: |
vm/rust
core/rust
starknet/compiler/rust
- name: Get latest tag
run: echo "TAG=$(git describe --tags)" >> $GITHUB_ENV

- name: Get artifact name
run: echo "ARTIFACT_NAME=juno-${{ env.TAG }}-${{ runner.os }}-$(uname -m)" >> $GITHUB_ENV
run: |
OS_NAME=$([ "${{ runner.os }}" == "macOS" ] && echo "darwin" || echo "linux")
echo "ARTIFACT_NAME=juno-${{ env.TAG }}-${OS_NAME}-${{ matrix.arch }}" >> $GITHUB_ENV
- name: Install dependencies (Linux)
if: runner.os == 'Linux'
run: sudo apt-get update -qq && sudo apt-get install -y upx-ucl build-essential cargo git golang libjemalloc-dev libjemalloc2 -y
run: |
sudo apt-get update -qq
sudo apt-get install -y upx-ucl libjemalloc-dev libjemalloc2 libbz2-dev
- name: Install dependencies (macOS)
if: runner.os == 'macOS'
run: brew install cargo-c jemalloc

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
run: brew install jemalloc

- name: Build Juno
- name: Build binary
run: make juno

- name: Compress binary (Linux)
if: runner.os == 'Linux'
run: |
make juno
if [[ "${{ runner.os }}" != "macOS" ]]; then
upx build/juno
fi
upx build/juno
mv build/juno ${{ env.ARTIFACT_NAME }}
- name: Generate Checksum
id: checksum
- name: Prepare binary (macOS)
if: runner.os == 'macOS'
run: mv build/juno ${{ env.ARTIFACT_NAME }}

- name: Generate checksum
run: |
if [[ "${{ runner.os }}" == "macOS" ]]; then
shasum -a 256 ${{ env.ARTIFACT_NAME }} > ${{ env.ARTIFACT_NAME }}.sha256
else
sha256sum ${{ env.ARTIFACT_NAME }} > ${{ env.ARTIFACT_NAME }}.sha256
fi
- name: Upload Artifact
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.ARTIFACT_NAME }}
path: |
${{ env.ARTIFACT_NAME }}
${{ env.ARTIFACT_NAME }}.sha256
retention-days: 30
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,32 +112,32 @@ Use the provided snapshots to quickly sync your Juno node with the current state
| Version | Download Link |
| ------- | ------------- |
| **>=v0.9.2** | [**juno_mainnet.tar**](https://juno-snapshots.nethermind.dev/files/mainnet/latest) |
| **>=v0.9.2** | [**juno_mainnet.tar**](https://juno-snapshots.nethermind.io/files/mainnet/latest) |
#### Sepolia
| Version | Download Link |
| ------- | ------------- |
| **>=v0.9.2** | [**juno_sepolia.tar**](https://juno-snapshots.nethermind.dev/files/sepolia/latest) |
| **>=v0.9.2** | [**juno_sepolia.tar**](https://juno-snapshots.nethermind.io/files/sepolia/latest) |
#### Sepolia-Integration
| Version | Download Link |
| ------- | ------------- |
| **>=v0.9.2** | [**juno_sepolia_integration.tar**](https://juno-snapshots.nethermind.dev/files/sepolia-integration/latest) |
| **>=v0.9.2** | [**juno_sepolia_integration.tar**](https://juno-snapshots.nethermind.io/files/sepolia-integration/latest) |
### Getting the size for each snapshot
```console
$date
Thu 1 Aug 2024 09:49:30 BST
$curl -s -I -L https://juno-snapshots.nethermind.dev/files/mainnet/latest | gawk -v IGNORECASE=1 '/^Content-Length/ { printf "%.2f GB\n", $2/1024/1024/1024 }'
$curl -s -I -L https://juno-snapshots.nethermind.io/files/mainnet/latest | gawk -v IGNORECASE=1 '/^Content-Length/ { printf "%.2f GB\n", $2/1024/1024/1024 }'
172.47 GB
$curl -s -I -L https://juno-snapshots.nethermind.dev/files/sepolia/latest | gawk -v IGNORECASE=1 '/^Content-Length/ { printf "%.2f GB\n", $2/1024/1024/1024 }'
$curl -s -I -L https://juno-snapshots.nethermind.io/files/sepolia/latest | gawk -v IGNORECASE=1 '/^Content-Length/ { printf "%.2f GB\n", $2/1024/1024/1024 }'
5.67 GB
$curl -s -I -L https://juno-snapshots.nethermind.dev/files/sepolia-integration/latest | gawk -v IGNORECASE=1 '/^Content-Length/ { printf "%.2f GB\n", $2/1024/1024/1024 }'
$curl -s -I -L https://juno-snapshots.nethermind.io/files/sepolia-integration/latest | gawk -v IGNORECASE=1 '/^Content-Length/ { printf "%.2f GB\n", $2/1024/1024/1024 }'
2.4 GB
```
Expand All @@ -148,7 +148,7 @@ $curl -s -I -L https://juno-snapshots.nethermind.dev/files/sepolia-integration/l
Fetch the snapshot from the provided URL:
```bash
wget -O juno_mainnet.tar https://juno-snapshots.nethermind.dev/files/mainnet/latest
wget -O juno_mainnet.tar https://juno-snapshots.nethermind.io/files/mainnet/latest
```
2. **Prepare Directory**
Expand Down
34 changes: 0 additions & 34 deletions adapters/vm2core/vm2core.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,6 @@ import (
"github.com/ethereum/go-ethereum/common"
)

func AdaptExecutionResources(resources *vm.ExecutionResources) *core.ExecutionResources {
return &core.ExecutionResources{
BuiltinInstanceCounter: core.BuiltinInstanceCounter{
Pedersen: resources.Pedersen,
RangeCheck: resources.RangeCheck,
Bitwise: resources.Bitwise,
Ecsda: resources.Ecdsa,
EcOp: resources.EcOp,
Keccak: resources.Keccak,
Poseidon: resources.Poseidon,
SegmentArena: resources.SegmentArena,
Output: resources.Output,
AddMod: resources.AddMod,
MulMod: resources.MulMod,
RangeCheck96: resources.RangeCheck96,
},
MemoryHoles: resources.MemoryHoles,
Steps: resources.Steps,
DataAvailability: adaptDA(resources.DataAvailability),
TotalGasConsumed: nil, // todo: fill after 0.13.2
}
}

func AdaptOrderedEvent(event vm.OrderedEvent) *core.Event {
return &core.Event{
From: event.From,
Expand Down Expand Up @@ -62,14 +39,3 @@ func AdaptOrderedEvents(events []vm.OrderedEvent) []*core.Event {
})
return utils.Map(events, AdaptOrderedEvent)
}

func adaptDA(da *vm.DataAvailability) *core.DataAvailability {
if da == nil {
return nil
}

return &core.DataAvailability{
L1Gas: da.L1Gas,
L1DataGas: da.L1DataGas,
}
}
32 changes: 0 additions & 32 deletions adapters/vm2core/vm2core_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,35 +68,3 @@ func TestAdaptOrderedMessagesToL1(t *testing.T) {
vm2core.AdaptOrderedMessageToL1(messages[0]),
}, vm2core.AdaptOrderedMessagesToL1(messages))
}

func TestAdaptExecutionResources(t *testing.T) {
require.Equal(t, &core.ExecutionResources{
BuiltinInstanceCounter: core.BuiltinInstanceCounter{
Pedersen: 1,
RangeCheck: 2,
Bitwise: 3,
Ecsda: 4,
EcOp: 5,
Keccak: 6,
Poseidon: 7,
SegmentArena: 8,
Output: 11,
},
MemoryHoles: 9,
Steps: 10,
}, vm2core.AdaptExecutionResources(&vm.ExecutionResources{
ComputationResources: vm.ComputationResources{
Pedersen: 1,
RangeCheck: 2,
Bitwise: 3,
Ecdsa: 4,
EcOp: 5,
Keccak: 6,
Poseidon: 7,
SegmentArena: 8,
MemoryHoles: 9,
Steps: 10,
Output: 11,
},
}))
}
10 changes: 9 additions & 1 deletion cmd/juno/dbcmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/NethermindEth/juno/core/felt"
"github.com/NethermindEth/juno/db"
"github.com/NethermindEth/juno/db/pebble"
"github.com/NethermindEth/juno/migration"
"github.com/NethermindEth/juno/utils"
"github.com/olekukonko/tablewriter"
"github.com/spf13/cobra"
Expand All @@ -21,6 +22,7 @@ const (

type DBInfo struct {
Network string `json:"network"`
SchemaVersion uint64 `json:"schema_version"`
ChainHeight uint64 `json:"chain_height"`
LatestBlockHash *felt.Felt `json:"latest_block_hash"`
LatestStateRoot *felt.Felt `json:"latest_state_root"`
Expand Down Expand Up @@ -84,7 +86,7 @@ func dbInfo(cmd *cobra.Command, args []string) error {
defer database.Close()

chain := blockchain.New(database, nil)
info := DBInfo{}
var info DBInfo

// Get the latest block information
headBlock, err := chain.Head()
Expand All @@ -97,6 +99,12 @@ func dbInfo(cmd *cobra.Command, args []string) error {
return fmt.Errorf("failed to get the state update: %v", err)
}

schemaMeta, err := migration.SchemaMetadata(database)
if err != nil {
return fmt.Errorf("failed to get schema metadata: %v", err)
}

info.SchemaVersion = schemaMeta.Version
info.Network = getNetwork(headBlock, stateUpdate.StateDiff)
info.ChainHeight = headBlock.Number
info.LatestBlockHash = headBlock.Hash
Expand Down
Loading

0 comments on commit f1d1ff2

Please sign in to comment.