diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 5871b4753..e56f36393 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -5,7 +5,7 @@ on: workflow_call: inputs: GO_VERSION: - description: 'Go version to use' + description: "Go version to use" type: string required: true @@ -39,7 +39,7 @@ jobs: hadolint: uses: rollkit/.github/.github/workflows/reusable_dockerfile_lint.yml@v0.2.2 # yamllint disable-line rule:line-length with: - dockerfile: docker/mockserv.Dockerfile + dockerfile: test/docker/mockserv.Dockerfile yamllint: runs-on: ubuntu-latest diff --git a/Makefile b/Makefile index 8f6b79122..0dc8c83ab 100644 --- a/Makefile +++ b/Makefile @@ -41,7 +41,7 @@ lint: vet @echo "--> Running markdownlint" @markdownlint --config .markdownlint.yaml '**/*.md' @echo "--> Running hadolint" - @hadolint docker/mockserv.Dockerfile + @hadolint test/docker/mockserv.Dockerfile @echo "--> Running yamllint" @yamllint --no-warnings . -c .yamllint.yml diff --git a/README.md b/README.md index 853ddf000..91d527a5f 100644 --- a/README.md +++ b/README.md @@ -102,7 +102,7 @@ Please join our [Community Discord](https://discord.com/invite/YsnTPcSfWQ) to as ## Dependency Graph To see our progress and a possible future of Rollkit visit our [Dependency -Graph](./docs/specification/rollkit-dependency-graph.md). +Graph](./specs/src/specs/rollkit-dependency-graph.md). ## Code of Conduct diff --git a/block/manager.go b/block/manager.go index 21a9d4fa1..9bd100742 100644 --- a/block/manager.go +++ b/block/manager.go @@ -20,10 +20,10 @@ import ( "github.com/rollkit/rollkit/config" "github.com/rollkit/rollkit/da" - "github.com/rollkit/rollkit/log" "github.com/rollkit/rollkit/mempool" "github.com/rollkit/rollkit/state" "github.com/rollkit/rollkit/store" + "github.com/rollkit/rollkit/third_party/log" "github.com/rollkit/rollkit/types" ) diff --git a/block/manager_test.go b/block/manager_test.go index 5591298b8..70d993949 100644 --- a/block/manager_test.go +++ b/block/manager_test.go @@ -15,8 +15,8 @@ import ( "github.com/rollkit/rollkit/config" "github.com/rollkit/rollkit/da" mockda "github.com/rollkit/rollkit/da/mock" - "github.com/rollkit/rollkit/log/test" "github.com/rollkit/rollkit/store" + test "github.com/rollkit/rollkit/test/log" "github.com/rollkit/rollkit/types" ) diff --git a/conv/addr.go b/config/addr.go similarity index 88% rename from conv/addr.go rename to config/addr.go index 16f1c0a97..6bc60566f 100644 --- a/conv/addr.go +++ b/config/addr.go @@ -1,15 +1,18 @@ -package conv +package config import ( + "errors" "strings" "github.com/multiformats/go-multiaddr" +) - "github.com/rollkit/rollkit/config" +var ( + errInvalidAddress = errors.New("invalid address format, expected [protocol://][@]:") ) // TranslateAddresses updates conf by changing Cosmos-style addresses to Multiaddr format. -func TranslateAddresses(conf *config.NodeConfig) error { +func TranslateAddresses(conf *NodeConfig) error { if conf.P2P.ListenAddress != "" { addr, err := GetMultiAddr(conf.P2P.ListenAddress) if err != nil { diff --git a/conv/addr_test.go b/config/addr_test.go similarity index 78% rename from conv/addr_test.go rename to config/addr_test.go index 839f6ded8..c6e0d7623 100644 --- a/conv/addr_test.go +++ b/config/addr_test.go @@ -1,4 +1,4 @@ -package conv +package config import ( "strings" @@ -6,8 +6,6 @@ import ( "github.com/multiformats/go-multiaddr" "github.com/stretchr/testify/assert" - - "github.com/rollkit/rollkit/config" ) func TestTranslateAddresses(t *testing.T) { @@ -19,33 +17,33 @@ func TestTranslateAddresses(t *testing.T) { cases := []struct { name string - input config.NodeConfig - expected config.NodeConfig + input NodeConfig + expected NodeConfig expectedErr string }{ - {"empty", config.NodeConfig{}, config.NodeConfig{}, ""}, + {"empty", NodeConfig{}, NodeConfig{}, ""}, { "valid listen address", - config.NodeConfig{P2P: config.P2PConfig{ListenAddress: validCosmos}}, - config.NodeConfig{P2P: config.P2PConfig{ListenAddress: validRollkit}}, + NodeConfig{P2P: P2PConfig{ListenAddress: validCosmos}}, + NodeConfig{P2P: P2PConfig{ListenAddress: validRollkit}}, "", }, { "valid seed address", - config.NodeConfig{P2P: config.P2PConfig{Seeds: validCosmos + "," + validCosmos}}, - config.NodeConfig{P2P: config.P2PConfig{Seeds: validRollkit + "," + validRollkit}}, + NodeConfig{P2P: P2PConfig{Seeds: validCosmos + "," + validCosmos}}, + NodeConfig{P2P: P2PConfig{Seeds: validRollkit + "," + validRollkit}}, "", }, { "invalid listen address", - config.NodeConfig{P2P: config.P2PConfig{ListenAddress: invalidCosmos}}, - config.NodeConfig{}, + NodeConfig{P2P: P2PConfig{ListenAddress: invalidCosmos}}, + NodeConfig{}, errInvalidAddress.Error(), }, { "invalid seed address", - config.NodeConfig{P2P: config.P2PConfig{Seeds: validCosmos + "," + invalidCosmos}}, - config.NodeConfig{}, + NodeConfig{P2P: P2PConfig{Seeds: validCosmos + "," + invalidCosmos}}, + NodeConfig{}, errInvalidAddress.Error(), }, } diff --git a/config/config.go b/config/config.go index b3f67034c..346e36fbe 100644 --- a/config/config.go +++ b/config/config.go @@ -4,6 +4,8 @@ import ( "encoding/hex" "time" + cmcfg "github.com/cometbft/cometbft/config" + "github.com/spf13/cobra" "github.com/spf13/viper" @@ -56,6 +58,30 @@ type BlockManagerConfig struct { NamespaceID types.NamespaceID `mapstructure:"namespace_id"` } +// GetNodeConfig translates Tendermint's configuration into Rollkit configuration. +// +// This method only translates configuration, and doesn't verify it. If some option is missing in Tendermint's +// config, it's skipped during translation. +func GetNodeConfig(nodeConf *NodeConfig, cmConf *cmcfg.Config) { + if cmConf != nil { + nodeConf.RootDir = cmConf.RootDir + nodeConf.DBPath = cmConf.DBPath + if cmConf.P2P != nil { + nodeConf.P2P.ListenAddress = cmConf.P2P.ListenAddress + nodeConf.P2P.Seeds = cmConf.P2P.Seeds + } + if cmConf.RPC != nil { + nodeConf.RPC.ListenAddress = cmConf.RPC.ListenAddress + nodeConf.RPC.CORSAllowedOrigins = cmConf.RPC.CORSAllowedOrigins + nodeConf.RPC.CORSAllowedMethods = cmConf.RPC.CORSAllowedMethods + nodeConf.RPC.CORSAllowedHeaders = cmConf.RPC.CORSAllowedHeaders + nodeConf.RPC.MaxOpenConnections = cmConf.RPC.MaxOpenConnections + nodeConf.RPC.TLSCertFile = cmConf.RPC.TLSCertFile + nodeConf.RPC.TLSKeyFile = cmConf.RPC.TLSKeyFile + } + } +} + // GetViperConfig reads configuration parameters from Viper instance. // // This method is called in cosmos-sdk. diff --git a/config/config_test.go b/config/config_test.go index 68b383d44..109c0ad2c 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -4,6 +4,8 @@ import ( "testing" "time" + cmcfg "github.com/cometbft/cometbft/config" + "github.com/spf13/cobra" "github.com/spf13/viper" "github.com/stretchr/testify/assert" @@ -11,6 +13,29 @@ import ( "github.com/rollkit/rollkit/types" ) +func TestGetNodeConfig(t *testing.T) { + t.Parallel() + + cases := []struct { + name string + input *cmcfg.Config + expected NodeConfig + }{ + {"empty", nil, NodeConfig{}}, + {"Seeds", &cmcfg.Config{P2P: &cmcfg.P2PConfig{Seeds: "seeds"}}, NodeConfig{P2P: P2PConfig{Seeds: "seeds"}}}, + {"ListenAddress", &cmcfg.Config{P2P: &cmcfg.P2PConfig{ListenAddress: "127.0.0.1:7676"}}, NodeConfig{P2P: P2PConfig{ListenAddress: "127.0.0.1:7676"}}}, + {"RootDir", &cmcfg.Config{BaseConfig: cmcfg.BaseConfig{RootDir: "~/root"}}, NodeConfig{RootDir: "~/root"}}, + {"DBPath", &cmcfg.Config{BaseConfig: cmcfg.BaseConfig{DBPath: "./database"}}, NodeConfig{DBPath: "./database"}}, + } + + for _, c := range cases { + t.Run(c.name, func(t *testing.T) { + var actual NodeConfig + GetNodeConfig(&actual, c.input) + assert.Equal(t, c.expected, actual) + }) + } +} func TestViperAndCobra(t *testing.T) { t.Parallel() assert := assert.New(t) diff --git a/conv/config.go b/conv/config.go deleted file mode 100644 index 6511e04c5..000000000 --- a/conv/config.go +++ /dev/null @@ -1,31 +0,0 @@ -package conv - -import ( - cmcfg "github.com/cometbft/cometbft/config" - - "github.com/rollkit/rollkit/config" -) - -// GetNodeConfig translates Tendermint's configuration into Rollkit configuration. -// -// This method only translates configuration, and doesn't verify it. If some option is missing in Tendermint's -// config, it's skipped during translation. -func GetNodeConfig(nodeConf *config.NodeConfig, cmConf *cmcfg.Config) { - if cmConf != nil { - nodeConf.RootDir = cmConf.RootDir - nodeConf.DBPath = cmConf.DBPath - if cmConf.P2P != nil { - nodeConf.P2P.ListenAddress = cmConf.P2P.ListenAddress - nodeConf.P2P.Seeds = cmConf.P2P.Seeds - } - if cmConf.RPC != nil { - nodeConf.RPC.ListenAddress = cmConf.RPC.ListenAddress - nodeConf.RPC.CORSAllowedOrigins = cmConf.RPC.CORSAllowedOrigins - nodeConf.RPC.CORSAllowedMethods = cmConf.RPC.CORSAllowedMethods - nodeConf.RPC.CORSAllowedHeaders = cmConf.RPC.CORSAllowedHeaders - nodeConf.RPC.MaxOpenConnections = cmConf.RPC.MaxOpenConnections - nodeConf.RPC.TLSCertFile = cmConf.RPC.TLSCertFile - nodeConf.RPC.TLSKeyFile = cmConf.RPC.TLSKeyFile - } - } -} diff --git a/conv/config_test.go b/conv/config_test.go deleted file mode 100644 index c77a2b358..000000000 --- a/conv/config_test.go +++ /dev/null @@ -1,35 +0,0 @@ -package conv - -import ( - "testing" - - "github.com/stretchr/testify/assert" - - cmcfg "github.com/cometbft/cometbft/config" - - "github.com/rollkit/rollkit/config" -) - -func TestGetNodeConfig(t *testing.T) { - t.Parallel() - - cases := []struct { - name string - input *cmcfg.Config - expected config.NodeConfig - }{ - {"empty", nil, config.NodeConfig{}}, - {"Seeds", &cmcfg.Config{P2P: &cmcfg.P2PConfig{Seeds: "seeds"}}, config.NodeConfig{P2P: config.P2PConfig{Seeds: "seeds"}}}, - {"ListenAddress", &cmcfg.Config{P2P: &cmcfg.P2PConfig{ListenAddress: "127.0.0.1:7676"}}, config.NodeConfig{P2P: config.P2PConfig{ListenAddress: "127.0.0.1:7676"}}}, - {"RootDir", &cmcfg.Config{BaseConfig: cmcfg.BaseConfig{RootDir: "~/root"}}, config.NodeConfig{RootDir: "~/root"}}, - {"DBPath", &cmcfg.Config{BaseConfig: cmcfg.BaseConfig{DBPath: "./database"}}, config.NodeConfig{DBPath: "./database"}}, - } - - for _, c := range cases { - t.Run(c.name, func(t *testing.T) { - var actual config.NodeConfig - GetNodeConfig(&actual, c.input) - assert.Equal(t, c.expected, actual) - }) - } -} diff --git a/conv/errors.go b/conv/errors.go deleted file mode 100644 index 90468cbbb..000000000 --- a/conv/errors.go +++ /dev/null @@ -1,7 +0,0 @@ -package conv - -import "errors" - -var ( - errInvalidAddress = errors.New("invalid address format, expected [protocol://][@]:") -) diff --git a/da/celestia/celestia.go b/da/celestia/celestia.go index 0ddda1d5a..84a5ed9b6 100644 --- a/da/celestia/celestia.go +++ b/da/celestia/celestia.go @@ -16,7 +16,7 @@ import ( openrpcns "github.com/rollkit/celestia-openrpc/types/namespace" "github.com/rollkit/rollkit/da" - "github.com/rollkit/rollkit/log" + "github.com/rollkit/rollkit/third_party/log" "github.com/rollkit/rollkit/types" pb "github.com/rollkit/rollkit/types/pb/rollkit" ) diff --git a/da/celestia/mock/server.go b/da/celestia/mock/server.go index 21f7067fc..49cc8b82f 100644 --- a/da/celestia/mock/server.go +++ b/da/celestia/mock/server.go @@ -14,8 +14,8 @@ import ( "github.com/rollkit/celestia-openrpc/types/blob" "github.com/rollkit/celestia-openrpc/types/header" mockda "github.com/rollkit/rollkit/da/mock" - "github.com/rollkit/rollkit/log" "github.com/rollkit/rollkit/store" + "github.com/rollkit/rollkit/third_party/log" "github.com/rollkit/rollkit/types" ) diff --git a/da/da.go b/da/da.go index e5889ad74..89b6a986c 100644 --- a/da/da.go +++ b/da/da.go @@ -6,7 +6,7 @@ import ( ds "github.com/ipfs/go-datastore" - "github.com/rollkit/rollkit/log" + "github.com/rollkit/rollkit/third_party/log" "github.com/rollkit/rollkit/types" ) diff --git a/da/grpc/grpc.go b/da/grpc/grpc.go index 48608f9f5..bc5ec8123 100644 --- a/da/grpc/grpc.go +++ b/da/grpc/grpc.go @@ -10,7 +10,7 @@ import ( ds "github.com/ipfs/go-datastore" "github.com/rollkit/rollkit/da" - "github.com/rollkit/rollkit/log" + "github.com/rollkit/rollkit/third_party/log" "github.com/rollkit/rollkit/types" "github.com/rollkit/rollkit/types/pb/dalc" "github.com/rollkit/rollkit/types/pb/rollkit" diff --git a/da/mock/mock.go b/da/mock/mock.go index 95565e3e8..b61638511 100644 --- a/da/mock/mock.go +++ b/da/mock/mock.go @@ -14,8 +14,8 @@ import ( "github.com/rollkit/celestia-openrpc/types/core" "github.com/rollkit/rollkit/da" - "github.com/rollkit/rollkit/log" "github.com/rollkit/rollkit/store" + "github.com/rollkit/rollkit/third_party/log" "github.com/rollkit/rollkit/types" ) diff --git a/da/test/da_test.go b/da/test/da_test.go index f3bab33ca..d5f82d24f 100644 --- a/da/test/da_test.go +++ b/da/test/da_test.go @@ -24,8 +24,8 @@ import ( "github.com/rollkit/rollkit/da/grpc/mockserv" "github.com/rollkit/rollkit/da/mock" "github.com/rollkit/rollkit/da/registry" - "github.com/rollkit/rollkit/log/test" "github.com/rollkit/rollkit/store" + test "github.com/rollkit/rollkit/test/log" "github.com/rollkit/rollkit/types" ) diff --git a/conv/crypto.go b/node/crypto.go similarity index 98% rename from conv/crypto.go rename to node/crypto.go index 12fe4f0ce..eb64bcaeb 100644 --- a/conv/crypto.go +++ b/node/crypto.go @@ -1,4 +1,4 @@ -package conv +package node import ( "errors" diff --git a/conv/crypto_test.go b/node/crypto_test.go similarity index 98% rename from conv/crypto_test.go rename to node/crypto_test.go index 81312c99c..8dbfcccb1 100644 --- a/conv/crypto_test.go +++ b/node/crypto_test.go @@ -1,4 +1,4 @@ -package conv +package node import ( "testing" diff --git a/node/full_client.go b/node/full_client.go index 88587d24f..2bdfc0986 100644 --- a/node/full_client.go +++ b/node/full_client.go @@ -20,9 +20,9 @@ import ( "github.com/cometbft/cometbft/version" rconfig "github.com/rollkit/rollkit/config" - abciconv "github.com/rollkit/rollkit/conv/abci" "github.com/rollkit/rollkit/mempool" "github.com/rollkit/rollkit/types" + abciconv "github.com/rollkit/rollkit/types/abci" ) const ( diff --git a/node/full_client_test.go b/node/full_client_test.go index 2db4ef573..1a69e4de6 100644 --- a/node/full_client_test.go +++ b/node/full_client_test.go @@ -29,12 +29,11 @@ import ( "github.com/libp2p/go-libp2p/core/peer" "github.com/rollkit/rollkit/config" - "github.com/rollkit/rollkit/conv" - abciconv "github.com/rollkit/rollkit/conv/abci" mockda "github.com/rollkit/rollkit/da/mock" - "github.com/rollkit/rollkit/mocks" "github.com/rollkit/rollkit/store" + "github.com/rollkit/rollkit/test/mocks" "github.com/rollkit/rollkit/types" + abciconv "github.com/rollkit/rollkit/types/abci" ) var expectedInfo = &abci.ResponseInfo{ @@ -779,7 +778,7 @@ func createGenesisValidators(t *testing.T, numNodes int, appCreator func(require nodeKey := &p2p.NodeKey{ PrivKey: vKeys[i], } - signingKey, err := conv.GetNodeKey(nodeKey) + signingKey, err := GetNodeKey(nodeKey) require.NoError(err) nodes[i], err = newFullNode( context.Background(), diff --git a/node/full_node_integration_test.go b/node/full_node_integration_test.go index f4753ce6c..14aff6fd6 100644 --- a/node/full_node_integration_test.go +++ b/node/full_node_integration_test.go @@ -24,10 +24,10 @@ import ( "github.com/rollkit/rollkit/config" mockda "github.com/rollkit/rollkit/da/mock" - "github.com/rollkit/rollkit/log/test" - "github.com/rollkit/rollkit/mocks" "github.com/rollkit/rollkit/p2p" "github.com/rollkit/rollkit/store" + test "github.com/rollkit/rollkit/test/log" + "github.com/rollkit/rollkit/test/mocks" "github.com/rollkit/rollkit/types" testutils "github.com/celestiaorg/utils/test" diff --git a/node/full_node_test.go b/node/full_node_test.go index 132d5f1e2..ac58beda8 100644 --- a/node/full_node_test.go +++ b/node/full_node_test.go @@ -22,7 +22,7 @@ import ( "github.com/rollkit/rollkit/config" "github.com/rollkit/rollkit/mempool" - "github.com/rollkit/rollkit/mocks" + "github.com/rollkit/rollkit/test/mocks" ) // simply check that node is starting and stopping without panicking diff --git a/node/test_helpers.go b/node/test_helpers.go index e2e19d946..c66768252 100644 --- a/node/test_helpers.go +++ b/node/test_helpers.go @@ -13,7 +13,6 @@ import ( "github.com/libp2p/go-libp2p/core/crypto" "github.com/rollkit/rollkit/config" - "github.com/rollkit/rollkit/conv" "github.com/rollkit/rollkit/types" ) @@ -123,7 +122,7 @@ func getGenesisValidatorSetWithSigner(n int) ([]cmtypes.GenesisValidator, crypto nodeKey := &p2p.NodeKey{ PrivKey: genesisValidatorKey, } - signingKey, _ := conv.GetNodeKey(nodeKey) + signingKey, _ := GetNodeKey(nodeKey) pubKey := genesisValidatorKey.PubKey() genesisValidators := []cmtypes.GenesisValidator{ diff --git a/p2p/client.go b/p2p/client.go index 06429a640..619b5773e 100644 --- a/p2p/client.go +++ b/p2p/client.go @@ -28,7 +28,7 @@ import ( tmcrypto "github.com/tendermint/tendermint/crypto" "github.com/rollkit/rollkit/config" - "github.com/rollkit/rollkit/log" + "github.com/rollkit/rollkit/third_party/log" ) // TODO(tzdybal): refactor to configuration parameters diff --git a/p2p/client_test.go b/p2p/client_test.go index d62913e38..83af04fc3 100644 --- a/p2p/client_test.go +++ b/p2p/client_test.go @@ -17,7 +17,7 @@ import ( "github.com/stretchr/testify/require" "github.com/rollkit/rollkit/config" - "github.com/rollkit/rollkit/log/test" + test "github.com/rollkit/rollkit/test/log" ) func TestClientStartup(t *testing.T) { diff --git a/p2p/gossip.go b/p2p/gossip.go index 206a7fe52..a5489ef1c 100644 --- a/p2p/gossip.go +++ b/p2p/gossip.go @@ -9,7 +9,7 @@ import ( "github.com/libp2p/go-libp2p/core/host" "github.com/libp2p/go-libp2p/core/peer" - "github.com/rollkit/rollkit/log" + "github.com/rollkit/rollkit/third_party/log" ) // GossipMessage represents message gossiped via P2P network (e.g. transaction, Block etc). diff --git a/p2p/utils_test.go b/p2p/utils_test.go index 027901b4f..38e8505f5 100644 --- a/p2p/utils_test.go +++ b/p2p/utils_test.go @@ -18,7 +18,7 @@ import ( "go.uber.org/multierr" "github.com/rollkit/rollkit/config" - "github.com/rollkit/rollkit/log" + "github.com/rollkit/rollkit/third_party/log" ) type testNet []*Client diff --git a/rpc/json/handler.go b/rpc/json/handler.go index 9ee4309d7..63271c03a 100644 --- a/rpc/json/handler.go +++ b/rpc/json/handler.go @@ -15,7 +15,7 @@ import ( "github.com/gorilla/rpc/v2" "github.com/gorilla/rpc/v2/json2" - "github.com/rollkit/rollkit/log" + "github.com/rollkit/rollkit/third_party/log" ) type handler struct { diff --git a/rpc/json/service.go b/rpc/json/service.go index 8bc4c6e22..9a176f0d8 100644 --- a/rpc/json/service.go +++ b/rpc/json/service.go @@ -12,7 +12,7 @@ import ( ctypes "github.com/cometbft/cometbft/rpc/core/types" "github.com/gorilla/rpc/v2/json2" - "github.com/rollkit/rollkit/log" + "github.com/rollkit/rollkit/third_party/log" ) // GetHTTPHandler returns handler configured to serve Tendermint-compatible RPC. diff --git a/rpc/json/test_helpers.go b/rpc/json/test_helpers.go index 095eb6f69..facbbabe6 100644 --- a/rpc/json/test_helpers.go +++ b/rpc/json/test_helpers.go @@ -18,9 +18,8 @@ import ( "github.com/stretchr/testify/require" "github.com/rollkit/rollkit/config" - "github.com/rollkit/rollkit/conv" - "github.com/rollkit/rollkit/mocks" "github.com/rollkit/rollkit/node" + "github.com/rollkit/rollkit/test/mocks" ) // copied from rpc @@ -60,7 +59,7 @@ func getRPC(t *testing.T) (*mocks.Application, rpcclient.Client) { nodeKey := &p2p.NodeKey{ PrivKey: validatorKey, } - signingKey, _ := conv.GetNodeKey(nodeKey) + signingKey, _ := node.GetNodeKey(nodeKey) pubKey := validatorKey.PubKey() genesisValidators := []cmtypes.GenesisValidator{ diff --git a/rpc/json/ws.go b/rpc/json/ws.go index 6dcbe42dc..68d57e5d8 100644 --- a/rpc/json/ws.go +++ b/rpc/json/ws.go @@ -7,7 +7,7 @@ import ( "github.com/gorilla/websocket" - "github.com/rollkit/rollkit/log" + "github.com/rollkit/rollkit/third_party/log" ) type wsConn struct { diff --git a/docs/lazy-adr/adr-001-node-interface.md b/specs/lazy-adr/adr-001-node-interface.md similarity index 100% rename from docs/lazy-adr/adr-001-node-interface.md rename to specs/lazy-adr/adr-001-node-interface.md diff --git a/docs/lazy-adr/adr-002-mempool.md b/specs/lazy-adr/adr-002-mempool.md similarity index 100% rename from docs/lazy-adr/adr-002-mempool.md rename to specs/lazy-adr/adr-002-mempool.md diff --git a/docs/lazy-adr/adr-003-peer-discovery.md b/specs/lazy-adr/adr-003-peer-discovery.md similarity index 100% rename from docs/lazy-adr/adr-003-peer-discovery.md rename to specs/lazy-adr/adr-003-peer-discovery.md diff --git a/docs/lazy-adr/adr-004-core-types.md b/specs/lazy-adr/adr-004-core-types.md similarity index 100% rename from docs/lazy-adr/adr-004-core-types.md rename to specs/lazy-adr/adr-004-core-types.md diff --git a/docs/lazy-adr/adr-005-serialization.md b/specs/lazy-adr/adr-005-serialization.md similarity index 100% rename from docs/lazy-adr/adr-005-serialization.md rename to specs/lazy-adr/adr-005-serialization.md diff --git a/docs/lazy-adr/adr-006-da-interface.md b/specs/lazy-adr/adr-006-da-interface.md similarity index 100% rename from docs/lazy-adr/adr-006-da-interface.md rename to specs/lazy-adr/adr-006-da-interface.md diff --git a/docs/lazy-adr/adr-007-header-commit-to-shares.md b/specs/lazy-adr/adr-007-header-commit-to-shares.md similarity index 100% rename from docs/lazy-adr/adr-007-header-commit-to-shares.md rename to specs/lazy-adr/adr-007-header-commit-to-shares.md diff --git a/docs/lazy-adr/adr-008-mempool-optimint-light-client.md b/specs/lazy-adr/adr-008-mempool-optimint-light-client.md similarity index 100% rename from docs/lazy-adr/adr-008-mempool-optimint-light-client.md rename to specs/lazy-adr/adr-008-mempool-optimint-light-client.md diff --git a/docs/lazy-adr/adr-009-state-fraud-proofs.md b/specs/lazy-adr/adr-009-state-fraud-proofs.md similarity index 100% rename from docs/lazy-adr/adr-009-state-fraud-proofs.md rename to specs/lazy-adr/adr-009-state-fraud-proofs.md diff --git a/docs/lazy-adr/adr-template.md b/specs/lazy-adr/adr-template.md similarity index 100% rename from docs/lazy-adr/adr-template.md rename to specs/lazy-adr/adr-template.md diff --git a/docs/lazy-adr/figures/header_shares_commit.jpg b/specs/lazy-adr/figures/header_shares_commit.jpg similarity index 100% rename from docs/lazy-adr/figures/header_shares_commit.jpg rename to specs/lazy-adr/figures/header_shares_commit.jpg diff --git a/specs/src/SUMMARY.md b/specs/src/SUMMARY.md index 7faa8d227..95db23385 100644 --- a/specs/src/SUMMARY.md +++ b/specs/src/SUMMARY.md @@ -3,6 +3,7 @@ [Introduction](README.md) - [Template](./specs/template.md) +- [Dependency Graph](./specs/rollkit-dependency-graph.md) - [Block](./specs/block.md) - [DA](./specs/da.md) - [Mempool](./specs/mempool.md) diff --git a/docs/specification/dependency-graph.drawio.svg b/specs/src/specs/dependency-graph.drawio.svg similarity index 100% rename from docs/specification/dependency-graph.drawio.svg rename to specs/src/specs/dependency-graph.drawio.svg diff --git a/docs/specification/rollkit-dependency-graph.md b/specs/src/specs/rollkit-dependency-graph.md similarity index 100% rename from docs/specification/rollkit-dependency-graph.md rename to specs/src/specs/rollkit-dependency-graph.md diff --git a/state/executor.go b/state/executor.go index a1b20a3b5..e9ada3266 100644 --- a/state/executor.go +++ b/state/executor.go @@ -14,10 +14,10 @@ import ( "github.com/cometbft/cometbft/proxy" cmtypes "github.com/cometbft/cometbft/types" - abciconv "github.com/rollkit/rollkit/conv/abci" - "github.com/rollkit/rollkit/log" "github.com/rollkit/rollkit/mempool" + "github.com/rollkit/rollkit/third_party/log" "github.com/rollkit/rollkit/types" + abciconv "github.com/rollkit/rollkit/types/abci" ) var ErrEmptyValSetGenerated = errors.New("applying the validator changes would result in empty set") diff --git a/state/executor_test.go b/state/executor_test.go index 50fc73841..80054f56e 100644 --- a/state/executor_test.go +++ b/state/executor_test.go @@ -21,7 +21,7 @@ import ( cmtypes "github.com/cometbft/cometbft/types" "github.com/rollkit/rollkit/mempool" - "github.com/rollkit/rollkit/mocks" + "github.com/rollkit/rollkit/test/mocks" "github.com/rollkit/rollkit/types" ) diff --git a/docker/mockserv.Dockerfile b/test/docker/mockserv.Dockerfile similarity index 100% rename from docker/mockserv.Dockerfile rename to test/docker/mockserv.Dockerfile diff --git a/log/test/loggers.go b/test/log/loggers.go similarity index 100% rename from log/test/loggers.go rename to test/log/loggers.go diff --git a/mocks/Application.go b/test/mocks/Application.go similarity index 100% rename from mocks/Application.go rename to test/mocks/Application.go diff --git a/libs/celestia-app/appconsts/appconsts.go b/third_party/celestia-app/appconsts/appconsts.go similarity index 100% rename from libs/celestia-app/appconsts/appconsts.go rename to third_party/celestia-app/appconsts/appconsts.go diff --git a/libs/celestia-app/appconsts/consensus_consts.go b/third_party/celestia-app/appconsts/consensus_consts.go similarity index 100% rename from libs/celestia-app/appconsts/consensus_consts.go rename to third_party/celestia-app/appconsts/consensus_consts.go diff --git a/libs/celestia-app/namespace/consts.go b/third_party/celestia-app/namespace/consts.go similarity index 97% rename from libs/celestia-app/namespace/consts.go rename to third_party/celestia-app/namespace/consts.go index 51795f0f1..bcfed190d 100644 --- a/libs/celestia-app/namespace/consts.go +++ b/third_party/celestia-app/namespace/consts.go @@ -4,7 +4,7 @@ import ( "bytes" "math" - "github.com/rollkit/rollkit/libs/celestia-app/appconsts" + "github.com/rollkit/rollkit/third_party/celestia-app/appconsts" ) const ( diff --git a/libs/celestia-app/namespace/namespace.go b/third_party/celestia-app/namespace/namespace.go similarity index 100% rename from libs/celestia-app/namespace/namespace.go rename to third_party/celestia-app/namespace/namespace.go diff --git a/libs/celestia-app/namespace/namespace_test.go b/third_party/celestia-app/namespace/namespace_test.go similarity index 100% rename from libs/celestia-app/namespace/namespace_test.go rename to third_party/celestia-app/namespace/namespace_test.go diff --git a/libs/celestia-app/namespace/random_blob.go b/third_party/celestia-app/namespace/random_blob.go similarity index 100% rename from libs/celestia-app/namespace/random_blob.go rename to third_party/celestia-app/namespace/random_blob.go diff --git a/libs/celestia-app/namespace/random_namespace.go b/third_party/celestia-app/namespace/random_namespace.go similarity index 100% rename from libs/celestia-app/namespace/random_namespace.go rename to third_party/celestia-app/namespace/random_namespace.go diff --git a/libs/celestia-app/shares/compact_shares_test.go b/third_party/celestia-app/shares/compact_shares_test.go similarity index 96% rename from libs/celestia-app/shares/compact_shares_test.go rename to third_party/celestia-app/shares/compact_shares_test.go index 599b6f042..18c66a490 100644 --- a/libs/celestia-app/shares/compact_shares_test.go +++ b/third_party/celestia-app/shares/compact_shares_test.go @@ -10,9 +10,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/rollkit/rollkit/libs/celestia-app/appconsts" - appns "github.com/rollkit/rollkit/libs/celestia-app/namespace" - "github.com/rollkit/rollkit/libs/celestia-app/testfactory" + "github.com/rollkit/rollkit/third_party/celestia-app/appconsts" + appns "github.com/rollkit/rollkit/third_party/celestia-app/namespace" + "github.com/rollkit/rollkit/third_party/celestia-app/testfactory" ) func SplitTxs(txs coretypes.Txs) (txShares []Share, err error) { diff --git a/libs/celestia-app/shares/doc.go b/third_party/celestia-app/shares/doc.go similarity index 100% rename from libs/celestia-app/shares/doc.go rename to third_party/celestia-app/shares/doc.go diff --git a/libs/celestia-app/shares/info_byte.go b/third_party/celestia-app/shares/info_byte.go similarity index 94% rename from libs/celestia-app/shares/info_byte.go rename to third_party/celestia-app/shares/info_byte.go index ae954e7b0..224a1ddab 100644 --- a/libs/celestia-app/shares/info_byte.go +++ b/third_party/celestia-app/shares/info_byte.go @@ -3,7 +3,7 @@ package shares import ( "fmt" - "github.com/rollkit/rollkit/libs/celestia-app/appconsts" + "github.com/rollkit/rollkit/third_party/celestia-app/appconsts" ) // InfoByte is a byte with the following structure: the first 7 bits are diff --git a/libs/celestia-app/shares/info_byte_test.go b/third_party/celestia-app/shares/info_byte_test.go similarity index 100% rename from libs/celestia-app/shares/info_byte_test.go rename to third_party/celestia-app/shares/info_byte_test.go diff --git a/libs/celestia-app/shares/parse_compact_shares.go b/third_party/celestia-app/shares/parse_compact_shares.go similarity index 100% rename from libs/celestia-app/shares/parse_compact_shares.go rename to third_party/celestia-app/shares/parse_compact_shares.go diff --git a/libs/celestia-app/shares/reserved_bytes.go b/third_party/celestia-app/shares/reserved_bytes.go similarity index 94% rename from libs/celestia-app/shares/reserved_bytes.go rename to third_party/celestia-app/shares/reserved_bytes.go index 51a296b52..9fd0580f9 100644 --- a/libs/celestia-app/shares/reserved_bytes.go +++ b/third_party/celestia-app/shares/reserved_bytes.go @@ -4,7 +4,7 @@ import ( "encoding/binary" "fmt" - "github.com/rollkit/rollkit/libs/celestia-app/appconsts" + "github.com/rollkit/rollkit/third_party/celestia-app/appconsts" ) // NewReservedBytes returns a byte slice of length diff --git a/libs/celestia-app/shares/reserved_bytes_test.go b/third_party/celestia-app/shares/reserved_bytes_test.go similarity index 100% rename from libs/celestia-app/shares/reserved_bytes_test.go rename to third_party/celestia-app/shares/reserved_bytes_test.go diff --git a/libs/celestia-app/shares/share_builder.go b/third_party/celestia-app/shares/share_builder.go similarity index 97% rename from libs/celestia-app/shares/share_builder.go rename to third_party/celestia-app/shares/share_builder.go index bfa9eeb92..ac88a686b 100644 --- a/libs/celestia-app/shares/share_builder.go +++ b/third_party/celestia-app/shares/share_builder.go @@ -4,8 +4,8 @@ import ( "encoding/binary" "errors" - "github.com/rollkit/rollkit/libs/celestia-app/appconsts" - appns "github.com/rollkit/rollkit/libs/celestia-app/namespace" + "github.com/rollkit/rollkit/third_party/celestia-app/appconsts" + appns "github.com/rollkit/rollkit/third_party/celestia-app/namespace" ) type Builder struct { diff --git a/libs/celestia-app/shares/share_builder_test.go b/third_party/celestia-app/shares/share_builder_test.go similarity index 98% rename from libs/celestia-app/shares/share_builder_test.go rename to third_party/celestia-app/shares/share_builder_test.go index 9a0c12922..b356fd709 100644 --- a/libs/celestia-app/shares/share_builder_test.go +++ b/third_party/celestia-app/shares/share_builder_test.go @@ -8,8 +8,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/rollkit/rollkit/libs/celestia-app/appconsts" - appns "github.com/rollkit/rollkit/libs/celestia-app/namespace" + "github.com/rollkit/rollkit/third_party/celestia-app/appconsts" + appns "github.com/rollkit/rollkit/third_party/celestia-app/namespace" ) func TestShareBuilderIsEmptyShare(t *testing.T) { diff --git a/libs/celestia-app/shares/share_sequence.go b/third_party/celestia-app/shares/share_sequence.go similarity index 94% rename from libs/celestia-app/shares/share_sequence.go rename to third_party/celestia-app/shares/share_sequence.go index a79136f82..b5bf48fdd 100644 --- a/libs/celestia-app/shares/share_sequence.go +++ b/third_party/celestia-app/shares/share_sequence.go @@ -3,8 +3,8 @@ package shares import ( "fmt" - "github.com/rollkit/rollkit/libs/celestia-app/appconsts" - appns "github.com/rollkit/rollkit/libs/celestia-app/namespace" + "github.com/rollkit/rollkit/third_party/celestia-app/appconsts" + appns "github.com/rollkit/rollkit/third_party/celestia-app/namespace" ) // ShareSequence represents a contiguous sequence of shares that are part of the diff --git a/libs/celestia-app/shares/share_sequence_test.go b/third_party/celestia-app/shares/share_sequence_test.go similarity index 96% rename from libs/celestia-app/shares/share_sequence_test.go rename to third_party/celestia-app/shares/share_sequence_test.go index 7cb41d876..79f851b98 100644 --- a/libs/celestia-app/shares/share_sequence_test.go +++ b/third_party/celestia-app/shares/share_sequence_test.go @@ -7,8 +7,8 @@ import ( "github.com/stretchr/testify/assert" - "github.com/rollkit/rollkit/libs/celestia-app/appconsts" - appns "github.com/rollkit/rollkit/libs/celestia-app/namespace" + "github.com/rollkit/rollkit/third_party/celestia-app/appconsts" + appns "github.com/rollkit/rollkit/third_party/celestia-app/namespace" ) func TestShareSequenceRawData(t *testing.T) { diff --git a/libs/celestia-app/shares/shares.go b/third_party/celestia-app/shares/shares.go similarity index 97% rename from libs/celestia-app/shares/shares.go rename to third_party/celestia-app/shares/shares.go index 7fd0f7053..c07d001b4 100644 --- a/libs/celestia-app/shares/shares.go +++ b/third_party/celestia-app/shares/shares.go @@ -5,8 +5,8 @@ import ( "encoding/binary" "fmt" - "github.com/rollkit/rollkit/libs/celestia-app/appconsts" - appns "github.com/rollkit/rollkit/libs/celestia-app/namespace" + "github.com/rollkit/rollkit/third_party/celestia-app/appconsts" + appns "github.com/rollkit/rollkit/third_party/celestia-app/namespace" ) // Share contains the raw share data (including namespace ID). diff --git a/libs/celestia-app/shares/shares_test.go b/third_party/celestia-app/shares/shares_test.go similarity index 98% rename from libs/celestia-app/shares/shares_test.go rename to third_party/celestia-app/shares/shares_test.go index c6a00912a..e5f529271 100644 --- a/libs/celestia-app/shares/shares_test.go +++ b/third_party/celestia-app/shares/shares_test.go @@ -6,8 +6,8 @@ import ( "github.com/stretchr/testify/assert" - "github.com/rollkit/rollkit/libs/celestia-app/appconsts" - appns "github.com/rollkit/rollkit/libs/celestia-app/namespace" + "github.com/rollkit/rollkit/third_party/celestia-app/appconsts" + appns "github.com/rollkit/rollkit/third_party/celestia-app/namespace" ) // // TestPadFirstIndexedBlob ensures that we are adding padding to the first share diff --git a/libs/celestia-app/shares/split_compact_shares.go b/third_party/celestia-app/shares/split_compact_shares.go similarity index 98% rename from libs/celestia-app/shares/split_compact_shares.go rename to third_party/celestia-app/shares/split_compact_shares.go index fb989db37..1d944e9b9 100644 --- a/libs/celestia-app/shares/split_compact_shares.go +++ b/third_party/celestia-app/shares/split_compact_shares.go @@ -6,8 +6,8 @@ import ( coretypes "github.com/cometbft/cometbft/types" - "github.com/rollkit/rollkit/libs/celestia-app/appconsts" - appns "github.com/rollkit/rollkit/libs/celestia-app/namespace" + "github.com/rollkit/rollkit/third_party/celestia-app/appconsts" + appns "github.com/rollkit/rollkit/third_party/celestia-app/namespace" ) type ShareRange struct { diff --git a/libs/celestia-app/shares/split_compact_shares_test.go b/third_party/celestia-app/shares/split_compact_shares_test.go similarity index 98% rename from libs/celestia-app/shares/split_compact_shares_test.go rename to third_party/celestia-app/shares/split_compact_shares_test.go index c613dba00..77601ecdf 100644 --- a/libs/celestia-app/shares/split_compact_shares_test.go +++ b/third_party/celestia-app/shares/split_compact_shares_test.go @@ -8,8 +8,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/rollkit/rollkit/libs/celestia-app/appconsts" - appns "github.com/rollkit/rollkit/libs/celestia-app/namespace" + "github.com/rollkit/rollkit/third_party/celestia-app/appconsts" + appns "github.com/rollkit/rollkit/third_party/celestia-app/namespace" ) // fillShare returns a share filled with filler so that the share length diff --git a/libs/celestia-app/shares/testdata/sample-block.json b/third_party/celestia-app/shares/testdata/sample-block.json similarity index 100% rename from libs/celestia-app/shares/testdata/sample-block.json rename to third_party/celestia-app/shares/testdata/sample-block.json diff --git a/libs/celestia-app/shares/utils.go b/third_party/celestia-app/shares/utils.go similarity index 100% rename from libs/celestia-app/shares/utils.go rename to third_party/celestia-app/shares/utils.go diff --git a/libs/celestia-app/shares/utils_test.go b/third_party/celestia-app/shares/utils_test.go similarity index 96% rename from libs/celestia-app/shares/utils_test.go rename to third_party/celestia-app/shares/utils_test.go index 576a66ce8..0e6f97fd3 100644 --- a/libs/celestia-app/shares/utils_test.go +++ b/third_party/celestia-app/shares/utils_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/rollkit/rollkit/libs/celestia-app/testfactory" + "github.com/rollkit/rollkit/third_party/celestia-app/testfactory" ) // func FuzzBlobSharesUsed(f *testing.F) { diff --git a/libs/celestia-app/testfactory/txs.go b/third_party/celestia-app/testfactory/txs.go similarity index 100% rename from libs/celestia-app/testfactory/txs.go rename to third_party/celestia-app/testfactory/txs.go diff --git a/log/logger.go b/third_party/log/logger.go similarity index 100% rename from log/logger.go rename to third_party/log/logger.go diff --git a/conv/abci/block.go b/types/abci/block.go similarity index 100% rename from conv/abci/block.go rename to types/abci/block.go diff --git a/conv/abci/block_test.go b/types/abci/block_test.go similarity index 100% rename from conv/abci/block_test.go rename to types/abci/block_test.go