diff --git a/.github/workflows/tests_master.yml b/.github/workflows/tests_master.yml index 345a61057..1fb7266e4 100644 --- a/.github/workflows/tests_master.yml +++ b/.github/workflows/tests_master.yml @@ -5,15 +5,18 @@ on: name: build jobs: golangci: - name: Linter + name: lint runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/setup-go@v3 + with: + go-version: '1.18' + - uses: actions/checkout@v3 - name: golangci-lint - uses: golangci/golangci-lint-action@v2.3.0 + uses: golangci/golangci-lint-action@v3 with: - version: v1.49.0 - args: --timeout=2m --go=1.18 + version: v1.51.2 + args: --timeout=3m test: name: Tests runs-on: ubuntu-latest diff --git a/.github/workflows/tests_pr.yml b/.github/workflows/tests_pr.yml index eb80ef3a3..7dc42b54b 100644 --- a/.github/workflows/tests_pr.yml +++ b/.github/workflows/tests_pr.yml @@ -6,15 +6,18 @@ on: name: Pull Request Tests jobs: golangci: - name: Linter + name: lint runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/setup-go@v3 + with: + go-version: '1.18' + - uses: actions/checkout@v3 - name: golangci-lint - uses: golangci/golangci-lint-action@v2.3.0 + uses: golangci/golangci-lint-action@v3 with: - version: v1.49.0 - args: --timeout=2m --go=1.18 + version: v1.51.2 + args: --timeout=3m test: name: Tests runs-on: ubuntu-latest diff --git a/configs/development.yml b/configs/development.yml index 340dc4f50..111e0df01 100644 --- a/configs/development.yml +++ b/configs/development.yml @@ -11,6 +11,10 @@ rpc: uri: https://rpc.tzkt.io/limanet timeout: 20 requests_per_second: 20 + mumbainet: + uri: https://rpc.tzkt.io/mumbainet + timeout: 20 + requests_per_second: 20 tzkt: mainnet: @@ -23,6 +27,8 @@ services: mempool: https://mempool.test.dipdup.net/v1/graphql limanet: mempool: https://mempool.test.dipdup.net/v1/graphql + mumbainet: + mempool: https://mempool.test.dipdup.net/v1/graphql storage: pg: @@ -60,10 +66,12 @@ api: mainnet: https://rpc.tzkt.io/mainnet ghostnet: https://rpc.tzkt.io/ghostnet limanet: https://rpc.tzkt.io/limanet + mumbainet: https://rpc.tzkt.io/mumbainet networks: - mainnet - ghostnet - limanet + - mumbainet connections: max: 50 idle: 50 @@ -72,11 +80,13 @@ indexer: project_name: indexer sentry_enabled: false networks: - mainnet: - receiver_threads: 5 - ghostnet: - receiver_threads: 10 - limanet: + # mainnet: + # receiver_threads: 5 + # ghostnet: + # receiver_threads: 10 + # limanet: + # receiver_threads: 10 + mumbainet: receiver_threads: 10 connections: max: 5 @@ -92,6 +102,7 @@ scripts: - mainnet - ghostnet - limanet + - mumbainet connections: max: 5 idle: 5 \ No newline at end of file diff --git a/configs/production.yml b/configs/production.yml index ed79d816d..75a1fa8aa 100644 --- a/configs/production.yml +++ b/configs/production.yml @@ -11,6 +11,10 @@ rpc: uri: https://rpc.tzkt.io/limanet timeout: 20 requests_per_second: 20 + mumbainet: + uri: https://rpc.tzkt.io/mumbainet + timeout: 20 + requests_per_second: 20 tzkt: mainnet: @@ -24,6 +28,8 @@ services: mempool: https://mempool.test.dipdup.net/v1/graphql limanet: mempool: https://mempool.test.dipdup.net/v1/graphql + mumbainet: + mempool: https://mempool.test.dipdup.net/v1/graphql storage: pg: @@ -61,10 +67,12 @@ api: mainnet: https://rpc.tzkt.io/mainnet ghostnet: https://rpc.tzkt.io/ghostnet limanet: https://rpc.tzkt.io/limanet + mumbainet: https://rpc.tzkt.io/mumbainet networks: - mainnet - ghostnet - limanet + - mumbainet connections: max: 50 idle: 10 @@ -79,6 +87,8 @@ indexer: receiver_threads: ${TESTNET_THREADS:-1} limanet: receiver_threads: ${TESTNET_THREADS:-1} + mumbainet: + receiver_threads: ${TESTNET_THREADS:-1} connections: max: 5 idle: 5 @@ -93,6 +103,7 @@ scripts: - mainnet - ghostnet - limanet + - mumbainet connections: max: 5 idle: 5 diff --git a/internal/bcd/encoding/base58.go b/internal/bcd/encoding/base58.go index 08bf4ed00..5ce1cfa90 100644 --- a/internal/bcd/encoding/base58.go +++ b/internal/bcd/encoding/base58.go @@ -31,6 +31,7 @@ const ( PrefixPublicKeyTZ4 = "tz4" PrefixPublicKeyKT1 = "KT1" PrefixPublicKeyTxr1 = "txr1" + PrefixOriginatedSmartRollup = "sr1" PrefixRollupInboxHash = "txi" PrefixRollupMessageHash = "txm" PrefixRollupCommitmentHash = "txc" @@ -70,10 +71,11 @@ var base58Encodings = []base58Encoding{ {[]byte(PrefixPublicKeyTZ1), 36, []byte{6, 161, 159}, 20, "ed25519 public key hash"}, {[]byte(PrefixPublicKeyTZ2), 36, []byte{6, 161, 161}, 20, "secp256k1 public key hash"}, {[]byte(PrefixPublicKeyTZ3), 36, []byte{6, 161, 164}, 20, "p256 public key hash"}, + {[]byte(PrefixPublicKeyTZ4), 36, []byte{6, 161, 166}, 20, "BLS-MinPk"}, {[]byte(PrefixPublicKeyKT1), 36, []byte{2, 90, 121}, 20, "Originated address"}, {[]byte(PrefixPublicKeyTxr1), 37, []byte{1, 128, 120, 31}, 20, "Rollup address"}, - {[]byte(PrefixPublicKeyTZ4), 36, []byte{6, 161, 166}, 20, "L2 rollup address"}, + {[]byte(PrefixOriginatedSmartRollup), 37, []byte{6, 124, 117}, 20, "Smart rollup"}, {[]byte(PrefixRollupInboxHash), 53, []byte{79, 148, 196}, 32, "Inbox hash"}, {[]byte(PrefixRollupMessageHash), 53, []byte{79, 149, 030}, 32, "Message hash"}, {[]byte(PrefixRollupCommitmentHash), 53, []byte{79, 148, 017}, 32, "Commitment hash"}, diff --git a/internal/bcd/forge/domaintypes.go b/internal/bcd/forge/domaintypes.go index 206fa4e2c..b3a663853 100644 --- a/internal/bcd/forge/domaintypes.go +++ b/internal/bcd/forge/domaintypes.go @@ -24,12 +24,17 @@ func Address(val string, tzOnly bool) ([]byte, error) { address = append([]byte{0, 1}, address...) case encoding.PrefixPublicKeyTZ3: address = append([]byte{0, 2}, address...) + case encoding.PrefixPublicKeyTZ4: + address = append([]byte{0, 3}, address...) case encoding.PrefixPublicKeyKT1: address = append([]byte{1}, address...) address = append(address, byte(0)) case encoding.PrefixPublicKeyTxr1: address = append([]byte{2}, address...) address = append(address, byte(0)) + case encoding.PrefixOriginatedSmartRollup: + address = append([]byte{3}, address...) + address = append(address, byte(0)) default: return nil, errors.Errorf("Invalid address prefix: %s", prefix) } @@ -53,10 +58,14 @@ func UnforgeAddress(str string) (string, error) { return encoding.EncodeBase58String(str[4:], []byte(encoding.PrefixPublicKeyTZ2)) case strings.HasPrefix(str, "0002"): return encoding.EncodeBase58String(str[4:], []byte(encoding.PrefixPublicKeyTZ3)) + case strings.HasPrefix(str, "0003"): + return encoding.EncodeBase58String(str[4:], []byte(encoding.PrefixPublicKeyTZ3)) case strings.HasPrefix(str, "01") && strings.HasSuffix(str, "00"): return encoding.EncodeBase58String(str[2:len(str)-2], []byte(encoding.PrefixPublicKeyKT1)) case strings.HasPrefix(str, "02") && strings.HasSuffix(str, "00"): return encoding.EncodeBase58String(str[2:len(str)-2], []byte(encoding.PrefixPublicKeyTxr1)) + case strings.HasPrefix(str, "03") && strings.HasSuffix(str, "00"): + return encoding.EncodeBase58String(str[2:len(str)-2], []byte(encoding.PrefixOriginatedSmartRollup)) default: return str, errors.Wrapf(consts.ErrInvalidAddress, "UnforgeAddress: %s", str) } diff --git a/internal/bcd/protocols.go b/internal/bcd/protocols.go index a6d118eec..494982078 100644 --- a/internal/bcd/protocols.go +++ b/internal/bcd/protocols.go @@ -37,6 +37,8 @@ var symLinks = map[string]string{ "PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY": SymLinkJakarta, // Jakarta "PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg": SymLinkJakarta, // Kathmandu "PtLimaPtLMwfNinJi9rCfDPWea8dFgTZ1MeJ9f1m2SRic6ayiwW": SymLinkJakarta, // Lima + "PtMumbaiiFFEGbew1rRjzSPyzRbA51Tm3RVZL5suHPxSZYDhCEc": SymLinkJakarta, // Mumbai + "PtMumbai2TmsJHNGRkD8v8YDbtao7BLUC3wjASn1inAKLFCjaH1": SymLinkJakarta, // Mumbai 2 } // GetProtoSymLink - @@ -66,4 +68,5 @@ var ChainID = map[string]string{ "NetXLH1uAxK7CCh": "jakarta", "NetXi2ZagzEsXbZ": "kathmandunet", "NetXizpkH94bocH": "limanet", + "NetXQw6nWSnrJ5t": "mumbainet", } diff --git a/internal/models/types/network.go b/internal/models/types/network.go index 756279a7c..7c96ba507 100644 --- a/internal/models/types/network.go +++ b/internal/models/types/network.go @@ -28,6 +28,7 @@ const ( Limanet Mondaynet Dailynet + Mumbainet ) var networkNames = map[Network]string{ @@ -47,6 +48,7 @@ var networkNames = map[Network]string{ Limanet: "limanet", Mondaynet: "mondaynet", Dailynet: "dailynet", + Mumbainet: "mumbainet", } var namesToNetwork = map[string]Network{ @@ -66,6 +68,7 @@ var namesToNetwork = map[string]Network{ "limanet": Limanet, "mondaynet": Mondaynet, "dailynet": Dailynet, + "mumbainet": Mumbainet, } // String - convert enum to string for printing diff --git a/internal/parsers/operations/migration.go b/internal/parsers/operations/migration.go index bc1674c9e..b587783b6 100644 --- a/internal/parsers/operations/migration.go +++ b/internal/parsers/operations/migration.go @@ -56,7 +56,9 @@ func (m Migration) Parse(data noderpc.Operation, operation *operation.Operation, "PtGRANADsDU8R9daYKAgWnQYAJ64omN1o3KMGVCykShA97vQbvV", "PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY", "PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg", - "PtLimaPtLMwfNinJi9rCfDPWea8dFgTZ1MeJ9f1m2SRic6ayiwW": + "PtLimaPtLMwfNinJi9rCfDPWea8dFgTZ1MeJ9f1m2SRic6ayiwW", + "PtMumbaiiFFEGbew1rRjzSPyzRbA51Tm3RVZL5suHPxSZYDhCEc", + "PtMumbai2TmsJHNGRkD8v8YDbtao7BLUC3wjASn1inAKLFCjaH1": return m.fromLazyStorageDiff(data, operation, store) default: diff --git a/internal/parsers/protocols/protocol.go b/internal/parsers/protocols/protocol.go index e48e56fa9..6616cea84 100644 --- a/internal/parsers/protocols/protocol.go +++ b/internal/parsers/protocols/protocol.go @@ -77,7 +77,9 @@ func Get(ctx *config.Context, protocol string) (*Specific, error) { case "PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY", "PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg", "ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK", - "PtLimaPtLMwfNinJi9rCfDPWea8dFgTZ1MeJ9f1m2SRic6ayiwW": + "PtLimaPtLMwfNinJi9rCfDPWea8dFgTZ1MeJ9f1m2SRic6ayiwW", + "PtMumbaiiFFEGbew1rRjzSPyzRbA51Tm3RVZL5suHPxSZYDhCEc", + "PtMumbai2TmsJHNGRkD8v8YDbtao7BLUC3wjASn1inAKLFCjaH1": return &Specific{ StorageParser: storage.NewLazyBabylon(ctx.BigMapDiffs, ctx.Operations, ctx.Accounts), ContractParser: contract.NewJakarta(ctx), @@ -123,7 +125,9 @@ func NeedImplicitParsing(protocol string) bool { "PtJakart2xVj7pYXJBXrqHgd82rdkLey5ZeeGwDgPp9rhQUbSqY", "PtKathmankSpLLDALzWw7CGD2j2MtyveTwboEYokqUCP4a1LxMg", "ProtoALphaALphaALphaALphaALphaALphaALphaALphaDdp3zK", - "PtLimaPtLMwfNinJi9rCfDPWea8dFgTZ1MeJ9f1m2SRic6ayiwW": + "PtLimaPtLMwfNinJi9rCfDPWea8dFgTZ1MeJ9f1m2SRic6ayiwW", + "PtMumbaiiFFEGbew1rRjzSPyzRbA51Tm3RVZL5suHPxSZYDhCEc", + "PtMumbai2TmsJHNGRkD8v8YDbtao7BLUC3wjASn1inAKLFCjaH1": return true } return false diff --git a/scripts/bcdctl/main.go b/scripts/bcdctl/main.go index 58f8c1085..ab494b745 100644 --- a/scripts/bcdctl/main.go +++ b/scripts/bcdctl/main.go @@ -11,12 +11,6 @@ import ( ) var ctxs config.Contexts -var creds awsData - -type awsData struct { - BucketName string - Region string -} func main() { cfg, err := config.LoadDefaultConfig() @@ -25,11 +19,6 @@ func main() { return } - creds = awsData{ - BucketName: cfg.Scripts.AWS.BucketName, - Region: cfg.Scripts.AWS.Region, - } - ctxs = config.NewContexts(cfg, cfg.Scripts.Networks, config.WithStorage(cfg.Storage, "bcdctl", 0, cfg.Scripts.Connections.Open, cfg.Scripts.Connections.Idle, false), config.WithConfigCopy(cfg),