diff --git a/clerk/keeper.go b/clerk/keeper.go index f72617290..47451c42c 100644 --- a/clerk/keeper.go +++ b/clerk/keeper.go @@ -317,3 +317,43 @@ func (k *Keeper) HasRecordSequence(ctx sdk.Context, sequence string) bool { store := ctx.KVStore(k.storeKey) return store.Has(GetRecordSequenceKey(sequence)) } + +// IterateRecordsAndCollect iterates over EventRecords, collects up to 'max' entries, +// and returns a slice containing the collected records. +// It continues from the last key processed in the previous batch. +func (k *Keeper) IterateRecordsAndCollect(ctx sdk.Context, nextKey []byte, max int) ([]*types.EventRecord, []byte, error) { + store := ctx.KVStore(k.storeKey) + + var startKey []byte + if nextKey != nil { + startKey = nextKey + } else { + startKey = StateRecordPrefixKey + } + + endKey := sdk.PrefixEndBytes(StateRecordPrefixKey) + + iterator := store.Iterator(startKey, endKey) + defer iterator.Close() + + collectedRecords := make([]*types.EventRecord, 0, max) + entriesCollected := 0 + + for ; iterator.Valid() && entriesCollected < max; iterator.Next() { + var record types.EventRecord + if err := k.cdc.UnmarshalBinaryBare(iterator.Value(), &record); err != nil { + k.Logger(ctx).Error("IterateRecordsAndCollect | UnmarshalBinaryBare", "error", err) + return nil, nil, err + } + + collectedRecords = append(collectedRecords, &record) + entriesCollected++ + } + + // We want to return the key after last processed key because the iterator is inclusive for the start key + if iterator.Valid() { + return collectedRecords, iterator.Key(), nil + } + + return collectedRecords, nil, nil +} diff --git a/clerk/module.go b/clerk/module.go index e0bdad1f3..1e6189fa2 100644 --- a/clerk/module.go +++ b/clerk/module.go @@ -20,9 +20,10 @@ import ( ) var ( - _ module.AppModule = AppModule{} - _ module.AppModuleBasic = AppModuleBasic{} - _ hmModule.HeimdallModuleBasic = AppModule{} + _ module.AppModule = AppModule{} + _ module.AppModuleBasic = AppModuleBasic{} + _ hmModule.HeimdallModuleBasic = AppModule{} + _ hmModule.StreamedGenesisExporter = AppModule{} // _ module.AppModuleSimulation = AppModule{} ) @@ -134,13 +135,37 @@ func (am AppModule) InitGenesis(ctx sdk.Context, data json.RawMessage) []abci.Va return []abci.ValidatorUpdate{} } -// ExportGenesis returns the exported genesis state as raw bytes for the auth +// ExportGenesis returns the exported genesis state as raw bytes for the clerk // module. func (am AppModule) ExportGenesis(ctx sdk.Context) json.RawMessage { gs := ExportGenesis(ctx, am.keeper) return types.ModuleCdc.MustMarshalJSON(gs) } +// ExportPartialGenesis returns the exported genesis state as raw bytes excluding the data +// that will be returned via NextGenesisData. +func (am AppModule) ExportPartialGenesis(ctx sdk.Context) (json.RawMessage, error) { + type partialGenesisState struct { + RecordSequences []string `json:"record_sequences" yaml:"record_sequences"` + } + return types.ModuleCdc.MustMarshalJSON(partialGenesisState{ + RecordSequences: am.keeper.GetRecordSequences(ctx), + }), nil +} + +// NextGenesisData returns the next chunk of genesis data. +func (am AppModule) NextGenesisData(ctx sdk.Context, nextKey []byte, max int) (*hmModule.ModuleGenesisData, error) { + data, nextKey, err := am.keeper.IterateRecordsAndCollect(ctx, nextKey, max) + if err != nil { + return nil, err + } + return &hmModule.ModuleGenesisData{ + Path: "event_records", + Data: types.ModuleCdc.MustMarshalJSON(data), + NextKey: nextKey, + }, nil +} + // BeginBlock returns the begin blocker for the auth module. func (AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {} diff --git a/cmd/heimdallcli/main.go b/cmd/heimdallcli/main.go index 4707c36ee..08271847a 100644 --- a/cmd/heimdallcli/main.go +++ b/cmd/heimdallcli/main.go @@ -1,12 +1,16 @@ package main import ( + "bytes" "encoding/hex" "encoding/json" "errors" "fmt" + "io" + defaultLogger "log" "os" "path" + "runtime" "strings" "time" @@ -22,9 +26,11 @@ import ( "github.com/ethereum/go-ethereum/console/prompt" "github.com/ethereum/go-ethereum/crypto" "github.com/google/uuid" + hmModule "github.com/maticnetwork/heimdall/types/module" "github.com/spf13/cobra" "github.com/spf13/viper" "github.com/tendermint/go-amino" + abci "github.com/tendermint/tendermint/abci/types" "github.com/tendermint/tendermint/crypto/secp256k1" "github.com/tendermint/tendermint/libs/cli" "github.com/tendermint/tendermint/libs/common" @@ -50,6 +56,7 @@ var ( Short: "Heimdall light-client", PersistentPreRunE: func(cmd *cobra.Command, args []string) error { if cmd.Use != version.Cmd.Use { + defaultLogger.SetOutput(os.Stdout) // initialise config initTendermintViperConfig(cmd) } @@ -220,16 +227,21 @@ func exportCmd(ctx *server.Context, _ *codec.Codec) *cobra.Command { } happ := app.NewHeimdallApp(logger, db) - appState, _, err := happ.ExportAppStateAndValidators() + + savePath := file.Rootify("dump-genesis.json", config.RootDir) + file, err := os.Create(savePath) if err != nil { panic(err) } + defer file.Close() - err = writeGenesisFile(file.Rootify("config/dump-genesis.json", config.RootDir), chainID, appState) - if err == nil { - fmt.Println("New genesis json file created:", file.Rootify("config/dump-genesis.json", config.RootDir)) + if err := generateMarshalledAppState(happ, chainID, 1000, file); err != nil { + panic(err) } - return err + + fmt.Println("New genesis json file created: ", savePath) + + return nil }, } cmd.Flags().String(cli.HomeFlag, helper.DefaultNodeHome, "Node's home directory") @@ -239,6 +251,192 @@ func exportCmd(ctx *server.Context, _ *codec.Codec) *cobra.Command { return cmd } +// generateMarshalledAppState writes the genesis doc with app state directly to a file to minimize memory usage. +func generateMarshalledAppState(happ *app.HeimdallApp, chainID string, maxNextGenesisItems int, w io.Writer) error { + sdkCtx := happ.NewContext(true, abci.Header{Height: happ.LastBlockHeight()}) + moduleManager := happ.GetModuleManager() + + if _, err := w.Write([]byte("{")); err != nil { + return err + } + + if _, err := w.Write([]byte(`"app_state":`)); err != nil { + return err + } + + if _, err := w.Write([]byte(`{`)); err != nil { + return err + } + + isFirst := true + + for _, moduleName := range moduleManager.OrderExportGenesis { + runtime.GC() + + if !isFirst { + if _, err := w.Write([]byte(`,`)); err != nil { + return err + } + } + + isFirst = false + + if _, err := w.Write([]byte(`"` + moduleName + `":`)); err != nil { + return err + } + + module, isStreamedGenesis := moduleManager.Modules[moduleName].(hmModule.StreamedGenesisExporter) + if isStreamedGenesis { + partialGenesis, err := module.ExportPartialGenesis(sdkCtx) + if err != nil { + return err + } + + propertyName, data, err := fetchModuleStreamedData(sdkCtx, module, maxNextGenesisItems) + if err != nil { + return err + } + + // remove the closing '}' + if _, err = w.Write(partialGenesis[0 : len(partialGenesis)-1]); err != nil { + return err + } + + if _, err = w.Write([]byte(`,`)); err != nil { + return err + } + + if _, err = w.Write([]byte(`"` + propertyName + `":`)); err != nil { + return err + } + + if _, err = w.Write(data); err != nil { + return err + } + + // add the closing '}' + if _, err = w.Write(partialGenesis[len(partialGenesis)-1:]); err != nil { + return err + } + + continue + } + + genesis := moduleManager.Modules[moduleName].ExportGenesis(sdkCtx) + + if _, err := w.Write(genesis); err != nil { + return err + } + } + + if _, err := w.Write([]byte(`}`)); err != nil { + return err + } + + if _, err := w.Write([]byte(`,`)); err != nil { + return err + } + + consensusParams := tmTypes.DefaultConsensusParams() + genesisTime := time.Now().UTC().Format(time.RFC3339Nano) + + consensusParamsData, err := tmTypes.GetCodec().MarshalJSON(consensusParams) + if err != nil { + return err + } + + remainingFields := map[string]interface{}{ + "chain_id": chainID, + "consensus_params": json.RawMessage(consensusParamsData), + "genesis_time": genesisTime, + } + + remainingFieldsData, err := json.Marshal(remainingFields) + if err != nil { + return err + } + + if _, err := w.Write(remainingFieldsData[1 : len(remainingFieldsData)-1]); err != nil { + return err + } + + if _, err := w.Write([]byte("}")); err != nil { + return err + } + + return nil +} + +// fetchModuleStreamedData fetches module genesis data in streamed fashion. +func fetchModuleStreamedData(sdkCtx sdk.Context, module hmModule.StreamedGenesisExporter, maxNextGenesisItems int) (string, json.RawMessage, error) { + var lastKey []byte + allData := []json.RawMessage{} + allDataLength := 0 + + for { + data, err := module.NextGenesisData(sdkCtx, lastKey, maxNextGenesisItems) + if err != nil { + panic(err) + } + + lastKey = data.NextKey + + if lastKey == nil { + allData = append(allData, data.Data) + allDataLength += len(data.Data) + + if allDataLength == 0 { + break + } + + combinedData, err := combineJSONArrays(allData, allDataLength) + if err != nil { + return "", nil, err + } + + return data.Path, combinedData, nil + } + + allData = append(allData, data.Data) + allDataLength += len(data.Data) + } + + return "", nil, errors.New("failed to iterate module genesis data") +} + +// combineJSONArrays combines multiple JSON arrays into a single JSON array. +func combineJSONArrays(arrays []json.RawMessage, allArraysLength int) (json.RawMessage, error) { + buf := bytes.NewBuffer(make([]byte, 0, allArraysLength)) + buf.WriteByte('[') + first := true + + for _, raw := range arrays { + if len(raw) == 0 { + continue + } + + if raw[0] != '[' || raw[len(raw)-1] != ']' { + return nil, fmt.Errorf("invalid JSON array: %s", raw) + } + + content := raw[1 : len(raw)-1] + + if !first { + buf.WriteByte(',') + } + buf.Write(content) + first = false + } + buf.WriteByte(']') + + combinedJSON := buf.Bytes() + if !json.Valid(combinedJSON) { + return nil, errors.New("combined JSON is invalid") + } + + return json.RawMessage(combinedJSON), nil +} + // generateKeystore generate keystore file from private key func generateKeystore(_ *codec.Codec) *cobra.Command { cmd := &cobra.Command{ @@ -324,23 +522,6 @@ func generateValidatorKey(cdc *codec.Codec) *cobra.Command { return client.GetCommands(cmd)[0] } -// -// Internal functions -// - -func writeGenesisFile(genesisFile, chainID string, appState json.RawMessage) error { - genDoc := tmTypes.GenesisDoc{ - ChainID: chainID, - AppState: appState, - } - - if err := genDoc.ValidateAndComplete(); err != nil { - return err - } - - return genDoc.SaveAs(genesisFile) -} - // keyFileName implements the naming convention for keyfiles: // UTC---
func keyFileName(keyAddr ethCommon.Address) string { diff --git a/cmd/heimdallcli/main_test.go b/cmd/heimdallcli/main_test.go new file mode 100644 index 000000000..347338cba --- /dev/null +++ b/cmd/heimdallcli/main_test.go @@ -0,0 +1,116 @@ +package main + +import ( + "bytes" + "encoding/json" + "fmt" + "os" + "strconv" + "strings" + "testing" + + heimdallApp "github.com/maticnetwork/heimdall/app" + "github.com/stretchr/testify/require" + abci "github.com/tendermint/tendermint/abci/types" + "github.com/tendermint/tendermint/libs/log" + tmTypes "github.com/tendermint/tendermint/types" + dbm "github.com/tendermint/tm-db" +) + +func TestModulesStreamedGenesisExport(t *testing.T) { + t.Parallel() + + logger := log.NewTMLogger(log.NewSyncWriter(os.Stdout)) + db := dbm.NewMemDB() + + happ := heimdallApp.NewHeimdallApp(logger, db) + + genDoc, err := tmTypes.GenesisDocFromFile("./testdata/dump-genesis.json") + require.NoError(t, err) + + var genesisState heimdallApp.GenesisState + err = json.Unmarshal(genDoc.AppState, &genesisState) + require.NoError(t, err) + + ctx := happ.NewContext(true, abci.Header{Height: 1}) + happ.GetModuleManager().InitGenesis(ctx, genesisState) + + var buf bytes.Buffer + + err = generateMarshalledAppState(happ, "test-chain", 2, &buf) + require.NoError(t, err) + + marshaledAppState := buf.Bytes() + + var unmarshaledAppState map[string]interface{} + err = json.Unmarshal(marshaledAppState, &unmarshaledAppState) + require.NoError(t, err) + + appState, ok := unmarshaledAppState["app_state"].(map[string]interface{}) + require.True(t, ok, "app_state should be a map") + + clerk, err := traversePath(appState, "clerk") + require.NoError(t, err) + + eventRecords, ok := clerk["event_records"].([]interface{}) + require.True(t, ok, "event_records should be an array") + require.Len(t, eventRecords, 6) + for idx, record := range eventRecords { + eventRecord, ok := record.(map[string]interface{}) + require.True(t, ok, "eventRecord should be a map") + require.NotEmpty(t, eventRecord["id"]) + eventIDStr, ok := eventRecord["id"].(string) + require.True(t, ok, "id should be a string") + eventID, err := strconv.Atoi(eventIDStr) + require.NoError(t, err) + require.Equal(t, idx+1, eventID) + require.NotEmpty(t, eventRecord["contract"]) + require.NotEmpty(t, eventRecord["data"]) + require.NotEmpty(t, eventRecord["tx_hash"]) + require.NotEmpty(t, eventRecord["log_index"]) + require.NotEmpty(t, eventRecord["bor_chain_id"]) + require.NotEmpty(t, eventRecord["record_time"]) + } + + bor, err := traversePath(appState, "bor") + require.NoError(t, err) + + spans, ok := bor["spans"].([]interface{}) + require.True(t, ok, "spans should be an array") + require.Len(t, spans, 5) + for idx, span := range spans { + spanMap, ok := span.(map[string]interface{}) + require.True(t, ok, "span should be a map") + require.NotEmpty(t, spanMap["span_id"]) + spanIDStr, ok := spanMap["span_id"].(string) + require.True(t, ok, "span_id should be a string") + spanID, err := strconv.Atoi(spanIDStr) + require.NoError(t, err) + require.Equal(t, idx, spanID) + require.NotEmpty(t, spanMap["start_block"]) + require.NotEmpty(t, spanMap["end_block"]) + require.NotEmpty(t, spanMap["validator_set"]) + require.NotEmpty(t, spanMap["selected_producers"]) + require.NotEmpty(t, spanMap["bor_chain_id"]) + } +} + +// traversePath traverses the path in the data map. +func traversePath(data map[string]interface{}, path string) (map[string]interface{}, error) { + if path == "." { + return data, nil + } + + keys := strings.Split(path, ".") + current := data + + for _, key := range keys { + if next, ok := current[key].(map[string]interface{}); ok { + current = next + continue + } + return nil, fmt.Errorf("invalid path: %s", path) + } + + return current, nil +} diff --git a/cmd/heimdallcli/testdata/dump-genesis.json b/cmd/heimdallcli/testdata/dump-genesis.json new file mode 100644 index 000000000..4a8a377de --- /dev/null +++ b/cmd/heimdallcli/testdata/dump-genesis.json @@ -0,0 +1,1505 @@ +{ + "genesis_time": "2024-09-13T08:54:11.342700084Z", + "chain_id": "heimdall-sCCAH4", + "consensus_params": { + "block": { + "max_bytes": "22020096", + "max_gas": "-1", + "time_iota_ms": "1000" + }, + "evidence": { + "max_age": "100000" + }, + "validator": { + "pub_key_types": [ + "secp256k1" + ] + } + }, + "app_hash": "", + "app_state": { + "auth": { + "params": { + "max_memo_characters": "256", + "tx_sig_limit": "7", + "tx_size_cost_per_byte": "10", + "sig_verify_cost_ed25519": "590", + "sig_verify_cost_secp256k1": "1000", + "max_tx_gas": "1000000", + "tx_fees": "1000000000000000" + }, + "accounts": [ + { + "address": "0xf1829676db577682e944fc3493d451b67ff3e29f", + "coins": [], + "sequence_number": "0", + "account_number": "0", + "module_name": "fee_collector", + "module_permissions": null + }, + { + "address": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "coins": [ + { + "denom": "matic", + "amount": "1000000000000000000000" + } + ], + "sequence_number": "1209", + "account_number": "1", + "module_name": "", + "module_permissions": null + }, + { + "address": "0xfa7c0bb8762f56b63de6c9b7567ea7ca2cb70358", + "coins": [ + { + "denom": "matic", + "amount": "1000000000000000000000" + } + ], + "sequence_number": "0", + "account_number": "2", + "module_name": "", + "module_permissions": null + }, + { + "address": "0x7b5fe22b5446f7c62ea27b8bd71cef94e03f3df2", + "coins": [], + "sequence_number": "0", + "account_number": "3", + "module_name": "gov", + "module_permissions": null + } + ] + }, + "bank": { + "send_enabled": true + }, + "bor": { + "params": { + "sprint_duration": "64", + "span_duration": "6400", + "producer_count": "4" + }, + "spans": [ + { + "span_id": "0", + "start_block": "0", + "end_block": "255", + "validator_set": { + "validators": [ + { + "ID": "1", + "startEpoch": "0", + "endEpoch": "0", + "nonce": "1", + "power": "10000", + "pubKey": "0x04ce399432e38fb729fa1b512d5917454adb7c404e8252b339c5b124f20e55a9bee56dde0b0e8130daff5193b8cab0df55392783062751a6942c561bca9b44486a", + "signer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "last_updated": "", + "jailed": false, + "accum": "0" + } + ], + "proposer": { + "ID": "1", + "startEpoch": "0", + "endEpoch": "0", + "nonce": "1", + "power": "10000", + "pubKey": "0x04ce399432e38fb729fa1b512d5917454adb7c404e8252b339c5b124f20e55a9bee56dde0b0e8130daff5193b8cab0df55392783062751a6942c561bca9b44486a", + "signer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "last_updated": "", + "jailed": false, + "accum": "0" + } + }, + "selected_producers": [ + { + "ID": "1", + "startEpoch": "0", + "endEpoch": "0", + "nonce": "1", + "power": "10000", + "pubKey": "0x04ce399432e38fb729fa1b512d5917454adb7c404e8252b339c5b124f20e55a9bee56dde0b0e8130daff5193b8cab0df55392783062751a6942c561bca9b44486a", + "signer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "last_updated": "", + "jailed": false, + "accum": "0" + } + ], + "bor_chain_id": "15005" + }, + { + "span_id": "1", + "start_block": "256", + "end_block": "6655", + "validator_set": { + "validators": [ + { + "ID": "1", + "startEpoch": "0", + "endEpoch": "0", + "nonce": "1", + "power": "10000", + "pubKey": "0x04ce399432e38fb729fa1b512d5917454adb7c404e8252b339c5b124f20e55a9bee56dde0b0e8130daff5193b8cab0df55392783062751a6942c561bca9b44486a", + "signer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "last_updated": "", + "jailed": false, + "accum": "0" + } + ], + "proposer": { + "ID": "1", + "startEpoch": "0", + "endEpoch": "0", + "nonce": "1", + "power": "10000", + "pubKey": "0x04ce399432e38fb729fa1b512d5917454adb7c404e8252b339c5b124f20e55a9bee56dde0b0e8130daff5193b8cab0df55392783062751a6942c561bca9b44486a", + "signer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "last_updated": "", + "jailed": false, + "accum": "0" + } + }, + "selected_producers": [ + { + "ID": "1", + "startEpoch": "0", + "endEpoch": "0", + "nonce": "1", + "power": "10000", + "pubKey": "0x04ce399432e38fb729fa1b512d5917454adb7c404e8252b339c5b124f20e55a9bee56dde0b0e8130daff5193b8cab0df55392783062751a6942c561bca9b44486a", + "signer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "last_updated": "", + "jailed": false, + "accum": "0" + } + ], + "bor_chain_id": "15005" + }, + { + "span_id": "2", + "start_block": "6656", + "end_block": "13055", + "validator_set": { + "validators": [ + { + "ID": "1", + "startEpoch": "0", + "endEpoch": "0", + "nonce": "1", + "power": "10000", + "pubKey": "0x04ce399432e38fb729fa1b512d5917454adb7c404e8252b339c5b124f20e55a9bee56dde0b0e8130daff5193b8cab0df55392783062751a6942c561bca9b44486a", + "signer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "last_updated": "", + "jailed": false, + "accum": "0" + } + ], + "proposer": { + "ID": "1", + "startEpoch": "0", + "endEpoch": "0", + "nonce": "1", + "power": "10000", + "pubKey": "0x04ce399432e38fb729fa1b512d5917454adb7c404e8252b339c5b124f20e55a9bee56dde0b0e8130daff5193b8cab0df55392783062751a6942c561bca9b44486a", + "signer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "last_updated": "", + "jailed": false, + "accum": "0" + } + }, + "selected_producers": [ + { + "ID": "1", + "startEpoch": "0", + "endEpoch": "0", + "nonce": "1", + "power": "10000", + "pubKey": "0x04ce399432e38fb729fa1b512d5917454adb7c404e8252b339c5b124f20e55a9bee56dde0b0e8130daff5193b8cab0df55392783062751a6942c561bca9b44486a", + "signer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "last_updated": "", + "jailed": false, + "accum": "0" + } + ], + "bor_chain_id": "15005" + }, + { + "span_id": "3", + "start_block": "13056", + "end_block": "19455", + "validator_set": { + "validators": [ + { + "ID": "1", + "startEpoch": "0", + "endEpoch": "0", + "nonce": "1", + "power": "10000", + "pubKey": "0x04ce399432e38fb729fa1b512d5917454adb7c404e8252b339c5b124f20e55a9bee56dde0b0e8130daff5193b8cab0df55392783062751a6942c561bca9b44486a", + "signer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "last_updated": "", + "jailed": false, + "accum": "0" + } + ], + "proposer": { + "ID": "1", + "startEpoch": "0", + "endEpoch": "0", + "nonce": "1", + "power": "10000", + "pubKey": "0x04ce399432e38fb729fa1b512d5917454adb7c404e8252b339c5b124f20e55a9bee56dde0b0e8130daff5193b8cab0df55392783062751a6942c561bca9b44486a", + "signer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "last_updated": "", + "jailed": false, + "accum": "0" + } + }, + "selected_producers": [ + { + "ID": "1", + "startEpoch": "0", + "endEpoch": "0", + "nonce": "1", + "power": "10000", + "pubKey": "0x04ce399432e38fb729fa1b512d5917454adb7c404e8252b339c5b124f20e55a9bee56dde0b0e8130daff5193b8cab0df55392783062751a6942c561bca9b44486a", + "signer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "last_updated": "", + "jailed": false, + "accum": "0" + } + ], + "bor_chain_id": "15005" + }, + { + "span_id": "4", + "start_block": "19456", + "end_block": "25855", + "validator_set": { + "validators": [ + { + "ID": "1", + "startEpoch": "0", + "endEpoch": "0", + "nonce": "1", + "power": "10000", + "pubKey": "0x04ce399432e38fb729fa1b512d5917454adb7c404e8252b339c5b124f20e55a9bee56dde0b0e8130daff5193b8cab0df55392783062751a6942c561bca9b44486a", + "signer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "last_updated": "", + "jailed": false, + "accum": "0" + } + ], + "proposer": { + "ID": "1", + "startEpoch": "0", + "endEpoch": "0", + "nonce": "1", + "power": "10000", + "pubKey": "0x04ce399432e38fb729fa1b512d5917454adb7c404e8252b339c5b124f20e55a9bee56dde0b0e8130daff5193b8cab0df55392783062751a6942c561bca9b44486a", + "signer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "last_updated": "", + "jailed": false, + "accum": "0" + } + }, + "selected_producers": [ + { + "ID": "1", + "startEpoch": "0", + "endEpoch": "0", + "nonce": "1", + "power": "10000", + "pubKey": "0x04ce399432e38fb729fa1b512d5917454adb7c404e8252b339c5b124f20e55a9bee56dde0b0e8130daff5193b8cab0df55392783062751a6942c561bca9b44486a", + "signer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "last_updated": "", + "jailed": false, + "accum": "0" + } + ], + "bor_chain_id": "15005" + } + ] + }, + "chainmanager": { + "params": { + "mainchain_tx_confirmations": "6", + "maticchain_tx_confirmations": "10", + "chain_params": { + "bor_chain_id": "15005", + "matic_token_address": "0x675c1bd77f573aaf2df04ee7180a21a110d3d4fa", + "staking_manager_address": "0xe8f5a17fba3b9294961aa0ab965eabad9a45ff1b", + "slash_manager_address": "0x0000000000000000000000000000000000000000", + "root_chain_address": "0xa1a6f9ff932eba930db4a638e06ae0ae3c8fa2d1", + "staking_info_address": "0xeebd8a7b10c1877aaa02c4d5a50629b8cc22e73f", + "state_sender_address": "0x3463e6b634e4d358b6c7212de3b1527b95bbc90c", + "state_receiver_address": "0x0000000000000000000000000000000000001001", + "validator_set_address": "0x0000000000000000000000000000000000001000" + } + } + }, + "checkpoint": { + "params": { + "checkpoint_buffer_time": "1000000000000", + "avg_checkpoint_length": "256", + "max_checkpoint_length": "1024", + "child_chain_block_interval": "10000" + }, + "buffered_checkpoint": null, + "last_no_ack": "0", + "ack_count": "68", + "checkpoints": [ + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "0", + "end_block": "6", + "root_hash": "0x0bfaabfaf896bbc603cb71c899da6e2f53b6705afaeaae1d024876328659bf68", + "bor_chain_id": "15005", + "timestamp": "1726150007" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "7", + "end_block": "262", + "root_hash": "0x3f890195e791c7e90a58aec77e009f2e8baf349d71e8dc8bab66d5f75c37010c", + "bor_chain_id": "15005", + "timestamp": "1726150549" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "263", + "end_block": "518", + "root_hash": "0xff164d8dc5cff48b6cf2d3d816f5543ef4f031323123cbf4e1f676a4f745272f", + "bor_chain_id": "15005", + "timestamp": "1726151091" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "519", + "end_block": "774", + "root_hash": "0xaca5dc9d4b7f2a231cef6840489076587c24037f741455bbbd2bbd05b632c7ad", + "bor_chain_id": "15005", + "timestamp": "1726151567" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "775", + "end_block": "1030", + "root_hash": "0xdcc7a23f0689f9ce6a6a3c77faeb82d534c426a950f3cde2837bae48e793585a", + "bor_chain_id": "15005", + "timestamp": "1726152109" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "1031", + "end_block": "1286", + "root_hash": "0x93f032de774e671e60692fa51376a044f236be68683e838510ce11f953f4880c", + "bor_chain_id": "15005", + "timestamp": "1726152591" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "1287", + "end_block": "1542", + "root_hash": "0xe6c9907bdd3ad402e44150b048f3e48785bce836b142d978918a5058465c7b80", + "bor_chain_id": "15005", + "timestamp": "1726153127" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "1543", + "end_block": "1798", + "root_hash": "0x253bc2d06e731cf3fb275b5d426127dbbdd8f4d9901cf72f46eaec8691ce8b2e", + "bor_chain_id": "15005", + "timestamp": "1726153609" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "1799", + "end_block": "2054", + "root_hash": "0xc6c326dd36181fe8775d8338506b53f1b91cc208b50f333c45550c3271696e40", + "bor_chain_id": "15005", + "timestamp": "1726154151" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "2055", + "end_block": "2310", + "root_hash": "0x5313b4b2cf11a891203d67e979327d7b0ea19ab17f6d2e52ab19a442f550691b", + "bor_chain_id": "15005", + "timestamp": "1726155542" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "2311", + "end_block": "2560", + "root_hash": "0x4c3f9b02ae705b58aa014cadb307677712634d2e426ff3c9d391746c767406a0", + "bor_chain_id": "15005", + "timestamp": "1726158762" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "2561", + "end_block": "2747", + "root_hash": "0x08b6a9f3cad5c700c91cd8c926a139d9a75262eff8b3c6d985efaf804f9dc6c5", + "bor_chain_id": "15005", + "timestamp": "1726162761" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "2748", + "end_block": "2871", + "root_hash": "0x3eee182d1207b4c954c51d9513d2420fe806e411a75ea2470e9c927c1363414a", + "bor_chain_id": "15005", + "timestamp": "1726165976" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "2872", + "end_block": "3127", + "root_hash": "0x846aa0e25b4b1263b05601ca872e7178ea195a7621ade621e17122e526571531", + "bor_chain_id": "15005", + "timestamp": "1726167954" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "3128", + "end_block": "3383", + "root_hash": "0xdd0c3fd4c596043b5ac66aa168b6345484870b8b8049058ab51530894eafead6", + "bor_chain_id": "15005", + "timestamp": "1726168436" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "3384", + "end_block": "3639", + "root_hash": "0xa8ed6d16af51d69f62cde0115537ee9bd9cb4bb641c02920c7bae7669c8d123e", + "bor_chain_id": "15005", + "timestamp": "1726168973" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "3640", + "end_block": "3895", + "root_hash": "0x06b50d85d3a1d650e38f1f0f3d6212d5d65d4cfd95ae5b020df70895c0b9c143", + "bor_chain_id": "15005", + "timestamp": "1726170433" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "3896", + "end_block": "4076", + "root_hash": "0x7d3e6d31a681e23eba264e2e28c958ab2efbb1586c5c5162c4c950b157700eb6", + "bor_chain_id": "15005", + "timestamp": "1726173825" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "4077", + "end_block": "4332", + "root_hash": "0x9c2b39e2086f103c1a3f6e31f5f2aa16dec858fb00849aa8d429f2d74e3299e1", + "bor_chain_id": "15005", + "timestamp": "1726174306" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "4333", + "end_block": "4588", + "root_hash": "0x80ce79f811936dc7087555ba19c357d86c126c90cab3116619566ddff93629e2", + "bor_chain_id": "15005", + "timestamp": "1726174788" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "4589", + "end_block": "4844", + "root_hash": "0xf6441832306f535e6dd2fddd9dbaf7575325829d553a753e0686960d01d8006b", + "bor_chain_id": "15005", + "timestamp": "1726175325" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "4845", + "end_block": "5100", + "root_hash": "0x5c0416ce4d672e8b7b3e8960dad258c1374def88992cf1d92ae869167fe97542", + "bor_chain_id": "15005", + "timestamp": "1726175867" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "5101", + "end_block": "5356", + "root_hash": "0x043719ef459143cbdcae0423fdb07b5ac383342425f5b30c6c2bc771380c25f7", + "bor_chain_id": "15005", + "timestamp": "1726176344" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "5357", + "end_block": "5612", + "root_hash": "0x3a0868f4aca406403df8c79aef951f6f25f95236f712915d39c7bf9ad08c3cfe", + "bor_chain_id": "15005", + "timestamp": "1726176886" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "5613", + "end_block": "5868", + "root_hash": "0xa7d1aaace0858722a7eaa50727fb6ae4473fb0e8defc99323df75881c3441dd8", + "bor_chain_id": "15005", + "timestamp": "1726177368" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "5869", + "end_block": "6002", + "root_hash": "0x3fbf6a7ee0ab77c71c83bbf582f0f782d2e6797040aa95aecfefadfe81695684", + "bor_chain_id": "15005", + "timestamp": "1726180706" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "6003", + "end_block": "6156", + "root_hash": "0xf90d2701f01c376298f24214e32e4b3992159035015d64ebec3c0460a6ad9a49", + "bor_chain_id": "15005", + "timestamp": "1726182821" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "6157", + "end_block": "6278", + "root_hash": "0x4c463771b654a05e143c56716ef51223ad4a9c4ab3b6bdfa77d0b685b8cad710", + "bor_chain_id": "15005", + "timestamp": "1726184969" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "6279", + "end_block": "6401", + "root_hash": "0xa0f952240fb23079cd45e53b782c4db61e1721fda8dbffe00ba68bc8f3f91053", + "bor_chain_id": "15005", + "timestamp": "1726188154" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "6402", + "end_block": "6555", + "root_hash": "0xfd0291535adafc9ad5bf9a2e9ee5bee04cad3856a6a9488dce35d098d963877b", + "bor_chain_id": "15005", + "timestamp": "1726190410" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "6556", + "end_block": "6707", + "root_hash": "0xc7c582d6803c555c53412f28e2ab819b05bb9a2f27e8d902659f5db7b559f839", + "bor_chain_id": "15005", + "timestamp": "1726192715" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "6708", + "end_block": "6860", + "root_hash": "0x22c16ebe1364e19bfbf720c13a0900941c1396612995fbccc742412d629083d4", + "bor_chain_id": "15005", + "timestamp": "1726194890" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "6861", + "end_block": "6982", + "root_hash": "0xc86e2567393a131fbec1627a6fe1d40d00c04bccdb36bd54fdaebeb6facfa884", + "bor_chain_id": "15005", + "timestamp": "1726197147" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "6983", + "end_block": "7238", + "root_hash": "0x853e821681676aad75ae22c925c1bbbcc913d804f6fd382f19d3167f1d318a99", + "bor_chain_id": "15005", + "timestamp": "1726198082" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "7239", + "end_block": "7494", + "root_hash": "0xdabc6f39a5ac7301bb4c786e76dab5327375f1a12ee65288c4899c8c18401e9b", + "bor_chain_id": "15005", + "timestamp": "1726198652" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "7495", + "end_block": "7750", + "root_hash": "0xed0fcd9fed645b2292eedf2a2fad6fdcbe0d2e4caa119a5416e16ec1c14e4650", + "bor_chain_id": "15005", + "timestamp": "1726199559" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "7751", + "end_block": "8006", + "root_hash": "0xbca60301ad7f4cfb302b9628053a137be82d9c0dc8f70b2b7ca0e56ded044bcd", + "bor_chain_id": "15005", + "timestamp": "1726200548" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "8007", + "end_block": "8262", + "root_hash": "0x231de8681896a900d79a3fd56e283046a391cebb2fbe3a88f22e454aa60e61fe", + "bor_chain_id": "15005", + "timestamp": "1726201629" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "8263", + "end_block": "8518", + "root_hash": "0xedc1db12d438294cbf8daa4cce0ebdcb222953a80fd149f3d2f48bccb368e3b6", + "bor_chain_id": "15005", + "timestamp": "1726202497" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "8519", + "end_block": "8774", + "root_hash": "0x246e34a74d02d8615c770caec512ed3b0ea42f408d387fc56be268e563e51923", + "bor_chain_id": "15005", + "timestamp": "1726203209" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "8775", + "end_block": "9030", + "root_hash": "0xc1a011c3e40b4f7be95b6d0bdb272b871a92c98763de122f74930c186a42b53c", + "bor_chain_id": "15005", + "timestamp": "1726203685" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "9031", + "end_block": "9286", + "root_hash": "0xeecf167b58bbe9b2cd9f437566e1349292f3e1d279f644acb655a872daa53118", + "bor_chain_id": "15005", + "timestamp": "1726204227" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "9287", + "end_block": "9542", + "root_hash": "0x1ddef7a1c04a73031812cf4f082c851289822d8f1badcc373d751a199fb46401", + "bor_chain_id": "15005", + "timestamp": "1726204708" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "9543", + "end_block": "9798", + "root_hash": "0xd255ee3c3255c6c8b19c422c0bbeadda64d2d4db4c3134e63807b7ad7b31f1d6", + "bor_chain_id": "15005", + "timestamp": "1726205245" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "9799", + "end_block": "10054", + "root_hash": "0x91aae9c255b7dcf47a2cd02c8a174a42ee4b74190a46617ffc53e083e1e6cb25", + "bor_chain_id": "15005", + "timestamp": "1726205727" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "10055", + "end_block": "10310", + "root_hash": "0x0d8debcaf30f55f8606c37c1750a1694b32cbf590511721252264f90249c6a45", + "bor_chain_id": "15005", + "timestamp": "1726206264" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "10311", + "end_block": "10566", + "root_hash": "0x27548ab291f3018708275b74d104e8ea05d6680eadd4a01033161fae8c82fd20", + "bor_chain_id": "15005", + "timestamp": "1726206745" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "10567", + "end_block": "10822", + "root_hash": "0xdb4c37822d3241e3b52896a140c49a5e30dc3fc59663edcc461749b88085cefc", + "bor_chain_id": "15005", + "timestamp": "1726207287" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "10823", + "end_block": "11078", + "root_hash": "0xbe88b389d373f397e44c99cdf1b4fe7917e8c0643e2968445e00cdf0531c14c9", + "bor_chain_id": "15005", + "timestamp": "1726207764" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "11079", + "end_block": "11334", + "root_hash": "0xf12514f97a5171d43d7def795579365f71048f36594edd4eb1fa03fff6f96e70", + "bor_chain_id": "15005", + "timestamp": "1726208305" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "11335", + "end_block": "11590", + "root_hash": "0xaac51751e1d8063e418edbbc0946559f32fe541b365d25b746c551f57db156d5", + "bor_chain_id": "15005", + "timestamp": "1726208787" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "11591", + "end_block": "11846", + "root_hash": "0x2480e729958e497b0f29e9de58616d01fe18237751810245785523e3d36c4c15", + "bor_chain_id": "15005", + "timestamp": "1726209324" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "11847", + "end_block": "12102", + "root_hash": "0xf902736f92be282d7da212cc1de8ab97a556339af83b3a95feaaa7220d3a4c9d", + "bor_chain_id": "15005", + "timestamp": "1726209805" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "12103", + "end_block": "12358", + "root_hash": "0xc5adc67fd5ffc7f406845c7dfd8f152ff4491d08a91a4117fbaf224248cf6be7", + "bor_chain_id": "15005", + "timestamp": "1726210347" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "12359", + "end_block": "12614", + "root_hash": "0xfe156cb1275b46ef802dd74a1ff5d5087c65f96aa07723c95a19cf5cb02e1e47", + "bor_chain_id": "15005", + "timestamp": "1726210884" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "12615", + "end_block": "12870", + "root_hash": "0x01e87baca601a5798db25d76c4ba96d4b85e800f18ea5927e7e8b2fc97e7bcbb", + "bor_chain_id": "15005", + "timestamp": "1726211366" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "12871", + "end_block": "13126", + "root_hash": "0xe1bb496d6d5e9c33694007b408f77fe01cc2539a31f9a9feced25ddb97cbed79", + "bor_chain_id": "15005", + "timestamp": "1726211908" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "13127", + "end_block": "13382", + "root_hash": "0xeba25bd97c4ae0b1b7d045b701654f504805dd5a22c883f7082a009372881404", + "bor_chain_id": "15005", + "timestamp": "1726212385" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "13383", + "end_block": "13638", + "root_hash": "0xa1aedcd204863199d531a35803dc50c0e243d31601cc1fe4195db2694c8eb9b2", + "bor_chain_id": "15005", + "timestamp": "1726212927" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "13639", + "end_block": "13894", + "root_hash": "0x23d505eca4f8af1c6e71cb9b15464ad8b3e8f5533eecf7047387377e9b548dc0", + "bor_chain_id": "15005", + "timestamp": "1726213408" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "13895", + "end_block": "14150", + "root_hash": "0x446c380d7be02c2cbbb03afd37001f9884c59e97543e2246d0922734ca1c1ab9", + "bor_chain_id": "15005", + "timestamp": "1726213945" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "14151", + "end_block": "14406", + "root_hash": "0x7b4cd37fa4864badd5c553d0d50e1f6a4e598dca19bf78650accea569431f9db", + "bor_chain_id": "15005", + "timestamp": "1726214427" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "14407", + "end_block": "14662", + "root_hash": "0xcaec95b10a84191d1e7d4ca9385253b8135050ca00fec02f4b5441cee396f832", + "bor_chain_id": "15005", + "timestamp": "1726214964" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "14663", + "end_block": "14918", + "root_hash": "0x4101e5dab5d1fe8d13aff59e8823ecb97e3c77f5a18d626a1c129bb92f3ce5dd", + "bor_chain_id": "15005", + "timestamp": "1726215445" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "14919", + "end_block": "15174", + "root_hash": "0x64eec5410c453a1819b1a83cbe14c7d95a9ad9b61ea29900527fa77dd7d51490", + "bor_chain_id": "15005", + "timestamp": "1726215987" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "15175", + "end_block": "15430", + "root_hash": "0x5c8feada6d11ed5417038a28b476a0ee846b6e04b15eae2cdad85878686378bb", + "bor_chain_id": "15005", + "timestamp": "1726216464" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "15431", + "end_block": "15686", + "root_hash": "0x0bfd4b5b0fb43030d9eb1d355b455a8dcdbd39f8b681acf661911bc2b1d37bee", + "bor_chain_id": "15005", + "timestamp": "1726217006" + }, + { + "proposer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "start_block": "15687", + "end_block": "15942", + "root_hash": "0xb477dc95843371b57e2949a0aac843efd6548b66f2197010cefef73cfd9141c1", + "bor_chain_id": "15005", + "timestamp": "1726217488" + } + ] + }, + "clerk": { + "event_records": [ + { + "id": "1", + "contract": "0x86361bdecf438ca346ceeca8a74314cca902b7c1", + "data": "0x0000000000000000000000001534f22900cb7fc09019a3dba9b1ee731e10029b000000000000000000000000594107b6808c8919b5598b8c3c8048da4b26b0ac0000000000000000000000000000000000000000000000056bc75e2d6310000000000000000000000000000000000000000000000000000000000000000900b1", + "tx_hash": "0x9936c4d75a00121387273b1dda0ed42356a0055e81346505b997c7651dd17c22", + "log_index": "2", + "bor_chain_id": "15005", + "record_time": "2024-09-13T07:37:37.502805347Z" + }, + { + "id": "2", + "contract": "0x86361bdecf438ca346ceeca8a74314cca902b7c1", + "data": "0x0000000000000000000000001534f22900cb7fc09019a3dba9b1ee731e10029b000000000000000000000000594107b6808c8919b5598b8c3c8048da4b26b0ac0000000000000000000000000000000000000000000000056bc75e2d6310000000000000000000000000000000000000000000000000000000000000000927c1", + "tx_hash": "0xe9030ee63310c644e9f8c722a0b3e47c307d0bee5783477b690ed488385d3976", + "log_index": "2", + "bor_chain_id": "15005", + "record_time": "2024-09-13T07:47:34.59891947Z" + }, + { + "id": "3", + "contract": "0x86361bdecf438ca346ceeca8a74314cca902b7c1", + "data": "0x0000000000000000000000001534f22900cb7fc09019a3dba9b1ee731e10029b000000000000000000000000594107b6808c8919b5598b8c3c8048da4b26b0ac0000000000000000000000000000000000000000000000056bc75e2d6310000000000000000000000000000000000000000000000000000000000000000900b1", + "tx_hash": "0x9936c4d75a00121387273b1dda0ed42356a0055e81346505b997c7651dd17c22", + "log_index": "2", + "bor_chain_id": "15005", + "record_time": "2024-09-13T07:37:37.502805347Z" + }, + { + "id": "4", + "contract": "0x86361bdecf438ca346ceeca8a74314cca902b7c1", + "data": "0x0000000000000000000000001534f22900cb7fc09019a3dba9b1ee731e10029b000000000000000000000000594107b6808c8919b5598b8c3c8048da4b26b0ac0000000000000000000000000000000000000000000000056bc75e2d6310000000000000000000000000000000000000000000000000000000000000000927c1", + "tx_hash": "0xe9030ee63310c644e9f8c722a0b3e47c307d0bee5783477b690ed488385d3976", + "log_index": "2", + "bor_chain_id": "15005", + "record_time": "2024-09-13T07:47:34.59891947Z" + }, + { + "id": "5", + "contract": "0x86361bdecf438ca346ceeca8a74314cca902b7c1", + "data": "0x0000000000000000000000001534f22900cb7fc09019a3dba9b1ee731e10029b000000000000000000000000594107b6808c8919b5598b8c3c8048da4b26b0ac0000000000000000000000000000000000000000000000056bc75e2d6310000000000000000000000000000000000000000000000000000000000000000900b1", + "tx_hash": "0x9936c4d75a00121387273b1dda0ed42356a0055e81346505b997c7651dd17c22", + "log_index": "2", + "bor_chain_id": "15005", + "record_time": "2024-09-13T07:37:37.502805347Z" + }, + { + "id": "6", + "contract": "0x86361bdecf438ca346ceeca8a74314cca902b7c1", + "data": "0x0000000000000000000000001534f22900cb7fc09019a3dba9b1ee731e10029b000000000000000000000000594107b6808c8919b5598b8c3c8048da4b26b0ac0000000000000000000000000000000000000000000000056bc75e2d6310000000000000000000000000000000000000000000000000000000000000000927c1", + "tx_hash": "0xe9030ee63310c644e9f8c722a0b3e47c307d0bee5783477b690ed488385d3976", + "log_index": "2", + "bor_chain_id": "15005", + "record_time": "2024-09-13T07:47:34.59891947Z" + } + ], + "record_sequences": [ + "2765600002", + "2822900002" + ] + }, + "gov": { + "deposit_params": { + "max_deposit_period": "3600000000000", + "min_deposit": [ + { + "amount": "100000000000000000000", + "denom": "matic" + } + ] + }, + "deposits": null, + "proposals": [ + { + "content": { + "type": "heimdall/ParameterChangeProposal", + "value": { + "changes": [ + { + "key": "MaxCheckpointLength", + "subspace": "checkpoint", + "value": "\"8192\"" + } + ], + "description": "Update max checkpoint length", + "title": "Checkpoint Param Change" + } + }, + "deposit_end_time": "2020-06-08T10:50:51.9330392Z", + "final_tally_result": { + "abstain": "0", + "no": "0", + "no_with_veto": "0", + "yes": "74498" + }, + "id": "1", + "proposal_status": "Passed", + "submit_time": "2020-06-08T09:50:51.9330392Z", + "total_deposit": [ + { + "amount": "100000000000000000000", + "denom": "matic" + } + ], + "voting_end_time": "2020-06-08T10:50:51.9330392Z", + "voting_start_time": "2020-06-08T09:50:51.9330392Z" + }, + { + "content": { + "type": "heimdall/ParameterChangeProposal", + "value": { + "changes": [ + { + "key": "ChainParams", + "subspace": "chainmanager", + "value": "{\n\t\t\t\t\"bor_chain_id\": \"137\",\n\t\t\t\t\"matic_token_address\": \"0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0\",\n\t\t\t\t\"staking_manager_address\": \"0x5e3Ef299fDDf15eAa0432E6e66473ace8c13D908\",\n\t\t\t\t\"slash_manager_address\": \"0x01F645DcD6C796F6BC6C982159B32fAaaebdC96A\",\n\t\t\t\t\"root_chain_address\": \"0x86e4dc95c7fbdbf52e33d563bbdb00823894c287\",\n\t\t\t\t\"staking_info_address\": \"0xa59C847Bd5aC0172Ff4FE912C5d29E5A71A7512B\",\n\t\t\t\t\"state_sender_address\": \"0x28e4f3a7f651294b9564800b2d01f35189a5bfbe\",\n\t\t\t\t\"state_receiver_address\": \"0x0000000000000000000000000000000000001001\",\n\t\t\t\t\"validator_set_address\": \"0x0000000000000000000000000000000000001000\"\n\t\t\t}" + } + ], + "description": "Update contract address", + "title": "Contract address Param Change" + } + }, + "deposit_end_time": "2020-06-26T18:29:00.222943587Z", + "final_tally_result": { + "abstain": "0", + "no": "0", + "no_with_veto": "0", + "yes": "74498" + }, + "id": "2", + "proposal_status": "Passed", + "submit_time": "2020-06-26T17:29:00.222943587Z", + "total_deposit": [ + { + "amount": "100000000000000000000", + "denom": "matic" + } + ], + "voting_end_time": "2020-06-26T18:29:00.222943587Z", + "voting_start_time": "2020-06-26T17:29:00.222943587Z" + }, + { + "content": { + "type": "heimdall/ParameterChangeProposal", + "value": { + "changes": [ + { + "key": "ProducerCount", + "subspace": "bor", + "value": "\"50\"" + } + ], + "description": "Update producer count to 50", + "title": "Producer count param change" + } + }, + "deposit_end_time": "2021-01-24T13:16:39.561190319Z", + "final_tally_result": { + "abstain": "0", + "no": "0", + "no_with_veto": "0", + "yes": "761754330" + }, + "id": "3", + "proposal_status": "Passed", + "submit_time": "2021-01-24T12:16:39.561190319Z", + "total_deposit": [ + { + "amount": "100000000000000000000", + "denom": "matic" + } + ], + "voting_end_time": "2021-01-24T13:16:39.561190319Z", + "voting_start_time": "2021-01-24T12:16:39.561190319Z" + }, + { + "content": { + "type": "heimdall/ParameterChangeProposal", + "value": { + "changes": [ + { + "key": "MaticchainTxConfirmations", + "subspace": "chainmanager", + "value": "\"128\"" + } + ], + "description": "Update matic confirmation blocks for checkpoint", + "title": "Matic confirmation blocks" + } + }, + "deposit_end_time": "2021-04-27T08:57:25.854324037Z", + "final_tally_result": { + "abstain": "0", + "no": "0", + "no_with_veto": "0", + "yes": "856553782" + }, + "id": "4", + "proposal_status": "Passed", + "submit_time": "2021-04-27T07:57:25.854324037Z", + "total_deposit": [ + { + "amount": "100000000000000000000", + "denom": "matic" + } + ], + "voting_end_time": "2021-04-27T08:57:25.854324037Z", + "voting_start_time": "2021-04-27T07:57:25.854324037Z" + }, + { + "content": { + "type": "heimdall/ParameterChangeProposal", + "value": { + "changes": [ + { + "key": "votingparams", + "subspace": "gov", + "value": "{\"voting_period\": \"86400000000000\"}" + }, + { + "key": "MaticchainTxConfirmations", + "subspace": "chainmanager", + "value": "\"512\"" + }, + { + "key": "MainchainTxConfirmations", + "subspace": "chainmanager", + "value": "\"12\"" + } + ], + "description": "Increasing Voting Period to 1 day, Matic Chain Confirmations to 512 and Main Chain Confirmations to 12", + "title": "Increasing Voting Period, Matic and Main Chain Confirmations" + } + }, + "deposit_end_time": "2021-07-26T11:42:06.917997596Z", + "final_tally_result": { + "abstain": "0", + "no": "0", + "no_with_veto": "0", + "yes": "900071124" + }, + "id": "5", + "proposal_status": "Passed", + "submit_time": "2021-07-26T10:42:06.917997596Z", + "total_deposit": [ + { + "amount": "100000000000000000000", + "denom": "matic" + } + ], + "voting_end_time": "2021-07-26T12:08:13.213785088Z", + "voting_start_time": "2021-07-26T11:08:13.213785088Z" + }, + { + "content": { + "type": "heimdall/ParameterChangeProposal", + "value": { + "changes": [ + { + "key": "MaxTxGas", + "subspace": "auth", + "value": "\"5000000\"" + } + ], + "description": "Increasing gas limit to 5M from 1M", + "title": "Increase in gas limit" + } + }, + "deposit_end_time": "2022-01-18T04:49:03.649886245Z", + "final_tally_result": { + "abstain": "0", + "no": "0", + "no_with_veto": "0", + "yes": "1969227255" + }, + "id": "6", + "proposal_status": "Passed", + "submit_time": "2022-01-18T03:49:03.649886245Z", + "total_deposit": [ + { + "amount": "100000000000000000000", + "denom": "matic" + } + ], + "voting_end_time": "2022-01-19T03:49:03.649886245Z", + "voting_start_time": "2022-01-18T03:49:03.649886245Z" + }, + { + "content": { + "type": "heimdall/ParameterChangeProposal", + "value": { + "changes": [ + { + "key": "MaxTxGas", + "subspace": "auth", + "value": "\"1000000\"" + } + ], + "description": "Decreasing gas limit to 1M from 5M", + "title": "Decreasing gas limit back to original" + } + }, + "deposit_end_time": "2022-02-04T14:45:31.818624547Z", + "final_tally_result": { + "abstain": "0", + "no": "0", + "no_with_veto": "0", + "yes": "2021847637" + }, + "id": "7", + "proposal_status": "Passed", + "submit_time": "2022-02-04T13:45:31.818624547Z", + "total_deposit": [ + { + "amount": "100000000000000000000", + "denom": "matic" + } + ], + "voting_end_time": "2022-02-05T13:45:31.818624547Z", + "voting_start_time": "2022-02-04T13:45:31.818624547Z" + }, + { + "content": { + "type": "heimdall/ParameterChangeProposal", + "value": { + "changes": [ + { + "key": "MaxTxGas", + "subspace": "auth", + "value": "\"1000000\"" + } + ], + "description": "Decreasing gas limit to 1M from 5M", + "title": "Decreasing gas limit back to original" + } + }, + "deposit_end_time": "2022-02-04T14:56:53.972067927Z", + "final_tally_result": { + "abstain": "0", + "no": "0", + "no_with_veto": "0", + "yes": "0" + }, + "id": "8", + "proposal_status": "Rejected", + "submit_time": "2022-02-04T13:56:53.972067927Z", + "total_deposit": [ + { + "amount": "100000000000000000000", + "denom": "matic" + } + ], + "voting_end_time": "2022-02-05T13:56:53.972067927Z", + "voting_start_time": "2022-02-04T13:56:53.972067927Z" + }, + { + "content": { + "type": "heimdall/ParameterChangeProposal", + "value": { + "changes": [ + { + "key": "MaxTxGas", + "subspace": "auth", + "value": "\"2500000\"" + } + ], + "description": "Increasing gas limit to 2.5M from 1M", + "title": "Increase in gas limit" + } + }, + "deposit_end_time": "2022-03-12T08:03:04.919248656Z", + "final_tally_result": { + "abstain": "0", + "no": "0", + "no_with_veto": "0", + "yes": "2076095151" + }, + "id": "9", + "proposal_status": "Passed", + "submit_time": "2022-03-12T07:03:04.919248656Z", + "total_deposit": [ + { + "amount": "100000000000000000000", + "denom": "matic" + } + ], + "voting_end_time": "2022-03-13T07:03:04.919248656Z", + "voting_start_time": "2022-03-12T07:03:04.919248656Z" + }, + { + "content": { + "type": "heimdall/ParameterChangeProposal", + "value": { + "changes": [ + { + "key": "MaxTxGas", + "subspace": "auth", + "value": "\"1000000\"" + } + ], + "description": "Decreasing gas limit to 1M from 2.5M", + "title": "Decreasing gas limit back to original" + } + }, + "deposit_end_time": "2022-03-18T18:01:44.349778806Z", + "final_tally_result": { + "abstain": "0", + "no": "0", + "no_with_veto": "0", + "yes": "2082090881" + }, + "id": "10", + "proposal_status": "Passed", + "submit_time": "2022-03-18T17:01:44.349778806Z", + "total_deposit": [ + { + "amount": "100000000000000000000", + "denom": "matic" + } + ], + "voting_end_time": "2022-03-19T17:01:44.349778806Z", + "voting_start_time": "2022-03-18T17:01:44.349778806Z" + }, + { + "content": { + "type": "heimdall/ParameterChangeProposal", + "value": { + "changes": [ + { + "key": "MainchainTxConfirmations", + "subspace": "chainmanager", + "value": "\"64\"" + } + ], + "description": "Increasing MainchainTxConfirmations to 64 from 12. This is for ethereum merge 2.0", + "title": "Increase in MainchainTxConfirmations" + } + }, + "deposit_end_time": "2022-09-07T12:46:14.153661601Z", + "final_tally_result": { + "abstain": "0", + "no": "0", + "no_with_veto": "0", + "yes": "2046488388" + }, + "id": "11", + "proposal_status": "Passed", + "submit_time": "2022-09-07T11:46:14.153661601Z", + "total_deposit": [ + { + "amount": "100000000000000000000", + "denom": "matic" + } + ], + "voting_end_time": "2022-09-08T11:46:14.153661601Z", + "voting_start_time": "2022-09-07T11:46:14.153661601Z" + }, + { + "content": { + "type": "heimdall/ParameterChangeProposal", + "value": { + "changes": [ + { + "key": "SprintDuration", + "subspace": "bor", + "value": "\"16\"" + }, + { + "key": "CheckpointBufferTime", + "subspace": "checkpoint", + "value": "\"1500000000000\"" + } + ], + "description": "Changing values for checkpoint buffer time from 1000 to 1500 sec and sprint length from 64 to 16", + "title": "Changing values for checkpoint buffer time and sprint length" + } + }, + "deposit_end_time": "2023-07-25T13:39:32.465590003Z", + "final_tally_result": { + "abstain": "0", + "no": "0", + "no_with_veto": "0", + "yes": "2076622760" + }, + "id": "12", + "proposal_status": "Passed", + "submit_time": "2023-07-25T12:39:32.465590003Z", + "total_deposit": [ + { + "amount": "100000000000000000000", + "denom": "matic" + } + ], + "voting_end_time": "2023-07-26T12:39:32.465590003Z", + "voting_start_time": "2023-07-25T12:39:32.465590003Z" + } + ], + "starting_proposal_id": "13", + "tally_params": { + "quorum": "0.334000000000000000", + "threshold": "0.500000000000000000", + "veto": "0.334000000000000000" + }, + "votes": null, + "voting_params": { + "voting_period": "86400000000000" + } + }, + "sidechannel": { + "past_commits": [] + }, + "slashing": { + "params": { + "signed_blocks_window": "100", + "min_signed_per_window": "0.500000000000000000", + "downtime_jail_duration": "600000000000", + "slash_fraction_double_sign": "0.050000000000000000", + "slash_fraction_downtime": "0.010000000000000000", + "slash_fraction_limit": "0.333333333333333333", + "jail_fraction_limit": "0.333333333333333333", + "max_evidence_age": "120000000000", + "enable_slashing": false + }, + "signing_infos": { + "1": { + "valID": "1", + "startHeight": "0", + "indexOffset": "0" + } + }, + "missed_blocks": { + "1": [] + }, + "buffer_val_slash_info": null, + "tick_val_slash_info": null, + "tick_count": "0" + }, + "staking": { + "validators": [ + { + "ID": "1", + "startEpoch": "0", + "endEpoch": "0", + "nonce": "1", + "power": "10000", + "pubKey": "0x04ce399432e38fb729fa1b512d5917454adb7c404e8252b339c5b124f20e55a9bee56dde0b0e8130daff5193b8cab0df55392783062751a6942c561bca9b44486a", + "signer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "last_updated": "", + "jailed": false, + "accum": "0" + } + ], + "current_val_set": { + "validators": [ + { + "ID": "1", + "startEpoch": "0", + "endEpoch": "0", + "nonce": "1", + "power": "10000", + "pubKey": "0x04ce399432e38fb729fa1b512d5917454adb7c404e8252b339c5b124f20e55a9bee56dde0b0e8130daff5193b8cab0df55392783062751a6942c561bca9b44486a", + "signer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "last_updated": "", + "jailed": false, + "accum": "0" + } + ], + "proposer": { + "ID": "1", + "startEpoch": "0", + "endEpoch": "0", + "nonce": "1", + "power": "10000", + "pubKey": "0x04ce399432e38fb729fa1b512d5917454adb7c404e8252b339c5b124f20e55a9bee56dde0b0e8130daff5193b8cab0df55392783062751a6942c561bca9b44486a", + "signer": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "last_updated": "", + "jailed": false, + "accum": "0" + } + }, + "staking_sequences": null + }, + "supply": { + "supply": { + "total": [ + { + "denom": "matic", + "amount": "2000000000000000000000" + } + ] + } + }, + "topup": { + "tx_sequences": null, + "dividend_accounts": [ + { + "user": "0x1534f22900cb7fc09019a3dba9b1ee731e10029b", + "feeAmount": "0" + } + ] + } + } + } \ No newline at end of file diff --git a/types/module/module.go b/types/module/module.go index 7bd83cc8b..2c01f113b 100644 --- a/types/module/module.go +++ b/types/module/module.go @@ -3,6 +3,7 @@ package module import ( "encoding/json" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" "github.com/maticnetwork/heimdall/types" ) @@ -20,3 +21,25 @@ type SideModule interface { NewSideTxHandler() types.SideTxHandler NewPostTxHandler() types.PostTxHandler } + +type ModuleGenesisData struct { + // Path specifies the JSON path where the data should be appended. + // For example, "moduleA.data" refers to the "data" array within "moduleA". + Path string + + // Data is the JSON data chunk to be appended. + Data json.RawMessage + + // NextKey is the last key used to append data. + NextKey []byte +} + +// StreamedGenesisExporter defines an interface for modules to export their genesis data incrementally. +type StreamedGenesisExporter interface { + // ExportPartialGenesis returns the partial genesis state of the module, + // the rest of the genesis data will be exported in subsequent calls to NextGenesisData. + ExportPartialGenesis(ctx sdk.Context) (json.RawMessage, error) + // NextGenesisData returns the next chunk of genesis data. + // Returns nil NextKey when no more data is available. + NextGenesisData(ctx sdk.Context, nextKey []byte, max int) (*ModuleGenesisData, error) +}