Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
93b3bf2
feat(wip): add unix socket server for state queries
NikhilSharmaWe Mar 19, 2025
e18ce89
fix: write to scalerize commit multistore only on when a reth Tx is c…
NikhilSharmaWe Mar 21, 2025
f4a1650
fix: populate storage keys in storage proofs and zero value for Nonce…
NikhilSharmaWe Mar 21, 2025
8ca6751
fix: cleanup the cursor map in pre_block and minor fixes
NikhilSharmaWe Apr 7, 2025
a840e86
fix: use holiman uint256 instead of hexutil.Big for value type in Sto…
NikhilSharmaWe Apr 7, 2025
8879530
chore: set rpc.eth-proof-window since default is 0
NikhilSharmaWe Apr 8, 2025
a3633d1
fix: use cachemultistore for read operations instead of commit multis…
NikhilSharmaWe Apr 9, 2025
dee15e1
feat(wip): call for new_payload to reth in PreBlock if node is catchi…
NikhilSharmaWe Apr 16, 2025
aa15ae5
feat: use sync status for running the syncing logic in PreBlock when …
NikhilSharmaWe Apr 28, 2025
2da0d2f
chore: remove unnecessary log statements and minor fixes
NikhilSharmaWe Apr 28, 2025
14827ce
chore: cp in start-testnet-node script with sudo
NikhilSharmaWe Apr 30, 2025
ff0d99c
Merge remote-tracking branch 'origin' into feat/state-sync
NikhilSharmaWe Apr 30, 2025
cdf4ab2
fix: remove sudo in start-testnet-node script
NikhilSharmaWe Apr 30, 2025
f241340
chore: add make rules and dockerfile used in network setup with speci…
NikhilSharmaWe May 2, 2025
25c57d8
fix: remove the unrequired set call to commit multistore
NikhilSharmaWe May 2, 2025
c4e4d1d
feat: add unconditional persistent peers in the nodes starting up the…
NikhilSharmaWe May 3, 2025
3b0e574
chore: set allow_duplicate_ip to true
NikhilSharmaWe May 3, 2025
7947c73
fix: treat the case as state sync when PREBLOCK is called without cal…
NikhilSharmaWe May 9, 2025
9f4fa32
chore: map one of the reth containers rpc port in docker compose to 8…
NikhilSharmaWe May 13, 2025
1affdbd
chore: bind websocket to all network interfaces in reth
NikhilSharmaWe May 14, 2025
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ debug_container.log
.scalerized
example-testnet
build
*.env
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ COPY --from=build-env /go/src/github.com/aerius-labs/scalerize/build/scalerized
COPY --from=build-env /go/src/github.com/aerius-labs/scalerize/example-testnet example-testnet
COPY --from=build-env /go/src/github.com/aerius-labs/scalerize/start-testnet-node.sh start-testnet-node.sh
COPY --from=build-env /go/src/github.com/aerius-labs/scalerize/testing/files/jwt.hex jwt.hex
COPY --from=build-env /go/src/github.com/aerius-labs/scalerize/scripts/init.sh ./init.sh

# Run scalerized by default
CMD ["scalerized"]
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ SCALERIZED_BINARY_PATH := /go/src/github.com/aerius-labs/scalerize/build/scaleri
BUILDDIR ?= $(CURDIR)/build

include scripts/execution-client.mk
-include testnet.env
export $(shell sed 's/=.*//' testnet.env)

BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
COMMIT := $(shell git log -1 --format='%H')
Expand Down Expand Up @@ -57,3 +59,8 @@ init:

localtestnet-example-config:
$(SCALERIZED_BINARY_PATH) testnet init-files --output-dir example-testnet --v $(NODES) --starting-ip-address $(STARTING-IP-ADDR) --keyring-backend test

localtestnet-config:
@echo "Using NO_OF_NODES=$(NO_OF_NODES) and IP_ADDRESSES=$(IP_ADDRESSES)"
@set -a && . ./testnet.env && set +a && \
$(SCALERIZED_BINARY_PATH) testnet init-files --output-dir example-testnet --v $(NO_OF_NODES) --ip-addresses $(IP_ADDRESSES) --keyring-backend test
66 changes: 11 additions & 55 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package app
import (
"context"
_ "embed"
"fmt"
"io"
"sync"

Expand Down Expand Up @@ -55,7 +54,8 @@ var AppConfigYAML []byte
var (
_ runtime.AppI = (*ScalerizeApp)(nil)
_ servertypes.Application = (*ScalerizeApp)(nil)
socketPath string
dbSocketPath string
stateSocketPath string
cometBFTRPCAddress string
)

Expand Down Expand Up @@ -145,7 +145,8 @@ func NewScalerizeApp(
return nil, err
}

socketPath = appOpts.Get(params.FlagSocketPath).(string)
dbSocketPath = appOpts.Get(params.FlagDBSocketPath).(string)
stateSocketPath = appOpts.Get(params.FlagStateSocketPath).(string)
cometBFTRPCAddress = appOpts.Get(params.FlagCometBFTRPCAddress).(string)

executionClient, err := app.NewClient(ctx, appOpts, logger)
Expand Down Expand Up @@ -182,7 +183,6 @@ func NewScalerizeApp(

/**** Module Options ****/

fmt.Println("CHAIN ID: ", app.ChainID())
// create the simulation manager and define the order of the modules for deterministic simulations
// NOTE: this is not required apps that don't use the simulator for fuzz testing transactions
app.sm = module.NewSimulationManagerFromAppModules(app.ModuleManager.Modules, make(map[string]module.AppModuleSimulation, 0))
Expand All @@ -192,13 +192,15 @@ func NewScalerizeApp(
return nil, err
}

go app.StartDBRouter(appOpts.Get(params.FlagExecutionClientType).(string))
clientType := appOpts.Get(params.FlagExecutionClientType).(string)

<-ensureClientCreatedCh
executionClient.SetApp(app.BaseApp)

for _, storekey := range app.GetStoreKeys() {
fmt.Printf("STORE KEY: %+v\n", storekey)
}
go app.StartDBRouter(clientType)
go app.StartStateRouter(clientType)
go executionClient.SetCosmosRPCClient(cometBFTRPCAddress)

<-ensureClientCreatedCh

return app, nil
}
Expand Down Expand Up @@ -243,49 +245,3 @@ func (app *ScalerizeApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.
panic(err)
}
}

// func GetProof(clientCtx client.Context, storeKey string, key []byte) ([]byte, *crypto.ProofOps, error) {
// height := clientCtx.Height
// fmt.Println("HEIGHT: ", height)
// // ABCI queries at height less than or equal to 2 are not supported.
// // Base app does not support queries for height less than or equal to 1.
// // Therefore, a query at height 2 would be equivalent to a query at height 3
// if height <= 2 {
// return nil, nil, fmt.Errorf("proof queries at height <= 2 are not supported")
// }

// abciReq := abci.RequestQuery{
// Path: fmt.Sprintf("store/%s/key", storeKey),
// Data: key,
// Height: height,
// Prove: true,
// }

// abciRes, err := clientCtx.QueryABCI(abciReq)
// if err != nil {
// return nil, nil, err
// }

// return abciRes.Value, abciRes.ProofOps, nil
// }

// func (app *ScalerizeApp) InitializeCommitMultiStore(db dbm.DB, logger log.Logger, metricGatherer metrics.StoreMetrics) error {
// // Initialize the CommitMultiStore
// cms := store.NewCommitMultiStore(db, logger, metricGatherer)

// // Mount necessary stores
// for _, table := range app.executionTablesInfo {
// cms.MountStoreWithDB(table.StoreKey, storetypes.StoreTypeIAVL, db)
// }

// // Load the latest version
// err := cms.LoadLatestVersion()
// if err != nil {
// return err
// }

// // Set the CommitMultiStore
// app.SetCMS(cms)

// return nil
// }
3 changes: 3 additions & 0 deletions app/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@ import (
storetypes "cosmossdk.io/store/types"
"github.com/aerius-labs/scalerize/app/params"
evmexec "github.com/aerius-labs/scalerize/execution/evm"
"github.com/cosmos/cosmos-sdk/baseapp"
servertypes "github.com/cosmos/cosmos-sdk/server/types"
)

type ExecutionClient interface {
Name() string
Start(ctx context.Context, ready chan bool) error
SetApp(*baseapp.BaseApp)
SetCosmosRPCClient(string)
ABCIHandler
}

Expand Down
9 changes: 0 additions & 9 deletions app/constants.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
package app

import "sync"

var (
ethIteratorsCurrentKey = make(map[[CursorIDBytes]byte][]byte)
ethIteratorsCurrentKeyLock sync.RWMutex
)

const (
// DbTx and DbTxMut for both regular and dup-sorted tables
OP_PUT byte = 1
Expand Down Expand Up @@ -62,8 +55,6 @@ const (
EthAccountAddressBytes = 20
EthBlockNumberBytes = 8
EthBlockHashBytes = 32

CursorIDBytes = 8
)

const (
Expand Down
Loading