From 22896f8859f41a99449d40b78a0d4e8738031081 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Thu, 18 Jul 2024 21:35:01 +0200 Subject: [PATCH 01/68] internal/config/builder_test.go: rewrite ConfigWithFlags to WithDefaultConfig as we already have a test for flags --- internal/config/builder_test.go | 73 +++++++-------------------------- 1 file changed, 15 insertions(+), 58 deletions(-) diff --git a/internal/config/builder_test.go b/internal/config/builder_test.go index df24552..1de8eb8 100644 --- a/internal/config/builder_test.go +++ b/internal/config/builder_test.go @@ -87,74 +87,31 @@ redis: require.Equal(t, &expected, cfg) } -func TestBuilder_ConfigWithFlags(t *testing.T) { +func TestBuilder_WithDefaultConfig(t *testing.T) { expected := Config{ - Name: "ship-reader-1", - Api: "https://api.example.com", - MessageCodec: "msgpack", + MessageCodec: "json", Log: log.Config{ - Filename: "mylog.log", - Directory: "/var/log", - MaxFileSize: 200, - MaxTime: 30 * time.Minute, + MaxFileSize: 10 * 1000 * 1000, + MaxTime: time.Hour * 24, FileTimestampFormat: "2006-01-02_150405", }, - Ship: ShipConfig{ - Url: "127.0.0.1:8089", - StartBlockNum: 23671836, - EndBlockNum: 23872222, - IrreversibleOnly: true, - MaxMessagesInFlight: 1337, }, - Telegram: TelegramConfig{ - Id: "110201543:AAHdqTcvCH1vGWJxfSeofSAs0K5PALDsaw", - Channel: -123456789, + Ship: ShipConfig{ + Url: "ws://127.0.0.1:8080", + StartBlockNum: shipclient.NULL_BLOCK_NUMBER, + EndBlockNum: shipclient.NULL_BLOCK_NUMBER, + MaxMessagesInFlight: 10, }, Redis: RedisConfig{ - Addr: "localhost:6379", - User: "userfromcli", - Password: "passwd", - DB: 4, - Prefix: "some::ship", + Addr: "127.0.0.1:6379", + Prefix: "ship", }, } - builder := NewBuilder() - builder.SetSource(bytes.NewBuffer([]byte(` -name: "ship-reader-1" -api: "http://127.0.0.1:8080" -message_codec: "mojibake" -log: - filename: mylog.log - directory: /var/log - maxtime: 30m - maxfilesize: 200b -ship: - url: "127.0.0.1:8089" - irreversible_only: true - max_messages_in_flight: 1337 - start_block_num: 23671836 - end_block_num: 23872222 -telegram: - id: "110201543:AAHdqTcvCH1vGWJxfSeofSAs0K5PALDsaw" - channel: -123456789 -redis: - addr: "localhost:6379" - user: "myuser" - password: "passwd" - db: 4 - prefix: "some::ship" -`))) - - flags := GetFlags() - - require.NoError(t, flags.Set("url", "https://api.example.com")) - require.NoError(t, flags.Set("codec", "msgpack")) - require.NoError(t, flags.Set("redis-user", "userfromcli")) - - builder.SetFlags(flags) - - cfg, err := builder.Build() + cfg, err := NewBuilder(). + SetSource(bytes.NewReader([]byte(``))). + SetFlags(GetFlags()). + Build() require.NoError(t, err) require.Equal(t, &expected, cfg) From ad90966e246603d9c7cf9c4acb17c4ce17218bde Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Thu, 18 Jul 2024 21:42:35 +0200 Subject: [PATCH 02/68] internal/abi/manager_test.go: remove call to fmt.Println() --- internal/abi/manager_test.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/internal/abi/manager_test.go b/internal/abi/manager_test.go index e7fdfca..a523c6e 100644 --- a/internal/abi/manager_test.go +++ b/internal/abi/manager_test.go @@ -166,7 +166,5 @@ func TestManager_GetAbiFromAPI(t *testing.T) { c_abi, err := mgr.GetAbi(chain.N("testaccount")) assert.NoError(t, err) - fmt.Println(c_abi) - assert_abi(t, c_abi) } From c523f1c797345c36894cc6432ff5e7d9dcabcb03 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Fri, 19 Jul 2024 13:40:03 +0200 Subject: [PATCH 03/68] make: build all go files in cmd/thalos --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8f312f2..63dd23a 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ DOCKER_IMAGE_TAG ?= $(PROGRAM_VERSION) build: build/$(PROGRAM) build/$(PROGRAM) : - $(GO) build $(GOBUILDFLAGS) -o $@ cmd/thalos/main.go cmd/thalos/server.go + $(GO) build $(GOBUILDFLAGS) -o $@ ./cmd/thalos/ tools : build/thalos-tools From 1b1e6a1e3364a7c6d17eebdb15bfe339a83e1b75 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Fri, 19 Jul 2024 13:42:07 +0200 Subject: [PATCH 04/68] cmd/thalos/server.go: move chainInfoOnce to its own file --- cmd/thalos/antelope_api_helpers.go | 35 ++++++++++++++++++++++++++++++ cmd/thalos/server.go | 27 ----------------------- 2 files changed, 35 insertions(+), 27 deletions(-) create mode 100644 cmd/thalos/antelope_api_helpers.go diff --git a/cmd/thalos/antelope_api_helpers.go b/cmd/thalos/antelope_api_helpers.go new file mode 100644 index 0000000..0096143 --- /dev/null +++ b/cmd/thalos/antelope_api_helpers.go @@ -0,0 +1,35 @@ +package main + +import ( + "context" + "time" + + antelopeapi "github.com/shufflingpixels/antelope-go/api" + log "github.com/sirupsen/logrus" +) + +// "Clever" way to make sure we only call the api once. +// Store a info pointer outside the returned closure. +// that pointer will live as long as the closure lives. +// and inside the closure we will reference the pointer and only +// call the api if it is nil. +func chainInfoOnce(api *antelopeapi.Client) func() *antelopeapi.Info { + var info *antelopeapi.Info + return func() *antelopeapi.Info { + if info == nil { + log.WithField("api", api.Url).Info("Get chain info from api") + + ctx, cancel := context.WithTimeout(context.Background(), time.Second*10) + defer cancel() + + result, err := api.GetInfo(ctx) + if err != nil { + log.WithError(err).Fatal("Failed to call eos api") + return nil + } + + info = &result + } + return info + } +} diff --git a/cmd/thalos/server.go b/cmd/thalos/server.go index 0fa0c4a..44d0b0d 100644 --- a/cmd/thalos/server.go +++ b/cmd/thalos/server.go @@ -243,33 +243,6 @@ func GetConfig(flags *pflag.FlagSet) (*config.Config, error) { return cfg, nil } -// "Clever" way to make sure we only call the api once. -// Store a info pointer outside the returned closure. -// that pointer will live as long as the closure lives. -// and inside the closure we will reference the pointer and only -// call the api if it is nil. -func chainInfoOnce(api *antelopeapi.Client) func() *antelopeapi.Info { - var info *antelopeapi.Info - return func() *antelopeapi.Info { - if info == nil { - - log.WithField("api", api.Url).Info("Get chain info from api") - - ctx, cancel := context.WithTimeout(context.Background(), time.Second*10) - defer cancel() - - result, err := api.GetInfo(ctx) - if err != nil { - log.WithError(err).Fatal("Failed to call eos api") - return nil - } - - info = &result - } - return info - } -} - func ConnectRedis(conf *config.RedisConfig) (*redis.Client, error) { logEntry := log.WithFields(log.Fields{ "addr": conf.Addr, From dccd7c0520ff7e47a03232bfe8e29eb9c55911f4 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Fri, 19 Jul 2024 13:48:59 +0200 Subject: [PATCH 05/68] internal/config/builder_test.go: fix syntax error --- internal/config/builder_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/config/builder_test.go b/internal/config/builder_test.go index 1de8eb8..772f78b 100644 --- a/internal/config/builder_test.go +++ b/internal/config/builder_test.go @@ -5,6 +5,7 @@ import ( "testing" "time" + shipclient "github.com/eosswedenorg-go/antelope-ship-client" "github.com/eosswedenorg/thalos/internal/log" "github.com/eosswedenorg/thalos/internal/types" "github.com/stretchr/testify/require" @@ -95,7 +96,6 @@ func TestBuilder_WithDefaultConfig(t *testing.T) { MaxTime: time.Hour * 24, FileTimestampFormat: "2006-01-02_150405", }, - }, Ship: ShipConfig{ Url: "ws://127.0.0.1:8080", StartBlockNum: shipclient.NULL_BLOCK_NUMBER, From b60436c48a9006c9e52608e1e9fb4f6f77db4cb6 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Sun, 21 Jul 2024 12:50:41 +0200 Subject: [PATCH 06/68] config: adding AbiCache --- internal/config/builder.go | 3 +++ internal/config/builder_test.go | 12 ++++++++++++ internal/config/cli.go | 3 +++ internal/config/config.go | 8 ++++++++ 4 files changed, 26 insertions(+) diff --git a/internal/config/builder.go b/internal/config/builder.go index 2967f63..3941012 100644 --- a/internal/config/builder.go +++ b/internal/config/builder.go @@ -40,6 +40,9 @@ func NewBuilder() *Builder { "telegram.id": "telegram-id", "telegram.channel": "telegram-channel", + // AbiCache + "abi_cache.api_timeout": "abi-cache-api-timeout", + // Log "log.maxfilesize": "log-max-filesize", "log.maxtime": "log-max-time", diff --git a/internal/config/builder_test.go b/internal/config/builder_test.go index 772f78b..8a02880 100644 --- a/internal/config/builder_test.go +++ b/internal/config/builder_test.go @@ -23,6 +23,9 @@ func TestBuilder(t *testing.T) { MaxTime: 30 * time.Minute, FileTimestampFormat: "20060102@150405", }, + AbiCache: AbiCache{ + ApiTimeout: time.Minute * 300, + }, Ship: ShipConfig{ Url: "127.0.0.1:8089", StartBlockNum: 23671836, @@ -53,6 +56,8 @@ func TestBuilder(t *testing.T) { name: "ship-reader-1" api: "http://127.0.0.1:8080" message_codec: "mojibake" +abi_cache: + api_timeout: 300m log: filename: some_file.log directory: /path/to/whatever @@ -96,6 +101,9 @@ func TestBuilder_WithDefaultConfig(t *testing.T) { MaxTime: time.Hour * 24, FileTimestampFormat: "2006-01-02_150405", }, + AbiCache: AbiCache{ + ApiTimeout: time.Second, + }, Ship: ShipConfig{ Url: "ws://127.0.0.1:8080", StartBlockNum: shipclient.NULL_BLOCK_NUMBER, @@ -133,6 +141,7 @@ func TestBuilder_Flags(t *testing.T) { require.NoError(t, flags.Set("redis-password", "secret123")) require.NoError(t, flags.Set("redis-db", "3")) require.NoError(t, flags.Set("redis-prefix", "custom-prefix")) + require.NoError(t, flags.Set("abi-cache-api-timeout", "16h")) require.NoError(t, flags.Set("telegram-id", "72983126312982618")) require.NoError(t, flags.Set("telegram-channel", "-293492332")) require.NoError(t, flags.Set("log-max-filesize", "25mb")) @@ -160,6 +169,9 @@ func TestBuilder_Flags(t *testing.T) { MaxTime: time.Minute * 10, FileTimestampFormat: "0102-15:04:05", }, + AbiCache: AbiCache{ + ApiTimeout: time.Hour * 16, + }, Ship: ShipConfig{ Url: "ws://myship.com:7823", StartBlockNum: 7327833, diff --git a/internal/config/cli.go b/internal/config/cli.go index 85d8f39..b7c90ce 100644 --- a/internal/config/cli.go +++ b/internal/config/cli.go @@ -25,6 +25,9 @@ func GetFlags() *pflag.FlagSet { flags.String("telegram-id", "", "Id of telegram bot") flags.Int64("telegram-channel", 0, "Telegram channel to send notifications to") + // AbiCache + flags.Duration("abi-cache-api-timeout", time.Second, "") + // Log flags.StringP("log", "l", "", "Path to log file (default: print to stdout/stderr)") flags.String("log-max-filesize", "10mb", "Max filesize for logfile to rotate") diff --git a/internal/config/config.go b/internal/config/config.go index 7bb8b4b..6f60465 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -1,6 +1,8 @@ package config import ( + "time" + "github.com/eosswedenorg/thalos/internal/log" "github.com/eosswedenorg/thalos/internal/types" ) @@ -18,6 +20,10 @@ type TelegramConfig struct { Channel int64 `yaml:"channel" mapstructure:"channel"` } +type AbiCache struct { + ApiTimeout time.Duration `yaml:"api_timeout" mapstructure:"api_timeout"` +} + type ShipConfig struct { Url string `yaml:"url" mapstructure:"url"` IrreversibleOnly bool `yaml:"irreversible_only" mapstructure:"irreversible_only"` @@ -39,5 +45,7 @@ type Config struct { Redis RedisConfig `yaml:"redis" mapstructure:"redis"` MessageCodec string `yaml:"message_codec" mapstructure:"message_codec"` + AbiCache AbiCache `yaml:"abi_cache" mapstructure:"abi_cache"` + Telegram TelegramConfig `yaml:"telegram" mapstructure:"telegram"` } From ec40e954f26d44a78ae5b206ce30e86f877ee931 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Sun, 21 Jul 2024 12:51:54 +0200 Subject: [PATCH 07/68] internal/abi/manager.go: Use config.AbiCache to configure the manager --- cmd/thalos/server.go | 6 +++--- internal/abi/manager.go | 7 +++++-- internal/abi/manager_test.go | 14 ++++++++++++-- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/cmd/thalos/server.go b/cmd/thalos/server.go index 44d0b0d..b009e0a 100644 --- a/cmd/thalos/server.go +++ b/cmd/thalos/server.go @@ -155,9 +155,9 @@ func LogLevels() []string { return list } -func initAbiManager(api *antelopeapi.Client, store cache.Store, chain_id string) *abi.AbiManager { +func initAbiManager(cfg *config.AbiCache, api *antelopeapi.Client, store cache.Store, chain_id string) *abi.AbiManager { cache := cache.NewCache("thalos::cache::abi::"+chain_id, store) - return abi.NewAbiManager(cache, api) + return abi.NewAbiManager(cfg, cache, api) } func stateLoader(conf *config.Config, start_block_flag *pflag.Flag, chainInfo func() *antelopeapi.Info, cache *cache.Cache, current_block_no_cache bool) StateLoader { @@ -386,7 +386,7 @@ func serverCmd(cmd *cobra.Command, args []string) { Prefix: conf.Redis.Prefix, ChainID: chain_id, }), - initAbiManager(antelopeClient, cacheStore, chain_id), + initAbiManager(&conf.AbiCache, antelopeClient, cacheStore, chain_id), codec, ) diff --git a/internal/abi/manager.go b/internal/abi/manager.go index 8d3acc3..3df1cdb 100644 --- a/internal/abi/manager.go +++ b/internal/abi/manager.go @@ -6,22 +6,25 @@ import ( "time" "github.com/eosswedenorg/thalos/internal/cache" + "github.com/eosswedenorg/thalos/internal/config" "github.com/shufflingpixels/antelope-go/api" "github.com/shufflingpixels/antelope-go/chain" ) // AbiManager handles an ABI cache that fetches the ABI from an API on cache miss. type AbiManager struct { + cfg *config.AbiCache cache *cache.Cache api *api.Client ctx context.Context } // Create a new ABI Manager -func NewAbiManager(cache *cache.Cache, api *api.Client) *AbiManager { +func NewAbiManager(cfg *config.AbiCache, cache *cache.Cache, api *api.Client) *AbiManager { return &AbiManager{ cache: cache, api: api, + cfg: cfg, ctx: context.Background(), } } @@ -38,7 +41,7 @@ func (mgr *AbiManager) SetAbi(account chain.Name, abi *chain.Abi) error { func (mgr *AbiManager) GetAbi(account chain.Name) (*chain.Abi, error) { var abi chain.Abi if err := mgr.cacheGet(account, &abi); err != nil { - ctx, cancel := context.WithTimeout(mgr.ctx, time.Second) + ctx, cancel := context.WithTimeout(mgr.ctx, mgr.cfg.ApiTimeout) defer cancel() resp, err := mgr.api.GetAbi(ctx, account.String()) if err != nil { diff --git a/internal/abi/manager_test.go b/internal/abi/manager_test.go index a523c6e..2606ec1 100644 --- a/internal/abi/manager_test.go +++ b/internal/abi/manager_test.go @@ -6,11 +6,13 @@ import ( "net/http" "net/http/httptest" "testing" + "time" "github.com/shufflingpixels/antelope-go/api" "github.com/shufflingpixels/antelope-go/chain" "github.com/eosswedenorg/thalos/internal/cache" + "github.com/eosswedenorg/thalos/internal/config" "github.com/stretchr/testify/assert" ) @@ -132,12 +134,16 @@ func mockAPI(handler http.HandlerFunc) (*api.Client, *httptest.Server) { } func TestManager_GetAbiFromCache(t *testing.T) { + cfg := &config.AbiCache{ + ApiTimeout: time.Second, + } + cache := cache.NewCache("thalos::cache::abi::test", cache.NewMemoryStore()) api, _ := mockAPI(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { })) - mgr := NewAbiManager(cache, api) + mgr := NewAbiManager(cfg, cache, api) abi := chain.Abi{} err := json.Unmarshal([]byte(abiString), &abi) @@ -152,6 +158,10 @@ func TestManager_GetAbiFromCache(t *testing.T) { } func TestManager_GetAbiFromAPI(t *testing.T) { + cfg := &config.AbiCache{ + ApiTimeout: time.Second, + } + cache := cache.NewCache("thalos::cache::abi::test", cache.NewMemoryStore()) api, _ := mockAPI(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { @@ -161,7 +171,7 @@ func TestManager_GetAbiFromAPI(t *testing.T) { assert.NoError(t, err) })) - mgr := NewAbiManager(cache, api) + mgr := NewAbiManager(cfg, cache, api) c_abi, err := mgr.GetAbi(chain.N("testaccount")) assert.NoError(t, err) From 2f31eb47d4f89ac4f790371f5ff94c92f8da93d6 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Tue, 23 Jul 2024 16:31:18 +0200 Subject: [PATCH 08/68] cache: adding factory --- go.mod | 1 + go.sum | 2 ++ internal/cache/factory.go | 26 ++++++++++++++++++++++++++ internal/cache/factory_test.go | 20 ++++++++++++++++++++ 4 files changed, 49 insertions(+) create mode 100644 internal/cache/factory.go create mode 100644 internal/cache/factory_test.go diff --git a/go.mod b/go.mod index 33424c3..f58ad62 100644 --- a/go.mod +++ b/go.mod @@ -10,6 +10,7 @@ require ( github.com/eosswedenorg/thalos/api v1.0.0 github.com/go-redis/cache/v9 v9.0.0 github.com/go-redis/redismock/v9 v9.2.0 + github.com/karlseguin/typed v1.1.8 github.com/mitchellh/mapstructure v1.5.0 github.com/nikoksr/notify v0.41.0 github.com/redis/go-redis/v9 v9.5.1 diff --git a/go.sum b/go.sum index 936dfc8..4797ab2 100644 --- a/go.sum +++ b/go.sum @@ -76,6 +76,8 @@ github.com/jordan-wright/email v4.0.1-0.20210109023952-943e75fe5223+incompatible github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/karlseguin/typed v1.1.8 h1:ND0eDpwiUFIrm/n1ehxUyh/XNGs9zkYrLxtGqENSalY= +github.com/karlseguin/typed v1.1.8/go.mod h1:pZlmYaWQ7MVpwfIOP88fASh3LopVxKeE+uNXW3hQ2D8= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/klauspost/compress v1.17.8 h1:YcnTYrq7MikUT7k0Yb5eceMmALQPYBW/Xltxn0NAMnU= github.com/klauspost/compress v1.17.8/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= diff --git a/internal/cache/factory.go b/internal/cache/factory.go new file mode 100644 index 0000000..bdde3a9 --- /dev/null +++ b/internal/cache/factory.go @@ -0,0 +1,26 @@ +package cache + +import ( + "fmt" + + "github.com/karlseguin/typed" +) + +type Factory func(opts typed.Typed) (Store, error) + +var factories = map[string]Factory{ + "memory": func(opts typed.Typed) (Store, error) { + return NewMemoryStore(), nil + }, +} + +func RegisterFactory(driver string, factory Factory) { + factories[driver] = factory +} + +func Make(driver string, opts typed.Typed) (Store, error) { + if factory, ok := factories[driver]; ok { + return factory(opts) + } + return nil, fmt.Errorf("Invalid cache storage: %s", driver) +} diff --git a/internal/cache/factory_test.go b/internal/cache/factory_test.go new file mode 100644 index 0000000..af0d266 --- /dev/null +++ b/internal/cache/factory_test.go @@ -0,0 +1,20 @@ +package cache_test + +import ( + "testing" + + "github.com/eosswedenorg/thalos/internal/cache" + "github.com/stretchr/testify/require" +) + +func TestFactory_Make(t *testing.T) { + store, err := cache.Make("memory", map[string]any{}) + require.NoError(t, err) + require.Equal(t, cache.NewMemoryStore(), store) +} + +func TestFactory_MakeInvalidDriver(t *testing.T) { + store, err := cache.Make("87923yus", map[string]any{}) + require.Error(t, err) + require.Nil(t, store) +} From d1d4bf58b1f2b263fca44b0859bb57668ab5fc91 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Tue, 23 Jul 2024 16:31:40 +0200 Subject: [PATCH 09/68] cache: adding factory method for redis --- internal/cache/redis_store.go | 28 +++++++++++++++++++++++++ internal/cache/redis_store_test.go | 33 ++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) diff --git a/internal/cache/redis_store.go b/internal/cache/redis_store.go index 54d7f4d..d8101ad 100644 --- a/internal/cache/redis_store.go +++ b/internal/cache/redis_store.go @@ -5,18 +5,46 @@ import ( "time" "github.com/go-redis/cache/v9" + "github.com/karlseguin/typed" + "github.com/redis/go-redis/v9" ) type RedisStore struct { c *cache.Cache } +type options struct { + Stats bool + Size int + TTL time.Duration +} + func NewRedisStore(options *cache.Options) *RedisStore { return &RedisStore{ c: cache.New(options), } } +func getOptions(opts typed.Typed) options { + return options{ + Stats: opts.Bool("stats"), + Size: opts.IntOr("size", 1000), + TTL: time.Duration(opts.IntOr("ttl", 10)) * time.Minute, + } +} + +func NewRedisFactory(client *redis.Client) Factory { + return func(opts typed.Typed) (Store, error) { + o := getOptions(opts) + + return NewRedisStore(&cache.Options{ + Redis: client, + StatsEnabled: o.Stats, + LocalCache: cache.NewTinyLFU(o.Size, o.TTL), + }), nil + } +} + func (s *RedisStore) Get(ctx context.Context, key string, value interface{}) error { return s.c.Get(ctx, key, value) } diff --git a/internal/cache/redis_store_test.go b/internal/cache/redis_store_test.go index f12cc33..7d4c7c3 100644 --- a/internal/cache/redis_store_test.go +++ b/internal/cache/redis_store_test.go @@ -6,6 +6,7 @@ import ( "time" "github.com/go-redis/redismock/v9" + "github.com/karlseguin/typed" redis_cache "github.com/go-redis/cache/v9" "github.com/stretchr/testify/assert" @@ -16,6 +17,38 @@ type testItem struct { Name string } +func TestRedisStore_getOptionsDefaults(t *testing.T) { + opts := typed.Typed{} + + expected := options{ + Stats: false, + Size: 1000, + TTL: 10 * time.Minute, + } + + actual := getOptions(opts) + + assert.Equal(t, expected, actual) +} + +func TestRedisStore_getOptions(t *testing.T) { + opts := typed.Typed{ + "stats": true, + "size": 123, + "ttl": 60, + } + + expected := options{ + Stats: true, + Size: 123, + TTL: 60 * time.Minute, + } + + actual := getOptions(opts) + + assert.Equal(t, expected, actual) +} + func TestRedisStore_Set(t *testing.T) { client, mock := redismock.NewClientMock() From ebbaf6e2c1df7fac687cce4fd4a7945021b1956c Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Tue, 23 Jul 2024 16:46:02 +0200 Subject: [PATCH 10/68] internal/config: Adding cache configuration --- internal/config/builder.go | 2 ++ internal/config/builder_test.go | 22 ++++++++++++++++++++++ internal/config/cli.go | 3 +++ internal/config/config.go | 8 ++++++++ 4 files changed, 35 insertions(+) diff --git a/internal/config/builder.go b/internal/config/builder.go index 3941012..6429f24 100644 --- a/internal/config/builder.go +++ b/internal/config/builder.go @@ -40,6 +40,8 @@ func NewBuilder() *Builder { "telegram.id": "telegram-id", "telegram.channel": "telegram-channel", + "cache.storage": "cache", + // AbiCache "abi_cache.api_timeout": "abi-cache-api-timeout", diff --git a/internal/config/builder_test.go b/internal/config/builder_test.go index 8a02880..234776a 100644 --- a/internal/config/builder_test.go +++ b/internal/config/builder_test.go @@ -8,6 +8,7 @@ import ( shipclient "github.com/eosswedenorg-go/antelope-ship-client" "github.com/eosswedenorg/thalos/internal/log" "github.com/eosswedenorg/thalos/internal/types" + "github.com/karlseguin/typed" "github.com/stretchr/testify/require" ) @@ -23,6 +24,14 @@ func TestBuilder(t *testing.T) { MaxTime: 30 * time.Minute, FileTimestampFormat: "20060102@150405", }, + Cache: Cache{ + Storage: "memcached", + Options: typed.Typed{ + "ttl": "300m", + "size": 400, + "super_fast_mode": true, + }, + }, AbiCache: AbiCache{ ApiTimeout: time.Minute * 300, }, @@ -56,6 +65,12 @@ func TestBuilder(t *testing.T) { name: "ship-reader-1" api: "http://127.0.0.1:8080" message_codec: "mojibake" +cache: + storage: memcached + options: + ttl: 300m + size: 400 + super_fast_mode: true abi_cache: api_timeout: 300m log: @@ -101,6 +116,9 @@ func TestBuilder_WithDefaultConfig(t *testing.T) { MaxTime: time.Hour * 24, FileTimestampFormat: "2006-01-02_150405", }, + Cache: Cache{ + Storage: "redis", + }, AbiCache: AbiCache{ ApiTimeout: time.Second, }, @@ -141,6 +159,7 @@ func TestBuilder_Flags(t *testing.T) { require.NoError(t, flags.Set("redis-password", "secret123")) require.NoError(t, flags.Set("redis-db", "3")) require.NoError(t, flags.Set("redis-prefix", "custom-prefix")) + require.NoError(t, flags.Set("cache", "memcached")) require.NoError(t, flags.Set("abi-cache-api-timeout", "16h")) require.NoError(t, flags.Set("telegram-id", "72983126312982618")) require.NoError(t, flags.Set("telegram-channel", "-293492332")) @@ -169,6 +188,9 @@ func TestBuilder_Flags(t *testing.T) { MaxTime: time.Minute * 10, FileTimestampFormat: "0102-15:04:05", }, + Cache: Cache{ + Storage: "memcached", + }, AbiCache: AbiCache{ ApiTimeout: time.Hour * 16, }, diff --git a/internal/config/cli.go b/internal/config/cli.go index b7c90ce..de35a92 100644 --- a/internal/config/cli.go +++ b/internal/config/cli.go @@ -25,6 +25,9 @@ func GetFlags() *pflag.FlagSet { flags.String("telegram-id", "", "Id of telegram bot") flags.Int64("telegram-channel", 0, "Telegram channel to send notifications to") + // Cache + flags.String("cache", "redis", "What cache driver to use") + // AbiCache flags.Duration("abi-cache-api-timeout", time.Second, "") diff --git a/internal/config/config.go b/internal/config/config.go index 6f60465..e1d815e 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -5,6 +5,7 @@ import ( "github.com/eosswedenorg/thalos/internal/log" "github.com/eosswedenorg/thalos/internal/types" + "github.com/karlseguin/typed" ) type RedisConfig struct { @@ -15,6 +16,11 @@ type RedisConfig struct { Prefix string `yaml:"prefix"` } +type Cache struct { + Storage string `yaml:"storage" mapstructure:"storage"` + Options typed.Typed `yaml:"options" mapstructure:"options"` +} + type TelegramConfig struct { Id string `yaml:"id" mapstructure:"id"` Channel int64 `yaml:"channel" mapstructure:"channel"` @@ -42,6 +48,8 @@ type Config struct { Log log.Config `yaml:"log" mapstructure:"log"` + Cache Cache `yaml:"cache" mapstructure:"cache"` + Redis RedisConfig `yaml:"redis" mapstructure:"redis"` MessageCodec string `yaml:"message_codec" mapstructure:"message_codec"` From 8a938c3f9e2450a2f197bff527fb02e680b5218b Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Tue, 23 Jul 2024 18:34:30 +0200 Subject: [PATCH 11/68] cmd/thalos/server.go: use factory and config to create cache store --- cmd/thalos/server.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/cmd/thalos/server.go b/cmd/thalos/server.go index b009e0a..5813aee 100644 --- a/cmd/thalos/server.go +++ b/cmd/thalos/server.go @@ -26,7 +26,6 @@ import ( driver "github.com/eosswedenorg/thalos/internal/driver/redis" . "github.com/eosswedenorg/thalos/internal/log" . "github.com/eosswedenorg/thalos/internal/server" - redis_cache "github.com/go-redis/cache/v9" "github.com/nikoksr/notify" "github.com/nikoksr/notify/service/telegram" "github.com/redis/go-redis/v9" @@ -346,12 +345,14 @@ func serverCmd(cmd *cobra.Command, args []string) { return } + cache.RegisterFactory("redis", cache.NewRedisFactory(rdb)) + // Setup cache storage - cacheStore := cache.NewRedisStore(&redis_cache.Options{ - Redis: rdb, - // Cache 10k keys for 10 minutes. - LocalCache: redis_cache.NewTinyLFU(10000, 10*time.Minute), - }) + cacheStore, err := cache.Make(conf.Cache.Storage, conf.Cache.Options) + if err != nil { + log.WithError(err).Fatal("Failed to setup cache") + return + } // Setup general cache cache := cache.NewCache("thalos::cache::instance::"+conf.Name, cacheStore) From b7e0cb7b56f54d87d1953248e4346cfe449ab152 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Tue, 23 Jul 2024 22:09:00 +0200 Subject: [PATCH 12/68] adding .github/workflows/devbuild.yaml --- .github/workflows/devbuild.yaml | 79 +++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 .github/workflows/devbuild.yaml diff --git a/.github/workflows/devbuild.yaml b/.github/workflows/devbuild.yaml new file mode 100644 index 0000000..6a04233 --- /dev/null +++ b/.github/workflows/devbuild.yaml @@ -0,0 +1,79 @@ +name: Development build + +on: + push: + branches: [ dev ] + +jobs: + cross-compile: + strategy: + fail-fast: false + matrix: + os: [ linux, freebsd ] + arch: [ 386, amd64, arm, arm64 ] + name: Crosscompile - ${{matrix.os}}-${{matrix.arch}} + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: 1.21 + + - name: compile + id: compile + run: | + VER=$(cat Makefile | grep 'PROGRAM_VERSION=' | sed 's/PROGRAM_VERSION=//g') + GOOS=${{matrix.os}} GOARCH=${{matrix.arch}} PROGRAM_VERSION="${VER}-${GITHUB_SHA}" make build tools + + - name: Upload thalos-server + uses: actions/upload-artifact@v4 + with: + name: thalos-server-${{github.sha}}-${{matrix.os}}-${{matrix.arch}} + path: build/thalos-server + retention-days: 7 + + - name: Upload thalos-tools + uses: actions/upload-artifact@v4 + with: + name: thalos-tools-${{github.sha}}-${{matrix.os}}-${{matrix.arch}} + path: build/thalos-tools + retention-days: 7 + + # Build thalos binaries that are linked with musl libc. + musl: + strategy: + fail-fast: false + matrix: + arch: [ 386, amd64, arm, arm64 ] + runs-on: ubuntu-latest + name: musl (${{ matrix.arch }}) + container: + image: golang:1.21-alpine3.19 + steps: + - uses: actions/checkout@v4 + + - name: install dependencies + run: apk add make + + - name: compile + id: compile + run: | + VER=$(cat Makefile | grep 'PROGRAM_VERSION=' | sed 's/PROGRAM_VERSION=//g') + GOOS=${{matrix.os}} GOARCH=${{matrix.arch}} PROGRAM_VERSION="${VER}-${GITHUB_SHA}" make build tools + + - name: Upload thalos-server + uses: actions/upload-artifact@v4 + with: + name: thalos-server-${{github.sha}}-linux-${{matrix.arch}}-musl + path: build/thalos-server + retention-days: 7 + + - name: Upload thalos-tools + uses: actions/upload-artifact@v4 + with: + name: thalos-tools-${{github.sha}}-linux-${{matrix.arch}}-musl + path: build/thalos-tools + retention-days: 7 + From e8b90dab7755ffba258e22a6249555f46cd51a95 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Wed, 24 Jul 2024 00:22:14 +0200 Subject: [PATCH 13/68] Makefile: only set PROGRAM_VERSION if its unset --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 63dd23a..73b8b87 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ GO=go GOLDFLAGS=-v -s -w -X main.VersionString=$(PROGRAM_VERSION) GOBUILDFLAGS=-v -p $(shell nproc) -ldflags="$(GOLDFLAGS)" PROGRAM=thalos-server -PROGRAM_VERSION=1.1.4 +PROGRAM_VERSION ?= 1.1.4 PREFIX=/usr/local BINDIR=$(PREFIX)/bin CFGDIR=$(PREFIX)/etc/thalos From 9778fa86108eb243724d6bef194150fcf9f06ad2 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Wed, 24 Jul 2024 00:45:16 +0200 Subject: [PATCH 14/68] .github/workflows/devbuild.yaml: fix version string bash stuff :) --- .github/workflows/devbuild.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/devbuild.yaml b/.github/workflows/devbuild.yaml index 6a04233..b8897d0 100644 --- a/.github/workflows/devbuild.yaml +++ b/.github/workflows/devbuild.yaml @@ -24,8 +24,8 @@ jobs: - name: compile id: compile run: | - VER=$(cat Makefile | grep 'PROGRAM_VERSION=' | sed 's/PROGRAM_VERSION=//g') - GOOS=${{matrix.os}} GOARCH=${{matrix.arch}} PROGRAM_VERSION="${VER}-${GITHUB_SHA}" make build tools + VER=$(cat Makefile | sed -n 's/^PROGRAM_VERSION\s*\(\?\)\s*=\s*//p') + GOOS=${{matrix.os}} GOARCH=${{matrix.arch}} PROGRAM_VERSION="${VER}-$(echo $GITHUB_SHA | cut -b -8)" make build tools - name: Upload thalos-server uses: actions/upload-artifact@v4 @@ -60,8 +60,8 @@ jobs: - name: compile id: compile run: | - VER=$(cat Makefile | grep 'PROGRAM_VERSION=' | sed 's/PROGRAM_VERSION=//g') - GOOS=${{matrix.os}} GOARCH=${{matrix.arch}} PROGRAM_VERSION="${VER}-${GITHUB_SHA}" make build tools + VER=$(cat Makefile | sed -n 's/^PROGRAM_VERSION\s*\(\?\)\s*=\s*//p') + GOOS=${{matrix.os}} GOARCH=${{matrix.arch}} PROGRAM_VERSION="${VER}-$(echo $GITHUB_SHA | cut -b -8)" make build tools - name: Upload thalos-server uses: actions/upload-artifact@v4 From ec874430c326d4a48b90c4e8138ddb046364664a Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Wed, 24 Jul 2024 00:53:24 +0200 Subject: [PATCH 15/68] .github/workflows/devbuild.yaml: improve the sed expression. --- .github/workflows/devbuild.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/devbuild.yaml b/.github/workflows/devbuild.yaml index b8897d0..3af1d58 100644 --- a/.github/workflows/devbuild.yaml +++ b/.github/workflows/devbuild.yaml @@ -24,7 +24,7 @@ jobs: - name: compile id: compile run: | - VER=$(cat Makefile | sed -n 's/^PROGRAM_VERSION\s*\(\?\)\s*=\s*//p') + VER=$(cat Makefile | sed -n 's/^PROGRAM_VERSION\s*\??=\s*//p') GOOS=${{matrix.os}} GOARCH=${{matrix.arch}} PROGRAM_VERSION="${VER}-$(echo $GITHUB_SHA | cut -b -8)" make build tools - name: Upload thalos-server @@ -60,7 +60,7 @@ jobs: - name: compile id: compile run: | - VER=$(cat Makefile | sed -n 's/^PROGRAM_VERSION\s*\(\?\)\s*=\s*//p') + VER=$(cat Makefile | sed -n 's/^PROGRAM_VERSION\s*\??=\s*//p') GOOS=${{matrix.os}} GOARCH=${{matrix.arch}} PROGRAM_VERSION="${VER}-$(echo $GITHUB_SHA | cut -b -8)" make build tools - name: Upload thalos-server From e038be5324aec6372d89b67fc3762474c942dddf Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Thu, 25 Jul 2024 12:21:53 +0200 Subject: [PATCH 16/68] .github/workflows/devbuild.yaml: update names --- .github/workflows/devbuild.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/devbuild.yaml b/.github/workflows/devbuild.yaml index 3af1d58..73ba184 100644 --- a/.github/workflows/devbuild.yaml +++ b/.github/workflows/devbuild.yaml @@ -11,7 +11,7 @@ jobs: matrix: os: [ linux, freebsd ] arch: [ 386, amd64, arm, arm64 ] - name: Crosscompile - ${{matrix.os}}-${{matrix.arch}} + name: ${{matrix.os}} (${{matrix.arch}}) runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v4 From 18a8feea9efd500b9b4ef7731a00d5cf6a1f0cca Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Thu, 25 Jul 2024 19:36:51 +0200 Subject: [PATCH 17/68] make: no need to use find, can specify the directory where the go files are --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 73b8b87..e0a62f0 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,7 @@ build/$(PROGRAM) : tools : build/thalos-tools build/thalos-tools : - $(GO) build $(GOBUILDFLAGS) -o $@ $(shell find cmd/tools -type f -name *.go) + $(GO) build $(GOBUILDFLAGS) -o $@ ./cmd/tools/ docker-image: docker image build --build-arg VERSION=$(PROGRAM_VERSION) -t $(DOCKER_IMAGE_REPO):$(DOCKER_IMAGE_TAG) docker From ecdde63f68ab80577749f501320c9965039a1668 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Sun, 28 Jul 2024 14:45:33 +0200 Subject: [PATCH 18/68] internal/config/cli.go: set description for abi-cache-api-timeout flag --- internal/config/cli.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/config/cli.go b/internal/config/cli.go index de35a92..a23794a 100644 --- a/internal/config/cli.go +++ b/internal/config/cli.go @@ -29,7 +29,7 @@ func GetFlags() *pflag.FlagSet { flags.String("cache", "redis", "What cache driver to use") // AbiCache - flags.Duration("abi-cache-api-timeout", time.Second, "") + flags.Duration("abi-cache-api-timeout", time.Second, "Duration before the api call times out when the ABI cache requests an abi.") // Log flags.StringP("log", "l", "", "Path to log file (default: print to stdout/stderr)") From 4bf589647c501586115fbfe23513d975731f12f4 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Sun, 11 Aug 2024 13:03:55 +0200 Subject: [PATCH 19/68] internal/server/helpers.go: add a comment in empty for loop (as i almost removed it because it was empty) --- internal/server/helpers.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/server/helpers.go b/internal/server/helpers.go index 05a2807..b34bbfc 100644 --- a/internal/server/helpers.go +++ b/internal/server/helpers.go @@ -113,6 +113,7 @@ func isVariant(v reflect.Value) bool { } for v = v.Index(0); v.Kind() == reflect.Interface || v.Kind() == reflect.Pointer; v = v.Elem() { + // Intentionally empty } return v.Kind() == reflect.String && isVariantName(v.String()) From 3d83fcc8690e46f106c2a1ea4cd89cbeb8effc0d Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Sun, 11 Aug 2024 15:41:02 +0200 Subject: [PATCH 20/68] go mod: update antelope-go to v0.1.4 --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index f58ad62..ca4a378 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/mitchellh/mapstructure v1.5.0 github.com/nikoksr/notify v0.41.0 github.com/redis/go-redis/v9 v9.5.1 - github.com/shufflingpixels/antelope-go v0.1.3 + github.com/shufflingpixels/antelope-go v0.1.4 github.com/sirupsen/logrus v1.9.3 github.com/spf13/cobra v1.8.0 github.com/spf13/pflag v1.0.5 diff --git a/go.sum b/go.sum index 4797ab2..41dd453 100644 --- a/go.sum +++ b/go.sum @@ -148,8 +148,8 @@ github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6ke github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4= github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ= -github.com/shufflingpixels/antelope-go v0.1.3 h1:uZ0cCn6vitHZTz7UFy5n8AEv1k37MqzCTLIuAnX346Y= -github.com/shufflingpixels/antelope-go v0.1.3/go.mod h1:Bi+zmFI5s7Qv2hx3v9FAcDyf4N4MUs5zaKNa2CetmSg= +github.com/shufflingpixels/antelope-go v0.1.4 h1:MInk3tEo69OA/U6tZWXGrVzdQhrDFX8UfUkGq1Lq/2Y= +github.com/shufflingpixels/antelope-go v0.1.4/go.mod h1:Bi+zmFI5s7Qv2hx3v9FAcDyf4N4MUs5zaKNa2CetmSg= github.com/shufflingpixels/jsontime-go v0.0.0-20240622163621-cf4b2804c92d h1:nju7jR1Kf210tArPT6l//HlfLLFnvje1BWl5TSRsohQ= github.com/shufflingpixels/jsontime-go v0.0.0-20240622163621-cf4b2804c92d/go.mod h1:W0TaKyg3kDqWmFUxlax3qAls/lRdo12EseM6f4f0dzE= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= From 0e75fb869b55c57738bf68f245b812ffc729d11b Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Sun, 11 Aug 2024 16:14:15 +0200 Subject: [PATCH 21/68] adding internal/ship/contract_row.go --- internal/ship/contract_row.go | 21 ++++++++++++++++++++ internal/ship/contract_row_test.go | 32 ++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 internal/ship/contract_row.go create mode 100644 internal/ship/contract_row_test.go diff --git a/internal/ship/contract_row.go b/internal/ship/contract_row.go new file mode 100644 index 0000000..a5b785f --- /dev/null +++ b/internal/ship/contract_row.go @@ -0,0 +1,21 @@ +package ship + +import ( + "github.com/mitchellh/mapstructure" + "github.com/shufflingpixels/antelope-go/chain" +) + +type ContractRow struct { + Code chain.Name `mapstructure:"code"` + Scope chain.Name `mapstructure:"scope"` + Table chain.Name `mapstructure:"table"` + PrimaryKey string `mapstructure:"primary_key"` + Payer chain.Name `mapstructure:"payer"` + Value chain.Bytes `mapstructure:"value"` +} + +func DecodeContractRow(v map[string]interface{}) (*ContractRow, error) { + out := &ContractRow{} + err := mapstructure.WeakDecode(v, out) + return out, err +} diff --git a/internal/ship/contract_row_test.go b/internal/ship/contract_row_test.go new file mode 100644 index 0000000..6a46be6 --- /dev/null +++ b/internal/ship/contract_row_test.go @@ -0,0 +1,32 @@ +package ship_test + +import ( + "testing" + + "github.com/eosswedenorg/thalos/internal/ship" + "github.com/shufflingpixels/antelope-go/chain" + "github.com/stretchr/testify/assert" +) + +func TestContractRow_Decode(t *testing.T) { + expected := &ship.ContractRow{ + Code: chain.N("eosio"), + Scope: chain.N("scope"), + Table: chain.N("accounts"), + PrimaryKey: "1278127812", + Payer: chain.N("account1"), + Value: []byte{0x01, 0x01, 0x02, 0x03}, + } + + actual, err := ship.DecodeContractRow(map[string]any{ + "code": uint64(6138663577826885632), + "scope": uint64(13990807175891517440), + "table": uint64(3607749779137757184), + "primary_key": uint32(1278127812), + "payer": uint64(3607749778751881216), + "value": []byte{0x01, 0x01, 0x02, 0x03}, + }) + + assert.NoError(t, err) + assert.Equal(t, expected, actual) +} From 2ed95186358b20a296160b488c87b26ddfbacb36 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Sun, 11 Aug 2024 16:51:40 +0200 Subject: [PATCH 22/68] internal/server/helpers.go: refactor some functions to internal/ship --- internal/server/helpers.go | 123 ------------------ internal/server/ship_processor.go | 3 +- internal/ship/table_delta.go | 36 +++++ .../table_delta_test.go} | 5 +- internal/ship/variant.go | 93 +++++++++++++ 5 files changed, 134 insertions(+), 126 deletions(-) create mode 100644 internal/ship/table_delta.go rename internal/{server/helpers_test.go => ship/table_delta_test.go} (93%) create mode 100644 internal/ship/variant.go diff --git a/internal/server/helpers.go b/internal/server/helpers.go index b34bbfc..95ea78d 100644 --- a/internal/server/helpers.go +++ b/internal/server/helpers.go @@ -1,9 +1,6 @@ package server import ( - "fmt" - "reflect" - "github.com/shufflingpixels/antelope-go/ship" ) @@ -28,123 +25,3 @@ func toActionTraceV1(trace *ship.ActionTrace) *ship.ActionTraceV1 { } return trace.V1 } - -func isVariantName(name string) bool { - validVariants := []string{ - "get_status_request_v0", - "block_position", - "get_status_result_v0", - "get_blocks_request_v0", - "get_blocks_ack_request_v0", - "get_blocks_result_v0", - "row", - "table_delta_v0", - "action", - "account_auth_sequence", - "action_receipt_v0", - "account_delta", - "action_trace_v0", - "partial_transaction_v0", - "transaction_trace_v0", - "packed_transaction", - "transaction_receipt_header", - "transaction_receipt", - "extension", - "block_header", - "signed_block_header", - "signed_block", - "transaction_header", - "transaction", - "code_id", - "account_v0", - "account_metadata_v0", - "code_v0", - "contract_table_v0", - "contract_row_v0", - "contract_index64_v0", - "contract_index128_v0", - "contract_index256_v0", - "contract_index_double_v0", - "contract_index_long_double_v0", - "producer_key", - "producer_schedule", - "block_signing_authority_v0", - "producer_authority", - "producer_authority_schedule", - "chain_config_v0", - "global_property_v0", - "global_property_v1", - "generated_transaction_v0", - "activated_protocol_feature_v0", - "protocol_state_v0", - "key_weight", - "permission_level", - "permission_level_weight", - "wait_weight", - "authority", - "permission_v0", - "permission_link_v0", - "resource_limits_v0", - "usage_accumulator_v0", - "resource_usage_v0", - "resource_limits_state_v0", - "resource_limits_ratio_v0", - "elastic_limit_parameters_v0", - "resource_limits_config_v0", - } - - for _, v := range validVariants { - if v == name { - return true - } - } - return false -} - -// Check if a structure is a variant type. -// This is not 100% accurate. As variant types comes -// as a simple slice with the types name in the first index -// and the value as the second. -// So there could be some edge cases where this structure is actual data -// and not a variant type although should be super rare. -func isVariant(v reflect.Value) bool { - if v.Kind() != reflect.Slice || v.Len() != 2 { - return false - } - - for v = v.Index(0); v.Kind() == reflect.Interface || v.Kind() == reflect.Pointer; v = v.Elem() { - // Intentionally empty - } - - return v.Kind() == reflect.String && isVariantName(v.String()) -} - -func parseTableDeltaData(v any) (map[string]interface{}, error) { - iface := parseTableDeltaDataInner(reflect.ValueOf(v)).Interface() - if out, ok := iface.(map[string]interface{}); ok { - return out, nil - } - return nil, fmt.Errorf("data is not an map") -} - -func parseTableDeltaDataInner(v reflect.Value) reflect.Value { - if isVariant(v) { - v = v.Index(1) - } - - switch v.Kind() { - case reflect.Interface: - return parseTableDeltaDataInner(v.Elem()) - case reflect.Slice: - for i := 0; i < v.Len(); i++ { - v.Index(i).Set(parseTableDeltaDataInner(v.Index(i))) - } - case reflect.Map: - it := v.MapRange() - for it.Next() { - v.SetMapIndex(it.Key(), parseTableDeltaDataInner(it.Value())) - } - } - - return v -} diff --git a/internal/server/ship_processor.go b/internal/server/ship_processor.go index 7106f4f..ad56305 100644 --- a/internal/server/ship_processor.go +++ b/internal/server/ship_processor.go @@ -6,6 +6,7 @@ import ( "github.com/eosswedenorg/thalos/api/message" "github.com/eosswedenorg/thalos/internal/abi" "github.com/eosswedenorg/thalos/internal/driver" + ship_helper "github.com/eosswedenorg/thalos/internal/ship" "github.com/eosswedenorg/thalos/internal/types" log "github.com/sirupsen/logrus" @@ -228,7 +229,7 @@ func (processor *ShipProcessor) proccessDeltaRows(logger *log.Entry, table_name v, err := processor.shipABI.Decode(bytes.NewReader(row.Data), table_name) if err == nil { - v, err := parseTableDeltaData(v) + v, err := ship_helper.ParseTableDeltaData(v) if err == nil { msg.Data = v } else { diff --git a/internal/ship/table_delta.go b/internal/ship/table_delta.go new file mode 100644 index 0000000..9d011d3 --- /dev/null +++ b/internal/ship/table_delta.go @@ -0,0 +1,36 @@ +package ship + +import ( + "fmt" + "reflect" +) + +func parseTableDeltaDataInner(v reflect.Value) reflect.Value { + if IsVariant(v) { + v = v.Index(1) + } + + switch v.Kind() { + case reflect.Interface: + return parseTableDeltaDataInner(v.Elem()) + case reflect.Slice: + for i := 0; i < v.Len(); i++ { + v.Index(i).Set(parseTableDeltaDataInner(v.Index(i))) + } + case reflect.Map: + it := v.MapRange() + for it.Next() { + v.SetMapIndex(it.Key(), parseTableDeltaDataInner(it.Value())) + } + } + + return v +} + +func ParseTableDeltaData(v any) (map[string]interface{}, error) { + iface := parseTableDeltaDataInner(reflect.ValueOf(v)).Interface() + if out, ok := iface.(map[string]interface{}); ok { + return out, nil + } + return nil, fmt.Errorf("data is not an map") +} diff --git a/internal/server/helpers_test.go b/internal/ship/table_delta_test.go similarity index 93% rename from internal/server/helpers_test.go rename to internal/ship/table_delta_test.go index fdaf8ff..74b1d03 100644 --- a/internal/server/helpers_test.go +++ b/internal/ship/table_delta_test.go @@ -1,8 +1,9 @@ -package server +package ship_test import ( "testing" + "github.com/eosswedenorg/thalos/internal/ship" "github.com/stretchr/testify/assert" ) @@ -62,7 +63,7 @@ func TestParseTableDeltaData(t *testing.T) { "virtual_net_limit": 1048576000, } - actual, err := parseTableDeltaData(input) + actual, err := ship.ParseTableDeltaData(input) assert.NoError(t, err) assert.Equal(t, expected, actual) diff --git a/internal/ship/variant.go b/internal/ship/variant.go new file mode 100644 index 0000000..56ca7fb --- /dev/null +++ b/internal/ship/variant.go @@ -0,0 +1,93 @@ +package ship + +import "reflect" + +func IsVariantName(name string) bool { + validVariants := []string{ + "get_status_request_v0", + "block_position", + "get_status_result_v0", + "get_blocks_request_v0", + "get_blocks_ack_request_v0", + "get_blocks_result_v0", + "row", + "table_delta_v0", + "action", + "account_auth_sequence", + "action_receipt_v0", + "account_delta", + "action_trace_v0", + "partial_transaction_v0", + "transaction_trace_v0", + "packed_transaction", + "transaction_receipt_header", + "transaction_receipt", + "extension", + "block_header", + "signed_block_header", + "signed_block", + "transaction_header", + "transaction", + "code_id", + "account_v0", + "account_metadata_v0", + "code_v0", + "contract_table_v0", + "contract_row_v0", + "contract_index64_v0", + "contract_index128_v0", + "contract_index256_v0", + "contract_index_double_v0", + "contract_index_long_double_v0", + "producer_key", + "producer_schedule", + "block_signing_authority_v0", + "producer_authority", + "producer_authority_schedule", + "chain_config_v0", + "global_property_v0", + "global_property_v1", + "generated_transaction_v0", + "activated_protocol_feature_v0", + "protocol_state_v0", + "key_weight", + "permission_level", + "permission_level_weight", + "wait_weight", + "authority", + "permission_v0", + "permission_link_v0", + "resource_limits_v0", + "usage_accumulator_v0", + "resource_usage_v0", + "resource_limits_state_v0", + "resource_limits_ratio_v0", + "elastic_limit_parameters_v0", + "resource_limits_config_v0", + } + + for _, v := range validVariants { + if v == name { + return true + } + } + return false +} + +// Check if a structure is a variant type. +// This is not 100% accurate. As variant types comes +// as a simple slice with the types name in the first index +// and the value as the second. +// So there could be some edge cases where this structure is actual data +// and not a variant type although should be super rare. +func IsVariant(v reflect.Value) bool { + if v.Kind() != reflect.Slice || v.Len() != 2 { + return false + } + + for v = v.Index(0); v.Kind() == reflect.Interface || v.Kind() == reflect.Pointer; v = v.Elem() { + // Intentionally empty + } + + return v.Kind() == reflect.String && IsVariantName(v.String()) +} From 67d33a280ef287b999c3d74fa64224298a57018e Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Sun, 11 Aug 2024 16:56:55 +0200 Subject: [PATCH 23/68] move internal/server/helpers.go to internal/ship/action.go --- internal/server/ship_processor.go | 2 +- internal/{server/helpers.go => ship/action.go} | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) rename internal/{server/helpers.go => ship/action.go} (90%) diff --git a/internal/server/ship_processor.go b/internal/server/ship_processor.go index ad56305..654fd55 100644 --- a/internal/server/ship_processor.go +++ b/internal/server/ship_processor.go @@ -120,7 +120,7 @@ func (processor *ShipProcessor) processTransactionTrace(log *log.Entry, blockNum // Actions for _, actionTraceVar := range trace.ActionTraces { - actionTrace := toActionTraceV1(actionTraceVar) + actionTrace := ship_helper.ToActionTraceV1(actionTraceVar) actMsg := processor.proccessActionTrace(logger, actionTrace) if actMsg != nil { actMsg.TxID = trace.ID.String() diff --git a/internal/server/helpers.go b/internal/ship/action.go similarity index 90% rename from internal/server/helpers.go rename to internal/ship/action.go index 95ea78d..8a25a46 100644 --- a/internal/server/helpers.go +++ b/internal/ship/action.go @@ -1,11 +1,11 @@ -package server +package ship import ( "github.com/shufflingpixels/antelope-go/ship" ) // convert a ActionTrace to ActionTraceV1 -func toActionTraceV1(trace *ship.ActionTrace) *ship.ActionTraceV1 { +func ToActionTraceV1(trace *ship.ActionTrace) *ship.ActionTraceV1 { if trace.V0 != nil { // convert to v1 return &ship.ActionTraceV1{ From 14a498d7d6438df7075b8c90570f5b63d9ea1a56 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Sun, 11 Aug 2024 16:59:23 +0200 Subject: [PATCH 24/68] internal/server/ship_processor.go: add WithError() to a logging call --- internal/server/ship_processor.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/server/ship_processor.go b/internal/server/ship_processor.go index 654fd55..6bbff10 100644 --- a/internal/server/ship_processor.go +++ b/internal/server/ship_processor.go @@ -236,7 +236,7 @@ func (processor *ShipProcessor) proccessDeltaRows(logger *log.Entry, table_name logger.WithError(err).Error("Failed to parse table delta data") } } else { - logger.Error("Failed to decode table delta") + logger.WithError(err).Error("Failed to decode table delta") } } else { logger.Warn("No SHIP ABI present") From a892b40cdeb720a381995277ce0b2433f3ae4556 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Sun, 11 Aug 2024 17:03:14 +0200 Subject: [PATCH 25/68] internal/ship/contract_row.go: rename DecodeContractRow to ParseContractRow --- internal/ship/contract_row.go | 2 +- internal/ship/contract_row_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/ship/contract_row.go b/internal/ship/contract_row.go index a5b785f..5449e58 100644 --- a/internal/ship/contract_row.go +++ b/internal/ship/contract_row.go @@ -14,7 +14,7 @@ type ContractRow struct { Value chain.Bytes `mapstructure:"value"` } -func DecodeContractRow(v map[string]interface{}) (*ContractRow, error) { +func ParseContractRow(v map[string]interface{}) (*ContractRow, error) { out := &ContractRow{} err := mapstructure.WeakDecode(v, out) return out, err diff --git a/internal/ship/contract_row_test.go b/internal/ship/contract_row_test.go index 6a46be6..d281732 100644 --- a/internal/ship/contract_row_test.go +++ b/internal/ship/contract_row_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/assert" ) -func TestContractRow_Decode(t *testing.T) { +func TestContractRow_Parse(t *testing.T) { expected := &ship.ContractRow{ Code: chain.N("eosio"), Scope: chain.N("scope"), @@ -18,7 +18,7 @@ func TestContractRow_Decode(t *testing.T) { Value: []byte{0x01, 0x01, 0x02, 0x03}, } - actual, err := ship.DecodeContractRow(map[string]any{ + actual, err := ship.ParseContractRow(map[string]any{ "code": uint64(6138663577826885632), "scope": uint64(13990807175891517440), "table": uint64(3607749779137757184), From 6d7d004b2b16b41c8c5880a8bada2a9d349931c9 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Sun, 11 Aug 2024 17:03:42 +0200 Subject: [PATCH 26/68] internal/ship/contract_row.go: adding DecodeContractRow that actually decodes data from abi --- internal/ship/contract_row.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/internal/ship/contract_row.go b/internal/ship/contract_row.go index 5449e58..f980e90 100644 --- a/internal/ship/contract_row.go +++ b/internal/ship/contract_row.go @@ -1,6 +1,9 @@ package ship import ( + "bytes" + + "github.com/eosswedenorg/thalos/internal/abi" "github.com/mitchellh/mapstructure" "github.com/shufflingpixels/antelope-go/chain" ) @@ -19,3 +22,16 @@ func ParseContractRow(v map[string]interface{}) (*ContractRow, error) { err := mapstructure.WeakDecode(v, out) return out, err } + +func DecodeContractRow(manager *abi.AbiManager, data map[string]any) (any, error) { + row, err := ParseContractRow(data) + if err != nil { + return nil, err + } + + abi, err := manager.GetAbi(row.Code) + if err != nil { + return nil, err + } + return abi.DecodeTable(bytes.NewReader(row.Value), row.Table) +} From fa6508ba90042b83f76c5e2330481cb3ee7c80b5 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Sun, 11 Aug 2024 17:04:06 +0200 Subject: [PATCH 27/68] internal/server/ship_processor.go: try decoding table data for contract_row table deltas --- internal/server/ship_processor.go | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/internal/server/ship_processor.go b/internal/server/ship_processor.go index 6bbff10..e3ab11e 100644 --- a/internal/server/ship_processor.go +++ b/internal/server/ship_processor.go @@ -226,12 +226,20 @@ func (processor *ShipProcessor) proccessDeltaRows(logger *log.Entry, table_name } if processor.shipABI != nil { - v, err := processor.shipABI.Decode(bytes.NewReader(row.Data), table_name) if err == nil { - v, err := ship_helper.ParseTableDeltaData(v) + data, err := ship_helper.ParseTableDeltaData(v) if err == nil { - msg.Data = v + // Decode contract row data + if table_name == "contract_row" { + dec, err := ship_helper.DecodeContractRow(processor.abi, data) + if err != nil { + logger.WithError(err).Warn("Failed to decode contract row") + } else { + data["value"] = dec + } + } + msg.Data = data } else { logger.WithError(err).Error("Failed to parse table delta data") } From aaeb2739ab5308640b815d681fbc9933de13f7b2 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Sun, 11 Aug 2024 17:19:41 +0200 Subject: [PATCH 28/68] config.example.yml: add example for cache section --- config.example.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/config.example.yml b/config.example.yml index 9d6deef..85c289d 100644 --- a/config.example.yml +++ b/config.example.yml @@ -56,6 +56,16 @@ ship: # blacklist_is_whitelist: true +# Configure the cache. +# Default is to use redis. But if you need to +# you can set additional values or even change the driver +# to something else that Thalos supports. +# See the documentation for details + +# cache: +# storage: redis +# options: [] + # Telegram notifications #telegram: # id: "123456789:GPdmGPBWvpgHPxlergJLavus-PoAURTjMWP" From c0c062a1b5aef2338ceb98dc177351a426e7964a Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Sun, 11 Aug 2024 17:27:35 +0200 Subject: [PATCH 29/68] Version 1.1.5-rc1 --- Makefile | 2 +- debian/changelog | 11 +++++++++++ docker/Dockerfile | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index e0a62f0..a139da8 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ GO=go GOLDFLAGS=-v -s -w -X main.VersionString=$(PROGRAM_VERSION) GOBUILDFLAGS=-v -p $(shell nproc) -ldflags="$(GOLDFLAGS)" PROGRAM=thalos-server -PROGRAM_VERSION ?= 1.1.4 +PROGRAM_VERSION ?= 1.1.5-rc1 PREFIX=/usr/local BINDIR=$(PREFIX)/bin CFGDIR=$(PREFIX)/etc/thalos diff --git a/debian/changelog b/debian/changelog index 1771e6e..f423520 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,14 @@ +thalos (1.1.5~rc1) bionic focal jammy; urgency=medium + + * New config section: `cache` + * New CLI flag: `cache` specify what cache driver to use + * New CLI flag: `abi-cache-api-timeout` configure the timeout for the HTTP + request made when Thalos wants to fetch a ABI from the api. + * API Table Deltas: abi decode the data in `value` field for contract_row deltas. + * golang: update github.com/shufflingpixels/antelope-go to v0.1.4 + + -- Henrik Hautakoski Sun, 11 Aug 2024 17:04:55 +0200 + thalos (1.1.4) bionic focal jammy; urgency=medium * Implement whitelist option for ship contract/action blacklist diff --git a/docker/Dockerfile b/docker/Dockerfile index 8f55319..066533c 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,6 +1,6 @@ FROM alpine:latest LABEL maintainer="Henrik Hautakoski " -ARG VERSION=1.1.4 +ARG VERSION=1.1.5-rc1 WORKDIR /thalos ADD --chmod=755 https://github.com/eosswedenorg/thalos/releases/download/v$VERSION/thalos-server-${VERSION}-linux-amd64-musl thalos-server ENTRYPOINT [ "./thalos-server" ] From 48ca5e4f92a4602637554103d11cd13383402381 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Sun, 11 Aug 2024 17:44:39 +0200 Subject: [PATCH 30/68] .github/workflows/release.yml: fix regex that parses the Makefile for version number --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5a93045..29dd27a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,7 +27,7 @@ jobs: mkdir -p build/bundle/{bin,logs} GOOS=${{matrix.os}} GOARCH=${{matrix.arch}} make -e DESTDIR=build/bundle PREFIX= CFGDIR= install install-scripts tar -C build/bundle -z -cf build/bundle.tar.gz . - echo "version=$(sed -n 's/.*PROGRAM_VERSION\s*=\s*//p' Makefile)" >> "$GITHUB_OUTPUT" + echo "version=$(sed -n 's/.*PROGRAM_VERSION.*=\s*//p' Makefile)" >> "$GITHUB_OUTPUT" - name: Upload thalos-server uses: actions/upload-release-asset@v1 From c769b6a700bff63e2282f3c388f9b46cc80d9b78 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Mon, 26 Aug 2024 13:08:58 +0200 Subject: [PATCH 31/68] typo fixes and added comments --- api/client.go | 9 +++++---- api/message/msgpack/codec.go | 2 +- api/reader.go | 2 +- api/redis/namespace.go | 2 +- api/redis/subscriber.go | 2 +- internal/config/cli.go | 1 + internal/server/message_queue.go | 2 +- 7 files changed, 11 insertions(+), 9 deletions(-) diff --git a/api/client.go b/api/client.go index 9157af0..ad01497 100644 --- a/api/client.go +++ b/api/client.go @@ -11,7 +11,7 @@ import ( type handler func([]byte) -// Client reads and decodes messages from a reader and posts thems to a go channel +// Client reads and decodes messages from a reader and posts them to a go channel type Client struct { reader Reader decoder message.Decoder @@ -35,6 +35,7 @@ func (c *Client) Channel() <-chan any { return c.channel } +// Helper method to post a message to a channel with timeout. func (c *Client) post(msg any) { select { case <-time.After(time.Second): @@ -46,7 +47,7 @@ func (c *Client) worker(channel Channel, h handler) { for { payload, err := c.reader.Read(channel) if err != nil { - // Dont report EOF as an error because it is used + // Don't report EOF as an error because it is used // by readers to signal an graceful end of input. if err != io.EOF { c.post(err) @@ -59,7 +60,7 @@ func (c *Client) worker(channel Channel, h handler) { } // Helper method to decode a message and post and error on the channel if it fails. -// Returns true if successfull. false otherwise +// Returns true if successful. False otherwise func (c *Client) decode(payload []byte, msg any) bool { if err := c.decoder(payload, msg); err != nil { c.post(err) @@ -152,7 +153,7 @@ func (c *Client) Run() { func (c *Client) Close() error { err := c.reader.Close() - // Wait for all goroutines before closing channel. + // Wait for all goroutines to finish before closing channel. c.wg.Wait() close(c.channel) return err diff --git a/api/message/msgpack/codec.go b/api/message/msgpack/codec.go index 2e684a6..ce16975 100644 --- a/api/message/msgpack/codec.go +++ b/api/message/msgpack/codec.go @@ -14,7 +14,7 @@ func createCodec() message.Codec { handle.MapType = reflect.TypeOf(map[string]any(nil)) handle.Canonical = true - // Wierd name but this is needed for the newest version of msgpack + // Weird name but this is needed for the newest version of msgpack // that has support for time and string datatypes etc. handle.WriteExt = true diff --git a/api/reader.go b/api/reader.go index 21b4be7..5dd719e 100644 --- a/api/reader.go +++ b/api/reader.go @@ -6,7 +6,7 @@ package api // This is a low-level interface typically implemented by backend drivers type Reader interface { // Read a message from a channel. - // Read may block until a message is ready or an error occured. + // Read may block until a message is ready or an error occurred. // // io.EOF is returned from a reader when there is no more data to be read. // If Read returns io.EOF all subsequent calls must also return io.EOF diff --git a/api/redis/namespace.go b/api/redis/namespace.go index 4e0167c..d02d579 100644 --- a/api/redis/namespace.go +++ b/api/redis/namespace.go @@ -19,7 +19,7 @@ const ( // // Contains a prefix and chain_id to guard keys against collision. // Prefix should be sufficient to not collide with other application using the same redis database. -// chain_id should be ok to not let multiple reader with different chains to write to the same channels. +// chain_id should be fine to not let multiple reader with different chains to write to the same channels. type Namespace struct { Prefix string diff --git a/api/redis/subscriber.go b/api/redis/subscriber.go index 07218ba..c8c7099 100644 --- a/api/redis/subscriber.go +++ b/api/redis/subscriber.go @@ -48,7 +48,7 @@ func NewSubscriber(ctx context.Context, client *redis.Client, ns Namespace, opti return sub } -// worker reads messages from redis pubsub and forwards them to +// worker reads messages from Redis pubsub and forwards them to // correct channels. func (s *Subscriber) worker() { for msg := range s.sub.Channel() { diff --git a/internal/config/cli.go b/internal/config/cli.go index a23794a..3b22223 100644 --- a/internal/config/cli.go +++ b/internal/config/cli.go @@ -7,6 +7,7 @@ import ( "github.com/spf13/pflag" ) +// Get a flag set with all flags mapping to a config value. func GetFlags() *pflag.FlagSet { flags := pflag.FlagSet{} diff --git a/internal/server/message_queue.go b/internal/server/message_queue.go index 50386ec..da46da5 100644 --- a/internal/server/message_queue.go +++ b/internal/server/message_queue.go @@ -13,7 +13,7 @@ type MessageQueue struct { // Writer to write messages to writer driver.Writer - // encoder to encode messages with + // Encoder to encode messages with encode message.Encoder } From 71977203508e0749b26ca7178ee1554bb2a87f43 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Mon, 26 Aug 2024 13:14:00 +0200 Subject: [PATCH 32/68] small fix to cli descriptions and flag help texts --- cmd/tools/main.go | 2 +- internal/config/cli.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/tools/main.go b/cmd/tools/main.go index 3e131ac..35b8684 100644 --- a/cmd/tools/main.go +++ b/cmd/tools/main.go @@ -11,7 +11,7 @@ var VersionString string = "dev" func main() { rootCmd := &cobra.Command{ Use: "thalos-tools", - Short: "Collection of tools for dealing with the thalos application", + Short: "Collection of tools for dealing with the Thalos application", FParseErrWhitelist: cobra.FParseErrWhitelist{ UnknownFlags: true, }, diff --git a/internal/config/cli.go b/internal/config/cli.go index 3b22223..e5e12db 100644 --- a/internal/config/cli.go +++ b/internal/config/cli.go @@ -43,14 +43,14 @@ func GetFlags() *pflag.FlagSet { flags.Uint32("start-block", shipclient.NULL_BLOCK_NUMBER, "Start to stream from this block") flags.Uint32("end-block", shipclient.NULL_BLOCK_NUMBER, "Stop streaming when this block is reached") - flags.Lookup("start-block").DefValue = "config value, cache, head from api" + flags.Lookup("start-block").DefValue = "Config value, cache, head from api" flags.Lookup("end-block").DefValue = "none" flags.Bool("irreversible-only", false, "Only stream irreversible blocks from ship") flags.Int("max-msg-in-flight", 10, "Maximum messages that can be sent from SHIP without acknowledgement") flags.String("chain", "", "ChainID used in channel namespace, can be any string (default from api)") - flags.StringSlice("blacklist", []string{}, "Define a list of 'contract:action' pairs that will be blacklisted (thalos will not process those actions)") + flags.StringSlice("blacklist", []string{}, "Define a list of 'contract:action' pairs that will be blacklisted (Thalos will not process those actions)") flags.Bool("blacklist-is-whitelist", false, "Thalos will treat the blacklist as a whitelist") return &flags From 0e94ca26889ef9c8cb57a1c65ac429ec1d85e17a Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Mon, 26 Aug 2024 14:55:43 +0200 Subject: [PATCH 33/68] debian/changelog: typo fix --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index f423520..69f3389 100644 --- a/debian/changelog +++ b/debian/changelog @@ -45,7 +45,7 @@ thalos (1.1.2~rc4) bionic focal jammy; urgency=medium * API: Fix a bug regarding json timestamp being encoded/decoded with wrong format - * Implement action blacklist, it is not possible to configure a blacklist + * Implement action blacklist, it is now possible to configure a blacklist that will be used to filter out processing of unwanted contracts/actions. -- Henrik Hautakoski Sun, 23 Jun 2024 14:55:03 +0200 From 7e42c27194b1cd1d06ee1aa194ccf4ce945169fb Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Thu, 29 Aug 2024 14:54:30 +0200 Subject: [PATCH 34/68] bump github.com/shufflingpixels/antelope-go to v0.1.5 --- go.mod | 18 +++++++++++++++--- go.sum | 49 ++++++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 59 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index ca4a378..b8a0d91 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/eosswedenorg/thalos -go 1.20 +go 1.21 require ( github.com/cenkalti/backoff/v4 v4.2.1 @@ -14,7 +14,7 @@ require ( github.com/mitchellh/mapstructure v1.5.0 github.com/nikoksr/notify v0.41.0 github.com/redis/go-redis/v9 v9.5.1 - github.com/shufflingpixels/antelope-go v0.1.4 + github.com/shufflingpixels/antelope-go v0.1.5 github.com/sirupsen/logrus v1.9.3 github.com/spf13/cobra v1.8.0 github.com/spf13/pflag v1.0.5 @@ -24,17 +24,21 @@ require ( ) require ( + github.com/andybalholm/brotli v1.1.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/cloudflare/circl v1.3.7 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect github.com/go-telegram-bot-api/telegram-bot-api v4.6.4+incompatible // indirect github.com/google/go-cmp v0.6.0 // indirect + github.com/google/pprof v0.0.0-20240227163752-401108e1b7e7 // indirect github.com/gorilla/websocket v1.5.1 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/hcl v1.0.0 // indirect - github.com/imroc/req/v3 v3.7.6 // indirect + github.com/imroc/req/v3 v3.43.4 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/compress v1.17.8 // indirect @@ -42,10 +46,14 @@ require ( github.com/magiconair/properties v1.8.7 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/onsi/ginkgo/v2 v2.16.0 // indirect github.com/onsi/gomega v1.31.1 // indirect github.com/pelletier/go-toml/v2 v2.1.1 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect + github.com/quic-go/qpack v0.4.0 // indirect + github.com/quic-go/quic-go v0.41.0 // indirect + github.com/refraction-networking/utls v1.6.3 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/shufflingpixels/jsontime-go v0.0.0-20240622163621-cf4b2804c92d // indirect @@ -58,12 +66,16 @@ require ( github.com/vmihailenco/go-tinylfu v0.2.2 // indirect github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect + go.uber.org/mock v0.4.0 // indirect go.uber.org/multierr v1.11.0 // indirect + golang.org/x/crypto v0.22.0 // indirect golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect + golang.org/x/mod v0.16.0 // indirect golang.org/x/net v0.24.0 // indirect golang.org/x/sync v0.7.0 // indirect golang.org/x/sys v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect + golang.org/x/tools v0.19.0 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/ini.v1 v1.67.0 // indirect ) diff --git a/go.sum b/go.sum index 41dd453..e7dad3b 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,13 @@ github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= +github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= github.com/alicebob/miniredis/v2 v2.30.2 h1:lc1UAUT9ZA7h4srlfBmBt2aorm5Yftk9nBjxz7EyY9I= +github.com/alicebob/miniredis/v2 v2.30.2/go.mod h1:b25qWj4fCEsBeAAR2mlb0ufImGC6uH3VlUfb/HS5zKg= +github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1U3M= +github.com/andybalholm/brotli v1.1.0/go.mod h1:sms7XGricyQI9K10gOSf56VKKWS4oLer58Q+mhRPtnY= github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs= +github.com/bsm/ginkgo/v2 v2.12.0/go.mod h1:SwYbGRRDovPVboqFv0tPTcG1sN61LM1Z4ARdbAV9g4c= github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA= +github.com/bsm/gomega v1.27.10/go.mod h1:JyEr/xRbxbtgWNi8tIEVPUYZ5Dzef52k01W3YH0H+O0= github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= @@ -11,6 +17,8 @@ github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU= +github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA= github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -26,16 +34,21 @@ github.com/eosswedenorg-go/antelope-ship-client v0.3.0/go.mod h1:F3nAzlbcANY6zvZ github.com/eosswedenorg-go/pid v1.0.1 h1:W4AEnnNwb041SpNR1uTZ/KbJ0OTA5eqiqIR1Q5Ah6A0= github.com/eosswedenorg-go/pid v1.0.1/go.mod h1:wiOB/JXGt4YA3+T0j0xmCGSc3Jxzb7Ti/Ftli1fgWu4= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= +github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= +github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-redis/cache/v9 v9.0.0 h1:0thdtFo0xJi0/WXbRVu8B066z8OvVymXTJGaXrVWnN0= github.com/go-redis/cache/v9 v9.0.0/go.mod h1:cMwi1N8ASBOufbIvk7cdXe2PbPjK/WMRL95FFHWsSgI= github.com/go-redis/redismock/v9 v9.2.0 h1:ZrMYQeKPECZPjOj5u9eyOjg8Nnb0BS9lkVIZ6IpsKLw= github.com/go-redis/redismock/v9 v9.2.0/go.mod h1:18KHfGDK4Y6c2R0H38EUGWAdc7ZQS9gfYxc94k7rWT0= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= github.com/go-telegram-bot-api/telegram-bot-api v4.6.4+incompatible h1:2cauKuaELYAEARXRkq2LrJ0yDDv1rW7+wrTEdVL3uaU= github.com/go-telegram-bot-api/telegram-bot-api v4.6.4+incompatible/go.mod h1:qf9acutJ8cwBUhm1bqgz6Bei9/C/c93FPDljKWwsOgM= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -47,6 +60,8 @@ github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvq github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= @@ -57,6 +72,8 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20240227163752-401108e1b7e7 h1:y3N7Bm7Y9/CtpiVkw/ZWj6lSlDF3F74SfKwfTCer72Q= +github.com/google/pprof v0.0.0-20240227163752-401108e1b7e7/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik= github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY= github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -68,11 +85,12 @@ github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/imroc/req/v3 v3.7.6 h1:SUVWgFt/dJsSzpzpnc8pHdL79zoE6O8FSCfNvbTZXVU= -github.com/imroc/req/v3 v3.7.6/go.mod h1:3JIicOKEDHfCSYYNLb/ObZNpx64EV5y40VlHMwhUCzU= +github.com/imroc/req/v3 v3.43.4 h1:NSXlB5dELZuxzGEFRWLWEQ9dQmh8d9pUMPa7MevK1K4= +github.com/imroc/req/v3 v3.43.4/go.mod h1:SQIz5iYop16MJxbo8ib+4LnostGCok8NQf8ToyQc2xA= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jordan-wright/email v4.0.1-0.20210109023952-943e75fe5223+incompatible h1:jdpOPRN1zP63Td1hDQbZW73xKmzDvZHzVdNYxhnTMDA= +github.com/jordan-wright/email v4.0.1-0.20210109023952-943e75fe5223+incompatible/go.mod h1:1c7szIrayyPPB/987hsnvNzLushdWf4o/79s3P08L8A= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= @@ -85,6 +103,7 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -119,6 +138,8 @@ github.com/onsi/ginkgo/v2 v2.3.0/go.mod h1:Eew0uilEqZmIEZr8JrvYlvOM7Rr6xzTmMV8Ay github.com/onsi/ginkgo/v2 v2.4.0/go.mod h1:iHkDK1fKGcBoEHT5W7YBq4RFWaQulw+caOMkAt4OrFo= github.com/onsi/ginkgo/v2 v2.5.0/go.mod h1:Luc4sArBICYCS8THh8v3i3i5CuSZO+RaQRaJoeNwomw= github.com/onsi/ginkgo/v2 v2.7.0/go.mod h1:yjiuMwPokqY1XauOgju45q3sJt6VzQ/Fict1LFVcsAo= +github.com/onsi/ginkgo/v2 v2.16.0 h1:7q1w9frJDzninhXxjZd+Y/x54XNjG/UlRLIYPZafsPM= +github.com/onsi/ginkgo/v2 v2.16.0/go.mod h1:llBI3WDLL9Z6taip6f33H76YcWtJv+7R3HigUjbIBOs= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= @@ -138,18 +159,25 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/quic-go/qpack v0.4.0 h1:Cr9BXA1sQS2SmDUWjSofMPNKmvF6IiIfDRmgU0w1ZCo= +github.com/quic-go/qpack v0.4.0/go.mod h1:UZVnYIfi5GRk+zI9UMaCPsmZ2xKJP7XBUvVyT1Knj9A= +github.com/quic-go/quic-go v0.41.0 h1:aD8MmHfgqTURWNJy48IYFg2OnxwHT3JL7ahGs73lb4k= +github.com/quic-go/quic-go v0.41.0/go.mod h1:qCkNjqczPEvgsOnxZ0eCD14lv+B2LHlFAB++CNOh9hA= github.com/redis/go-redis/v9 v9.0.0-rc.4/go.mod h1:Vo3EsyWnicKnSKCA7HhgnvnyA74wOA69Cd2Meli5mmA= github.com/redis/go-redis/v9 v9.5.1 h1:H1X4D3yHPaYrkL5X06Wh6xNVM/pX0Ft4RV0vMGvLBh8= github.com/redis/go-redis/v9 v9.5.1/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M= +github.com/refraction-networking/utls v1.6.3 h1:MFOfRN35sSx6K5AZNIoESsBuBxS2LCgRilRIdHb6fDc= +github.com/refraction-networking/utls v1.6.3/go.mod h1:yil9+7qSl+gBwJqztoQseO6Pr3h62pQoY1lXiNR/FPs= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6keLGt6kNQ= github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4= github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ= -github.com/shufflingpixels/antelope-go v0.1.4 h1:MInk3tEo69OA/U6tZWXGrVzdQhrDFX8UfUkGq1Lq/2Y= -github.com/shufflingpixels/antelope-go v0.1.4/go.mod h1:Bi+zmFI5s7Qv2hx3v9FAcDyf4N4MUs5zaKNa2CetmSg= +github.com/shufflingpixels/antelope-go v0.1.5 h1:N0jCC5bya5shBb96Ff2cCpN+Yw99YldVjWvr0qoiW3E= +github.com/shufflingpixels/antelope-go v0.1.5/go.mod h1:VFULwUB/YfNZeZFzClTNrLyIKWChRhnPvxdzapeOcm0= github.com/shufflingpixels/jsontime-go v0.0.0-20240622163621-cf4b2804c92d h1:nju7jR1Kf210tArPT6l//HlfLLFnvje1BWl5TSRsohQ= github.com/shufflingpixels/jsontime-go v0.0.0-20240622163621-cf4b2804c92d/go.mod h1:W0TaKyg3kDqWmFUxlax3qAls/lRdo12EseM6f4f0dzE= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= @@ -196,6 +224,9 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yuin/gopher-lua v1.1.0 h1:BojcDhfyDWgU2f2TOzYK/g5p2gxMrku8oupLDqlnSqE= +github.com/yuin/gopher-lua v1.1.0/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw= +go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU= +go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= @@ -203,6 +234,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= +golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= +golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 h1:LfspQV/FYTatPTr/3HzIcmiUFH7PGP+OQ6mgDYo3yuQ= golang.org/x/exp v0.0.0-20240222234643-814bf88cf225/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -210,6 +243,8 @@ golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2 golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.16.0 h1:QX4fJ0Rr5cPQCF7O9lh9Se4pmwfwskqZfq5moyldzic= +golang.org/x/mod v0.16.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -218,7 +253,6 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220111093109-d55c255bac03/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= @@ -284,6 +318,8 @@ golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= golang.org/x/tools v0.4.0/go.mod h1:UE5sM2OK9E/d67R0ANs2xJizIymRP5gJU295PvKXxjQ= +golang.org/x/tools v0.19.0 h1:tfGCXNR1OsFG+sVdLAitlpjAvD/I6dHDKnYrpEZUHkw= +golang.org/x/tools v0.19.0/go.mod h1:qoJWxmGSIBmAeriMx19ogtrEPrGtDbPK634QFIcLAhc= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -297,6 +333,8 @@ google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2 google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -316,3 +354,4 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU= +gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= From 92ac8521ed83281211c376c400bc87c0b8b141c7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 29 Aug 2024 13:28:17 +0000 Subject: [PATCH 35/68] build(deps): bump github.com/quic-go/quic-go from 0.41.0 to 0.42.0 Bumps [github.com/quic-go/quic-go](https://github.com/quic-go/quic-go) from 0.41.0 to 0.42.0. - [Release notes](https://github.com/quic-go/quic-go/releases) - [Changelog](https://github.com/quic-go/quic-go/blob/master/Changelog.md) - [Commits](https://github.com/quic-go/quic-go/compare/v0.41.0...v0.42.0) --- updated-dependencies: - dependency-name: github.com/quic-go/quic-go dependency-type: indirect ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index b8a0d91..d11c158 100644 --- a/go.mod +++ b/go.mod @@ -52,7 +52,7 @@ require ( github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/quic-go/qpack v0.4.0 // indirect - github.com/quic-go/quic-go v0.41.0 // indirect + github.com/quic-go/quic-go v0.42.0 // indirect github.com/refraction-networking/utls v1.6.3 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect diff --git a/go.sum b/go.sum index e7dad3b..36fcd3c 100644 --- a/go.sum +++ b/go.sum @@ -161,8 +161,8 @@ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRI github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/quic-go/qpack v0.4.0 h1:Cr9BXA1sQS2SmDUWjSofMPNKmvF6IiIfDRmgU0w1ZCo= github.com/quic-go/qpack v0.4.0/go.mod h1:UZVnYIfi5GRk+zI9UMaCPsmZ2xKJP7XBUvVyT1Knj9A= -github.com/quic-go/quic-go v0.41.0 h1:aD8MmHfgqTURWNJy48IYFg2OnxwHT3JL7ahGs73lb4k= -github.com/quic-go/quic-go v0.41.0/go.mod h1:qCkNjqczPEvgsOnxZ0eCD14lv+B2LHlFAB++CNOh9hA= +github.com/quic-go/quic-go v0.42.0 h1:uSfdap0eveIl8KXnipv9K7nlwZ5IqLlYOpJ58u5utpM= +github.com/quic-go/quic-go v0.42.0/go.mod h1:132kz4kL3F9vxhW3CtQJLDVwcFe5wdWeJXXijhsO57M= github.com/redis/go-redis/v9 v9.0.0-rc.4/go.mod h1:Vo3EsyWnicKnSKCA7HhgnvnyA74wOA69Cd2Meli5mmA= github.com/redis/go-redis/v9 v9.5.1 h1:H1X4D3yHPaYrkL5X06Wh6xNVM/pX0Ft4RV0vMGvLBh8= github.com/redis/go-redis/v9 v9.5.1/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M= @@ -311,6 +311,8 @@ golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= +golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= From 982b920576dbe5eb487c249d2e0fe665087d5bfa Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Thu, 29 Aug 2024 15:20:16 +0200 Subject: [PATCH 36/68] .github/workflows/test.yml: dont test on 1.20 --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2df9f11..af79d53 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,7 +10,7 @@ jobs: strategy: fail-fast: false matrix: - go-version: ["1.20", "1.21"] + go-version: ["1.21"] arch: [ 386, amd64 ] runs-on: ubuntu-latest name: Test (${{matrix.arch}} go v${{ matrix.go-version }}) @@ -32,7 +32,7 @@ jobs: strategy: fail-fast: false matrix: - tag: ["1.20-alpine3.19", "1.21-alpine3.19"] + tag: [ "1.21-alpine3.19"] runs-on: ubuntu-latest name: Test alpine (${{ matrix.tag }}) container: From a3c428ee5cb27ab1c37e71acfe89cab0e3201249 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Thu, 29 Aug 2024 15:33:45 +0200 Subject: [PATCH 37/68] Version 1.1.5 --- Makefile | 2 +- debian/changelog | 13 +++++++++++++ docker/Dockerfile | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index a139da8..f4570d5 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ GO=go GOLDFLAGS=-v -s -w -X main.VersionString=$(PROGRAM_VERSION) GOBUILDFLAGS=-v -p $(shell nproc) -ldflags="$(GOLDFLAGS)" PROGRAM=thalos-server -PROGRAM_VERSION ?= 1.1.5-rc1 +PROGRAM_VERSION ?= 1.1.5 PREFIX=/usr/local BINDIR=$(PREFIX)/bin CFGDIR=$(PREFIX)/etc/thalos diff --git a/debian/changelog b/debian/changelog index 69f3389..102efc0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,16 @@ +thalos (1.1.5) bionic focal jammy; urgency=medium + + * New config section: `cache` + * New CLI flag: `cache` specify what cache driver to use + * New CLI flag: `abi-cache-api-timeout` configure the timeout for the HTTP + request made when Thalos wants to fetch a ABI from the api. + * API Table Deltas: abi decode the data in `value` field for contract_row deltas. + * golang: update github.com/shufflingpixels/antelope-go to v0.1.5 + * golang: update github.com/quic-go/quic-go from 0.41.0 to 0.42.0 + * golang: version 1.20 can no longer be used to build the project. + + -- Henrik Hautakoski Thu, 29 Aug 2024 15:33:17 +0200 + thalos (1.1.5~rc1) bionic focal jammy; urgency=medium * New config section: `cache` diff --git a/docker/Dockerfile b/docker/Dockerfile index 066533c..c379f15 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,6 +1,6 @@ FROM alpine:latest LABEL maintainer="Henrik Hautakoski " -ARG VERSION=1.1.5-rc1 +ARG VERSION=1.1.5 WORKDIR /thalos ADD --chmod=755 https://github.com/eosswedenorg/thalos/releases/download/v$VERSION/thalos-server-${VERSION}-linux-amd64-musl thalos-server ENTRYPOINT [ "./thalos-server" ] From 08fcdb0590cc71fc06813e512f3691c2f4687402 Mon Sep 17 00:00:00 2001 From: Artem Maliuga Date: Wed, 9 Oct 2024 20:17:04 +0300 Subject: [PATCH 38/68] Fix typo in config.example.yml --- config.example.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.example.yml b/config.example.yml index 85c289d..212276f 100644 --- a/config.example.yml +++ b/config.example.yml @@ -80,7 +80,7 @@ redis: user: "" # Password to use when authenticating - pasword: "" + password: "" # database index db: 0 From ef0ac7a1b88905af21c2f2019d8d109eb5f0c28d Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Thu, 29 Aug 2024 15:41:18 +0200 Subject: [PATCH 39/68] .github/workflows/release.yml: need to update version regex for musl builds --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 29dd27a..4f8760d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -81,7 +81,7 @@ jobs: mkdir -p build/bundle/{bin,logs} GOARCH=${{matrix.arch}} make -e DESTDIR=build/bundle PREFIX= CFGDIR= install install-scripts tar -C build/bundle -z -cf build/bundle.tar.gz . - echo "version=$(sed -n 's/.*PROGRAM_VERSION\s*=\s*//p' Makefile)" >> "$GITHUB_OUTPUT" + echo "version=$(sed -n 's/.*PROGRAM_VERSION.*=\s*//p' Makefile)" >> "$GITHUB_OUTPUT" - name: Upload thalos-server uses: actions/upload-release-asset@v1 From 4f46188ed4a388ffa16b7e79f0642528cf25e68c Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Fri, 30 Aug 2024 13:10:55 +0200 Subject: [PATCH 40/68] README.md: Link to docker page --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index fdf2c0e..ea487ed 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,10 @@ Consult the [documentation](https://thalos.waxsweden.org/docs) for more informat Join the discussion on [telegram](https://t.me/antelopethalos) +## Docker images + +Docker images can be found [here](https://github.com/eosswedenorg/thalos/pkgs/container/thalos) + ## Compiling You will need golang version `1.20` or later to compile the source. From 020f81ed654b4d5356a1f2f75b58eda0c0c9691b Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Tue, 3 Sep 2024 21:51:52 +0200 Subject: [PATCH 41/68] README.md: Update minimum go version --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ea487ed..09ab23c 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Docker images can be found [here](https://github.com/eosswedenorg/thalos/pkgs/co ## Compiling -You will need golang version `1.20` or later to compile the source. +You will need golang version `1.21` or later to compile the source. Compile using make: From 70aa6cd29550c29e19d57a0bff48ab3dad666051 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Sun, 8 Sep 2024 13:29:43 +0200 Subject: [PATCH 42/68] api/channel_test.go: rearange fields. --- api/channel_test.go | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/api/channel_test.go b/api/channel_test.go index caaf4e7..ae2edf1 100644 --- a/api/channel_test.go +++ b/api/channel_test.go @@ -55,13 +55,13 @@ func TestChannel_Is(t *testing.T) { func TestChannel_Format(t *testing.T) { tests := []struct { name string - c Channel delim string want string + c Channel }{ - {"Empty", Channel{}, ":", ""}, - {"Alot#1", Channel{"one", "two", "three"}, "-", "one-two-three"}, - {"Alot#2", Channel{"first", "second"}, ":", "first:second"}, + {"Empty", ":", "", Channel{}}, + {"Alot#1", "-", "one-two-three", Channel{"one", "two", "three"}}, + {"Alot#2", ":", "first:second", Channel{"first", "second"}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -75,11 +75,11 @@ func TestChannel_Format(t *testing.T) { func TestChannel_String(t *testing.T) { tests := []struct { name string - c Channel want string + c Channel }{ - {"Empty", Channel{}, ""}, - {"Alot", Channel{"one", "two", "three"}, "one/two/three"}, + {"Empty", "", Channel{}}, + {"Alot", "one/two/three", Channel{"one", "two", "three"}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -93,13 +93,13 @@ func TestChannel_String(t *testing.T) { func TestChannel_Type(t *testing.T) { tests := []struct { name string - c Channel want string + c Channel }{ - {"Empty", Channel{}, "unknown"}, - {"Heartbeat", HeartbeatChannel, "heartbeat"}, - {"Transaction", TransactionChannel, "transactions"}, - {"Actions", ActionChannel{}.Channel(), "actions"}, + {"Empty", "unknown", Channel{}}, + {"Heartbeat", "heartbeat", HeartbeatChannel}, + {"Transaction", "transactions", TransactionChannel}, + {"Actions", "actions", ActionChannel{}.Channel()}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { From 84547e5ad3f97f87ba786efd67a0b29eaa84255d Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Thu, 12 Sep 2024 08:20:16 +0200 Subject: [PATCH 43/68] minor style fixes. --- debian/thalos.postinst | 10 +++++----- debian/thalos.postrm | 10 ++++------ 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/debian/thalos.postinst b/debian/thalos.postinst index 9c31f4b..a643c01 100644 --- a/debian/thalos.postinst +++ b/debian/thalos.postinst @@ -2,14 +2,14 @@ set -e if [ "$1" = 'configure' ]; then - adduser --force-badname --system --home /nonexistent \ + adduser --force-badname --system --home /nonexistent \ --group --no-create-home --quiet thalos || true - # Create log directory - mkdir -p /var/log/thalos - chown thalos:adm /var/log/thalos + # Create log directory + mkdir -p /var/log/thalos + chown thalos:adm /var/log/thalos fi #DEBHELPER# -exit 0 \ No newline at end of file +exit 0 diff --git a/debian/thalos.postrm b/debian/thalos.postrm index 08a6475..dde4859 100644 --- a/debian/thalos.postrm +++ b/debian/thalos.postrm @@ -3,11 +3,9 @@ set -e #DEBHELPER# - -if [ "${1}" = "purge" ] -then - deluser --quiet thalos > /dev/null || true - rm -rf /var/log/thalos +if [ "${1}" = "purge" ]; then + deluser --quiet thalos >/dev/null || true + rm -rf /var/log/thalos fi -exit 0 \ No newline at end of file +exit 0 From 6231142e4a77315c0ada53ec4d92fe62e004682b Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Wed, 16 Oct 2024 16:22:32 +0200 Subject: [PATCH 44/68] makefile: make sure we apppend to GOBULDFLAGS if user wants to add their own. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f4570d5..d4faff4 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ GO=go GOLDFLAGS=-v -s -w -X main.VersionString=$(PROGRAM_VERSION) -GOBUILDFLAGS=-v -p $(shell nproc) -ldflags="$(GOLDFLAGS)" +GOBUILDFLAGS+=-v -p $(shell nproc) -ldflags="$(GOLDFLAGS)" PROGRAM=thalos-server PROGRAM_VERSION ?= 1.1.5 PREFIX=/usr/local From ffd2504834fa9f3b72b06ec58214e25c721c73c5 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Wed, 16 Oct 2024 16:32:32 +0200 Subject: [PATCH 45/68] Version 1.1.6 --- Makefile | 2 +- debian/changelog | 17 +++++++++++++++++ docker/Dockerfile | 2 +- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index d4faff4..7969d11 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ GO=go GOLDFLAGS=-v -s -w -X main.VersionString=$(PROGRAM_VERSION) GOBUILDFLAGS+=-v -p $(shell nproc) -ldflags="$(GOLDFLAGS)" PROGRAM=thalos-server -PROGRAM_VERSION ?= 1.1.5 +PROGRAM_VERSION ?= 1.1.6 PREFIX=/usr/local BINDIR=$(PREFIX)/bin CFGDIR=$(PREFIX)/etc/thalos diff --git a/debian/changelog b/debian/changelog index 102efc0..36c1045 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,19 @@ +thalos (1.1.6) bionic focal jammy; urgency=medium + + [ Henrik Hautakoski ] + * makefile: make sure we apppend to GOBULDFLAGS if user wants to add their own. + * minor style fixes. + * api/channel_test.go: rearange fields. + * README.md: Update minimum go version + * README.md: Link to docker page + * .github/workflows/release.yml: need to update version regex for musl builds + + [ Avm07 ] + * Fix typo in config.example.yml + + +-- Henrik Hautakoski Wed, 16 Oct 2024 16:23:47 +0200 + thalos (1.1.5) bionic focal jammy; urgency=medium * New config section: `cache` @@ -218,3 +234,4 @@ thalos-server (0.1.0) bionic focal jammy; urgency=medium Initial release. -- Henrik Hautakoski Sun, 14 May 2023 18:17:35 +0200 + diff --git a/docker/Dockerfile b/docker/Dockerfile index c379f15..a6410a2 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,6 +1,6 @@ FROM alpine:latest LABEL maintainer="Henrik Hautakoski " -ARG VERSION=1.1.5 +ARG VERSION=1.1.6 WORKDIR /thalos ADD --chmod=755 https://github.com/eosswedenorg/thalos/releases/download/v$VERSION/thalos-server-${VERSION}-linux-amd64-musl thalos-server ENTRYPOINT [ "./thalos-server" ] From bedb8a92e8d0d09ad03957a785832db00964ab0e Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Mon, 21 Oct 2024 12:24:29 +0200 Subject: [PATCH 46/68] config: adding Ship.EnableTableDeltas and table_deltas cli flag --- internal/config/builder.go | 1 + internal/config/builder_test.go | 2 ++ internal/config/cli.go | 2 ++ internal/config/config.go | 1 + 4 files changed, 6 insertions(+) diff --git a/internal/config/builder.go b/internal/config/builder.go index 6429f24..e22bf45 100644 --- a/internal/config/builder.go +++ b/internal/config/builder.go @@ -59,6 +59,7 @@ func NewBuilder() *Builder { "ship.chain": "chain", "ship.blacklist": "blacklist", "ship.blacklist_is_whitelist": "blacklist-is-whitelist", + "ship.table_deltas": "table-deltas", }, } } diff --git a/internal/config/builder_test.go b/internal/config/builder_test.go index 234776a..b133353 100644 --- a/internal/config/builder_test.go +++ b/internal/config/builder_test.go @@ -127,6 +127,7 @@ func TestBuilder_WithDefaultConfig(t *testing.T) { StartBlockNum: shipclient.NULL_BLOCK_NUMBER, EndBlockNum: shipclient.NULL_BLOCK_NUMBER, MaxMessagesInFlight: 10, + EnableTableDeltas: true, }, Redis: RedisConfig{ Addr: "127.0.0.1:6379", @@ -174,6 +175,7 @@ func TestBuilder_Flags(t *testing.T) { require.NoError(t, flags.Set("chain", "wax")) require.NoError(t, flags.Set("blacklist", "contract:action1,contract:action2,contract2:action1")) require.NoError(t, flags.Set("blacklist-is-whitelist", "true")) + require.NoError(t, flags.Set("table-deltas", "false")) cfg, err := NewBuilder(). SetSource(bytes.NewReader([]byte(``))). diff --git a/internal/config/cli.go b/internal/config/cli.go index e5e12db..d4f26ac 100644 --- a/internal/config/cli.go +++ b/internal/config/cli.go @@ -46,6 +46,8 @@ func GetFlags() *pflag.FlagSet { flags.Lookup("start-block").DefValue = "Config value, cache, head from api" flags.Lookup("end-block").DefValue = "none" + flags.Bool("table-deltas", true, "True if thalos should receive and process table deltas from ship.") + flags.Bool("irreversible-only", false, "Only stream irreversible blocks from ship") flags.Int("max-msg-in-flight", 10, "Maximum messages that can be sent from SHIP without acknowledgement") flags.String("chain", "", "ChainID used in channel namespace, can be any string (default from api)") diff --git a/internal/config/config.go b/internal/config/config.go index e1d815e..feabb87 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -39,6 +39,7 @@ type ShipConfig struct { Chain string `yaml:"chain" mapstructure:"chain"` Blacklist types.Blacklist `yaml:"blacklist" mapstructure:"blacklist"` BlacklistIsWhitelist bool `yaml:"blacklist_is_whitelist" mapstructure:"blacklist_is_whitelist"` + EnableTableDeltas bool `yaml:"table_deltas" mapstructure:"table_deltas"` } type Config struct { From 33c983f6c5d091ca63d277e5373ea7292ef0855e Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Mon, 21 Oct 2024 12:27:29 +0200 Subject: [PATCH 47/68] internal/server/ship_processor.go: adding FetchDeltas() --- internal/server/ship_processor.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/internal/server/ship_processor.go b/internal/server/ship_processor.go index e3ab11e..a722722 100644 --- a/internal/server/ship_processor.go +++ b/internal/server/ship_processor.go @@ -66,6 +66,15 @@ func SpawnProccessor(shipStream *shipclient.Stream, loader StateLoader, saver St return processor } +func (processor *ShipProcessor) FetchDeltas(value bool) { + if value { + // empty callback will signal that traces should be included in the response from ship. + processor.shipStream.TableDeltaHandler = func(*ship.TableDeltaArray) {} + } else { + processor.shipStream.TableDeltaHandler = nil + } +} + func (processor *ShipProcessor) SetBlacklist(list types.Blacklist) { processor.blacklist = list } From 0cb86ff7719ba678a4479be12f53f445f64d48b1 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Mon, 21 Oct 2024 12:28:06 +0200 Subject: [PATCH 48/68] cmd/thalos/server.go: configure fetching of table deltas. --- cmd/thalos/server.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/thalos/server.go b/cmd/thalos/server.go index 5813aee..271452c 100644 --- a/cmd/thalos/server.go +++ b/cmd/thalos/server.go @@ -392,6 +392,7 @@ func serverCmd(cmd *cobra.Command, args []string) { ) processor.SetBlacklist(conf.Ship.Blacklist) + processor.FetchDeltas(conf.Ship.EnableTableDeltas) // Run the application run(conf, shClient, processor) From e2f7efe8b065c0ae716886269de42d40183faf2a Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Mon, 21 Oct 2024 12:28:55 +0200 Subject: [PATCH 49/68] config.example.yml: add ship.table_deltas --- config.example.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/config.example.yml b/config.example.yml index 212276f..efbcd44 100644 --- a/config.example.yml +++ b/config.example.yml @@ -42,6 +42,10 @@ ship: # Request ship to stop sending blocks when reaching this block. #end_block_num: 2000 + # + + # Disable processing of table deltas + # table_deltas: false # Blacklist contract/actions blacklist: From 4ae30f0cc6add676f6c5fc30d671ca0471bd8bab Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Mon, 21 Oct 2024 12:30:48 +0200 Subject: [PATCH 50/68] debian/changelog: format fix --- debian/changelog | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 36c1045..621bd3b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -11,8 +11,7 @@ thalos (1.1.6) bionic focal jammy; urgency=medium [ Avm07 ] * Fix typo in config.example.yml - --- Henrik Hautakoski Wed, 16 Oct 2024 16:23:47 +0200 + -- Henrik Hautakoski Wed, 16 Oct 2024 16:23:47 +0200 thalos (1.1.5) bionic focal jammy; urgency=medium From 213a31570dc6802b83a7f5005e2ec23f1881e769 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Mon, 21 Oct 2024 12:32:08 +0200 Subject: [PATCH 51/68] Version 1.1.7-rc1 --- Makefile | 2 +- debian/changelog | 6 ++++++ docker/Dockerfile | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 7969d11..c49f3d0 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ GO=go GOLDFLAGS=-v -s -w -X main.VersionString=$(PROGRAM_VERSION) GOBUILDFLAGS+=-v -p $(shell nproc) -ldflags="$(GOLDFLAGS)" PROGRAM=thalos-server -PROGRAM_VERSION ?= 1.1.6 +PROGRAM_VERSION ?= 1.1.7-rc1 PREFIX=/usr/local BINDIR=$(PREFIX)/bin CFGDIR=$(PREFIX)/etc/thalos diff --git a/debian/changelog b/debian/changelog index 621bd3b..d1c6ab8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +thalos (1.1.7~rc1) bionic focal jammy; urgency=medium + + * Add support to disable processing of table deltas. + + -- Henrik Hautakoski Mon, 21 Oct 2024 12:31:21 +0200 + thalos (1.1.6) bionic focal jammy; urgency=medium [ Henrik Hautakoski ] diff --git a/docker/Dockerfile b/docker/Dockerfile index a6410a2..40e10fb 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,6 +1,6 @@ FROM alpine:latest LABEL maintainer="Henrik Hautakoski " -ARG VERSION=1.1.6 +ARG VERSION=1.1.7-rc1 WORKDIR /thalos ADD --chmod=755 https://github.com/eosswedenorg/thalos/releases/download/v$VERSION/thalos-server-${VERSION}-linux-amd64-musl thalos-server ENTRYPOINT [ "./thalos-server" ] From 50adfa002605c50e30a9f13b28c1790b60ac6e71 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Mon, 21 Oct 2024 13:52:11 +0200 Subject: [PATCH 52/68] config.example.yml: minor fixes. --- config.example.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/config.example.yml b/config.example.yml index efbcd44..2dc438e 100644 --- a/config.example.yml +++ b/config.example.yml @@ -38,13 +38,12 @@ ship: # Request ship to start sending blocks from this block. # If not set, the head block reported by the nodeos api is used. - #start_block_num: 1000 + # start_block_num: 1000 # Request ship to stop sending blocks when reaching this block. - #end_block_num: 2000 - # + # end_block_num: 2000 - # Disable processing of table deltas + # If true, Thalos will process table deltas # table_deltas: false # Blacklist contract/actions @@ -71,9 +70,9 @@ ship: # options: [] # Telegram notifications -#telegram: -# id: "123456789:GPdmGPBWvpgHPxlergJLavus-PoAURTjMWP" -# channel: -123456789 +# telegram: +# id: "123456789:GPdmGPBWvpgHPxlergJLavus-PoAURTjMWP" +# channel: -123456789 # Redis settings redis: From 9bdcbacaa0429fa656bb52bd4ad70e29b16a6503 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Sun, 3 Nov 2024 12:02:27 +0100 Subject: [PATCH 53/68] go.mod: update eosswedenrg-go/antelope-ship-client to v0.3.2 --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index d11c158..4c07b37 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.21 require ( github.com/cenkalti/backoff/v4 v4.2.1 github.com/docker/go-units v0.5.0 - github.com/eosswedenorg-go/antelope-ship-client v0.3.0 + github.com/eosswedenorg-go/antelope-ship-client v0.3.2 github.com/eosswedenorg-go/pid v1.0.1 github.com/eosswedenorg/thalos/api v1.0.0 github.com/go-redis/cache/v9 v9.0.0 diff --git a/go.sum b/go.sum index 36fcd3c..6d81242 100644 --- a/go.sum +++ b/go.sum @@ -29,8 +29,8 @@ github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/r github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/eosswedenorg-go/antelope-ship-client v0.3.0 h1:L1DTE2ZeOGSbehCAqVF5GhdaAb3ZYgvFFUhpDWmJ2vQ= -github.com/eosswedenorg-go/antelope-ship-client v0.3.0/go.mod h1:F3nAzlbcANY6zvZ+cTJH9WjJtvJU6hvduBAUAjX2/lA= +github.com/eosswedenorg-go/antelope-ship-client v0.3.2 h1:mDXZkjQ0bTPJClkhoPEP5ltucxql6bR+QixhnQI/Og4= +github.com/eosswedenorg-go/antelope-ship-client v0.3.2/go.mod h1:DnUmaRGxz/V73CtVEJx/fReqhgGzhVyWpOrEKVYQSgE= github.com/eosswedenorg-go/pid v1.0.1 h1:W4AEnnNwb041SpNR1uTZ/KbJ0OTA5eqiqIR1Q5Ah6A0= github.com/eosswedenorg-go/pid v1.0.1/go.mod h1:wiOB/JXGt4YA3+T0j0xmCGSc3Jxzb7Ti/Ftli1fgWu4= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= From d959645836e664d0a75f57bec223e9167aad2376 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Sun, 3 Nov 2024 12:03:48 +0100 Subject: [PATCH 54/68] cmd/thalos/server.go: set MaxMessagesInFlight = 1 when creating ship client --- cmd/thalos/server.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/thalos/server.go b/cmd/thalos/server.go index 271452c..72ea05f 100644 --- a/cmd/thalos/server.go +++ b/cmd/thalos/server.go @@ -363,6 +363,7 @@ func serverCmd(cmd *cobra.Command, args []string) { s.StartBlock = conf.Ship.StartBlockNum s.EndBlock = conf.Ship.EndBlockNum s.IrreversibleOnly = conf.Ship.IrreversibleOnly + s.MaxMessagesInFlight = 1 }) // Get codec From 89011b8fc837be3af5901e417341a7f9c08bd5fb Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Sun, 3 Nov 2024 12:11:09 +0100 Subject: [PATCH 55/68] Version 1.1.7-rc2 --- Makefile | 2 +- debian/changelog | 10 ++++++++++ docker/Dockerfile | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index c49f3d0..627630a 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ GO=go GOLDFLAGS=-v -s -w -X main.VersionString=$(PROGRAM_VERSION) GOBUILDFLAGS+=-v -p $(shell nproc) -ldflags="$(GOLDFLAGS)" PROGRAM=thalos-server -PROGRAM_VERSION ?= 1.1.7-rc1 +PROGRAM_VERSION ?= 1.1.7-rc2 PREFIX=/usr/local BINDIR=$(PREFIX)/bin CFGDIR=$(PREFIX)/etc/thalos diff --git a/debian/changelog b/debian/changelog index d1c6ab8..c2fa6f8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +thalos (1.1.7~rc2) bionic focal jammy; urgency=medium + + * ship: set MaxMessagesInFlight to 1. This forces the client/server to ack + every message and might be a workaround fix for issue #25 + according to this comment: + https://github.com/AntelopeIO/leap/issues/1358#issuecomment-2276294557 + * golang: update eosswedenrg-go/antelope-ship-client to v0.3.2 + + -- Henrik Hautakoski Sun, 03 Nov 2024 12:04:29 +0100 + thalos (1.1.7~rc1) bionic focal jammy; urgency=medium * Add support to disable processing of table deltas. diff --git a/docker/Dockerfile b/docker/Dockerfile index 40e10fb..73b42e2 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,6 +1,6 @@ FROM alpine:latest LABEL maintainer="Henrik Hautakoski " -ARG VERSION=1.1.7-rc1 +ARG VERSION=1.1.7-rc2 WORKDIR /thalos ADD --chmod=755 https://github.com/eosswedenorg/thalos/releases/download/v$VERSION/thalos-server-${VERSION}-linux-amd64-musl thalos-server ENTRYPOINT [ "./thalos-server" ] From d5bc23a63ed3cb30f43262887ff63614261cff47 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Mon, 11 Nov 2024 19:40:17 +0100 Subject: [PATCH 56/68] Version 1.1.7 --- Makefile | 2 +- debian/changelog | 11 +++++++++++ docker/Dockerfile | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 627630a..4e543a7 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ GO=go GOLDFLAGS=-v -s -w -X main.VersionString=$(PROGRAM_VERSION) GOBUILDFLAGS+=-v -p $(shell nproc) -ldflags="$(GOLDFLAGS)" PROGRAM=thalos-server -PROGRAM_VERSION ?= 1.1.7-rc2 +PROGRAM_VERSION ?= 1.1.7 PREFIX=/usr/local BINDIR=$(PREFIX)/bin CFGDIR=$(PREFIX)/etc/thalos diff --git a/debian/changelog b/debian/changelog index c2fa6f8..a3ab8cc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,14 @@ +thalos (1.1.7) bionic focal jammy; urgency=medium + + * ship: set MaxMessagesInFlight to 1. This forces the client/server to ack + every message and might be a workaround fix for issue #25 + according to this comment: + https://github.com/AntelopeIO/leap/issues/1358#issuecomment-2276294557 + * golang: update eosswedenrg-go/antelope-ship-client to v0.3.2 + * Add support to disable processing of table deltas. + + -- Henrik Hautakoski Mon, 11 Nov 2024 19:38:15 +0100 + thalos (1.1.7~rc2) bionic focal jammy; urgency=medium * ship: set MaxMessagesInFlight to 1. This forces the client/server to ack diff --git a/docker/Dockerfile b/docker/Dockerfile index 73b42e2..40308ee 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,6 +1,6 @@ FROM alpine:latest LABEL maintainer="Henrik Hautakoski " -ARG VERSION=1.1.7-rc2 +ARG VERSION=1.1.7 WORKDIR /thalos ADD --chmod=755 https://github.com/eosswedenorg/thalos/releases/download/v$VERSION/thalos-server-${VERSION}-linux-amd64-musl thalos-server ENTRYPOINT [ "./thalos-server" ] From 120c2acdc6a5b1a35f3c5ead863eedc0b3f63ec3 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Tue, 26 Nov 2024 06:52:14 +0100 Subject: [PATCH 57/68] internal/server/ship_processor.go: refactor processDeltaRows() to reduce nested blocks --- internal/server/ship_processor.go | 65 +++++++++++++++++-------------- 1 file changed, 36 insertions(+), 29 deletions(-) diff --git a/internal/server/ship_processor.go b/internal/server/ship_processor.go index a722722..1c1ee39 100644 --- a/internal/server/ship_processor.go +++ b/internal/server/ship_processor.go @@ -2,6 +2,7 @@ package server import ( "bytes" + "errors" "github.com/eosswedenorg/thalos/api/message" "github.com/eosswedenorg/thalos/internal/abi" @@ -228,41 +229,47 @@ func (processor *ShipProcessor) proccessActionTrace(logger *log.Entry, trace *sh func (processor *ShipProcessor) proccessDeltaRows(logger *log.Entry, table_name string, rows []ship.Row) []message.TableDeltaRow { out := []message.TableDeltaRow{} for _, row := range rows { - - msg := message.TableDeltaRow{ - Present: row.Present, - RawData: row.Data, - } - - if processor.shipABI != nil { - v, err := processor.shipABI.Decode(bytes.NewReader(row.Data), table_name) - if err == nil { - data, err := ship_helper.ParseTableDeltaData(v) - if err == nil { - // Decode contract row data - if table_name == "contract_row" { - dec, err := ship_helper.DecodeContractRow(processor.abi, data) - if err != nil { - logger.WithError(err).Warn("Failed to decode contract row") - } else { - data["value"] = dec - } - } - msg.Data = data - } else { - logger.WithError(err).Error("Failed to parse table delta data") - } - } else { - logger.WithError(err).Error("Failed to decode table delta") - } - } else { - logger.Warn("No SHIP ABI present") + msg, err := processor.proccessDeltaRow(row, table_name) + if err != nil { + logger.WithError(err).Warn("Failed to processs table delta row") } out = append(out, msg) } return out } +func (processor *ShipProcessor) proccessDeltaRow(row ship.Row, table_name string) (message.TableDeltaRow, error) { + msg := message.TableDeltaRow{ + Present: row.Present, + RawData: row.Data, + } + + if processor.shipABI == nil { + return msg, errors.New("No SHIP ABI present") + } + + v, err := processor.shipABI.Decode(bytes.NewReader(row.Data), table_name) + if err != nil { + return msg, errors.New("Failed to decode table delta") + } + data, err := ship_helper.ParseTableDeltaData(v) + if err != nil { + return msg, errors.New("Failed to parse table delta data") + } + + msg.Data = data + + // Decode contract row data + if table_name == "contract_row" { + dec, err := ship_helper.DecodeContractRow(processor.abi, data) + if err != nil { + return msg, errors.New("Failed to decode contract row") + } + msg.Data["value"] = dec + } + return msg, nil +} + // Callback function called by shipclient.Stream when a new block arrives. func (processor *ShipProcessor) processBlock(blockResult *ship.GetBlocksResultV0) { block := ship.SignedBlock{} From eb2032e233e3a4e3260aac35bb59fa09dfb18877 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Wed, 4 Dec 2024 15:14:10 +0100 Subject: [PATCH 58/68] internal/types/blacklist.go: implement wildcard for contracts --- internal/types/blacklist.go | 12 +++++++++++- internal/types/blacklist_test.go | 19 ++++++++++++++++++- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/internal/types/blacklist.go b/internal/types/blacklist.go index 24419c8..b123997 100644 --- a/internal/types/blacklist.go +++ b/internal/types/blacklist.go @@ -31,8 +31,18 @@ func (bl *Blacklist) Add(contract string, action string) { bl.table[contract] = append(bl.table[contract], action) } +func (bl Blacklist) list(contracts ...string) [][]string { + ret := [][]string{} + for _, contract := range contracts { + if v, ok := bl.table[contract]; ok { + ret = append(ret, v) + } + } + return ret +} + func (bl Blacklist) IsAllowed(contract string, action string) bool { - if v, ok := bl.table[contract]; ok { + for _, v := range bl.list(contract, "*") { for _, act := range v { if act == action || act == "*" { return bl.isWhitelist == true diff --git a/internal/types/blacklist_test.go b/internal/types/blacklist_test.go index 631d329..3c6a8a8 100644 --- a/internal/types/blacklist_test.go +++ b/internal/types/blacklist_test.go @@ -52,20 +52,32 @@ func TestBlacklist_IsAllowed(t *testing.T) { func TestBlacklist_IsAllowedWildcard(t *testing.T) { bl := Blacklist{ table: map[string][]string{ - "mycontract": {"*"}, + "mycontract": {"*"}, + "*": {"action1", "action2"}, + "evilcontract": {"evilaction"}, }, } require.False(t, bl.IsAllowed("mycontract", "myaction")) require.False(t, bl.IsAllowed("mycontract", "noop")) require.False(t, bl.IsAllowed("mycontract", "xxx")) + + // Wildcard contract + require.False(t, bl.IsAllowed("somecontract", "action1")) + require.False(t, bl.IsAllowed("someothercontract", "action1")) + require.False(t, bl.IsAllowed("randomcontract", "action2")) + require.False(t, bl.IsAllowed("evilcontract", "action2")) + require.False(t, bl.IsAllowed("evilcontract", "evilaction")) + require.True(t, bl.IsAllowed("xxx", "yyy")) + require.True(t, bl.IsAllowed("evilcontract", "alloweaction")) } func TestBlacklist_Whitelist(t *testing.T) { bl := Blacklist{ table: map[string][]string{ "mycontract": {"myaction", "noop"}, + "*": {"goodaction1", "goodaction2"}, }, } @@ -73,6 +85,11 @@ func TestBlacklist_Whitelist(t *testing.T) { require.True(t, bl.IsAllowed("mycontract", "myaction")) require.True(t, bl.IsAllowed("mycontract", "noop")) + + // Wildcard contract + require.True(t, bl.IsAllowed("mycontract", "goodaction1")) + require.True(t, bl.IsAllowed("someothercontract", "goodaction2")) + require.False(t, bl.IsAllowed("mycontract", "xxx")) require.False(t, bl.IsAllowed("xxx", "yyy")) } From 2006da6a19824bd5abdf5b7aa057121552c2409b Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Wed, 4 Dec 2024 15:15:22 +0100 Subject: [PATCH 59/68] internal/types/blacklist.go: add BlacklistWildcard constant --- internal/types/blacklist.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/types/blacklist.go b/internal/types/blacklist.go index b123997..4606c5e 100644 --- a/internal/types/blacklist.go +++ b/internal/types/blacklist.go @@ -1,5 +1,7 @@ package types +const BlacklistWildcard = "*" + type Blacklist struct { table map[string][]string isWhitelist bool @@ -42,9 +44,9 @@ func (bl Blacklist) list(contracts ...string) [][]string { } func (bl Blacklist) IsAllowed(contract string, action string) bool { - for _, v := range bl.list(contract, "*") { + for _, v := range bl.list(contract, BlacklistWildcard) { for _, act := range v { - if act == action || act == "*" { + if act == action || act == BlacklistWildcard { return bl.isWhitelist == true } } From 96b6a79813d3c18acc9b2664ceb809d09e2d7bd1 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Wed, 4 Dec 2024 15:21:50 +0100 Subject: [PATCH 60/68] Version v1.1.8-rc1 --- Makefile | 2 +- debian/changelog | 6 ++++++ docker/Dockerfile | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 4e543a7..d4f8331 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ GO=go GOLDFLAGS=-v -s -w -X main.VersionString=$(PROGRAM_VERSION) GOBUILDFLAGS+=-v -p $(shell nproc) -ldflags="$(GOLDFLAGS)" PROGRAM=thalos-server -PROGRAM_VERSION ?= 1.1.7 +PROGRAM_VERSION ?= 1.1.8-rc1 PREFIX=/usr/local BINDIR=$(PREFIX)/bin CFGDIR=$(PREFIX)/etc/thalos diff --git a/debian/changelog b/debian/changelog index a3ab8cc..6e5c94a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +thalos (1.1.8~rc1) bionic focal jammy; urgency=medium + + * Support for wildcard contracts in Blacklist + + -- Henrik Hautakoski Wed, 04 Dec 2024 15:19:53 +0100 + thalos (1.1.7) bionic focal jammy; urgency=medium * ship: set MaxMessagesInFlight to 1. This forces the client/server to ack diff --git a/docker/Dockerfile b/docker/Dockerfile index 40308ee..8a27563 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,6 +1,6 @@ FROM alpine:latest LABEL maintainer="Henrik Hautakoski " -ARG VERSION=1.1.7 +ARG VERSION=1.1.8-rc1 WORKDIR /thalos ADD --chmod=755 https://github.com/eosswedenorg/thalos/releases/download/v$VERSION/thalos-server-${VERSION}-linux-amd64-musl thalos-server ENTRYPOINT [ "./thalos-server" ] From ece6ccfac19a25d9c1f8fbcabd482d019943be68 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 21 Dec 2024 17:58:53 +0000 Subject: [PATCH 61/68] build(deps): bump golang.org/x/crypto from 0.22.0 to 0.31.0 Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.22.0 to 0.31.0. - [Commits](https://github.com/golang/crypto/compare/v0.22.0...v0.31.0) --- updated-dependencies: - dependency-name: golang.org/x/crypto dependency-type: indirect ... Signed-off-by: dependabot[bot] --- go.mod | 14 +++++++------- go.sum | 28 ++++++++++++++-------------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/go.mod b/go.mod index 4c07b37..807c10d 100644 --- a/go.mod +++ b/go.mod @@ -68,14 +68,14 @@ require ( github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect go.uber.org/mock v0.4.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.22.0 // indirect + golang.org/x/crypto v0.31.0 // indirect golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect - golang.org/x/mod v0.16.0 // indirect - golang.org/x/net v0.24.0 // indirect - golang.org/x/sync v0.7.0 // indirect - golang.org/x/sys v0.19.0 // indirect - golang.org/x/text v0.14.0 // indirect - golang.org/x/tools v0.19.0 // indirect + golang.org/x/mod v0.17.0 // indirect + golang.org/x/net v0.25.0 // indirect + golang.org/x/sync v0.10.0 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect + golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/ini.v1 v1.67.0 // indirect ) diff --git a/go.sum b/go.sum index 6d81242..883609a 100644 --- a/go.sum +++ b/go.sum @@ -234,8 +234,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= -golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= -golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= +golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= +golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 h1:LfspQV/FYTatPTr/3HzIcmiUFH7PGP+OQ6mgDYo3yuQ= golang.org/x/exp v0.0.0-20240222234643-814bf88cf225/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -243,8 +243,8 @@ golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2 golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.16.0 h1:QX4fJ0Rr5cPQCF7O9lh9Se4pmwfwskqZfq5moyldzic= -golang.org/x/mod v0.16.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -260,16 +260,16 @@ golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.3.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= -golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= -golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= +golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= +golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -294,8 +294,8 @@ golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= -golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= +golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -309,8 +309,8 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -320,8 +320,8 @@ golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= golang.org/x/tools v0.4.0/go.mod h1:UE5sM2OK9E/d67R0ANs2xJizIymRP5gJU295PvKXxjQ= -golang.org/x/tools v0.19.0 h1:tfGCXNR1OsFG+sVdLAitlpjAvD/I6dHDKnYrpEZUHkw= -golang.org/x/tools v0.19.0/go.mod h1:qoJWxmGSIBmAeriMx19ogtrEPrGtDbPK634QFIcLAhc= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= From ce80405254736ff1163ffbec840b4dae9cac67bf Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Sat, 21 Dec 2024 19:14:26 +0100 Subject: [PATCH 62/68] github workflows: add permissions. --- .github/workflows/devbuild.yaml | 3 +++ .github/workflows/release.yml | 2 ++ .github/workflows/test.yml | 3 +++ 3 files changed, 8 insertions(+) diff --git a/.github/workflows/devbuild.yaml b/.github/workflows/devbuild.yaml index 73ba184..763d9a1 100644 --- a/.github/workflows/devbuild.yaml +++ b/.github/workflows/devbuild.yaml @@ -1,5 +1,8 @@ name: Development build +permissions: + contents: write + on: push: branches: [ dev ] diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4f8760d..c8f2b0d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,6 @@ name: Package +permissions: + contents: write on: release: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index af79d53..936561a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,5 +1,8 @@ name: Test +permissions: + contents: read + on: - push - pull_request From 4bc6df8c83a45bc08dc7f3a9ffd30285ce9bf3b2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 4 Dec 2024 14:29:40 +0000 Subject: [PATCH 63/68] build(deps): bump github.com/quic-go/quic-go from 0.42.0 to 0.48.2 Bumps [github.com/quic-go/quic-go](https://github.com/quic-go/quic-go) from 0.42.0 to 0.48.2. - [Release notes](https://github.com/quic-go/quic-go/releases) - [Changelog](https://github.com/quic-go/quic-go/blob/master/Changelog.md) - [Commits](https://github.com/quic-go/quic-go/compare/v0.42.0...v0.48.2) --- updated-dependencies: - dependency-name: github.com/quic-go/quic-go dependency-type: indirect ... Signed-off-by: dependabot[bot] --- go.mod | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 807c10d..259d9d3 100644 --- a/go.mod +++ b/go.mod @@ -2,6 +2,8 @@ module github.com/eosswedenorg/thalos go 1.21 +toolchain go1.22.5 + require ( github.com/cenkalti/backoff/v4 v4.2.1 github.com/docker/go-units v0.5.0 @@ -51,8 +53,8 @@ require ( github.com/pelletier/go-toml/v2 v2.1.1 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/quic-go/qpack v0.4.0 // indirect - github.com/quic-go/quic-go v0.42.0 // indirect + github.com/quic-go/qpack v0.5.1 // indirect + github.com/quic-go/quic-go v0.48.2 // indirect github.com/refraction-networking/utls v1.6.3 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect From bb268aa9fa3dbb07cee7f6ca440a78718f54ca4e Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Sat, 21 Dec 2024 19:47:51 +0100 Subject: [PATCH 64/68] update github.com/imroc/req to v3.49.0 --- go.mod | 31 +++++++++++------------- go.sum | 76 +++++++++++++++++++++++++++++----------------------------- 2 files changed, 52 insertions(+), 55 deletions(-) diff --git a/go.mod b/go.mod index 259d9d3..f8d1b28 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,6 @@ module github.com/eosswedenorg/thalos -go 1.21 - -toolchain go1.22.5 +go 1.22.0 require ( github.com/cenkalti/backoff/v4 v4.2.1 @@ -26,36 +24,35 @@ require ( ) require ( - github.com/andybalholm/brotli v1.1.0 // indirect + github.com/andybalholm/brotli v1.1.1 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect - github.com/cloudflare/circl v1.3.7 // indirect + github.com/cloudflare/circl v1.5.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect - github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect + github.com/go-task/slim-sprig/v3 v3.0.0 // indirect github.com/go-telegram-bot-api/telegram-bot-api v4.6.4+incompatible // indirect github.com/google/go-cmp v0.6.0 // indirect - github.com/google/pprof v0.0.0-20240227163752-401108e1b7e7 // indirect + github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad // indirect github.com/gorilla/websocket v1.5.1 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/hcl v1.0.0 // indirect - github.com/imroc/req/v3 v3.43.4 // indirect + github.com/imroc/req/v3 v3.49.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.17.8 // indirect + github.com/klauspost/compress v1.17.11 // indirect github.com/liamylian/jsontime/v2 v2.0.0 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/onsi/ginkgo/v2 v2.16.0 // indirect - github.com/onsi/gomega v1.31.1 // indirect + github.com/onsi/ginkgo/v2 v2.22.0 // indirect github.com/pelletier/go-toml/v2 v2.1.1 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/quic-go/qpack v0.5.1 // indirect github.com/quic-go/quic-go v0.48.2 // indirect - github.com/refraction-networking/utls v1.6.3 // indirect + github.com/refraction-networking/utls v1.6.7 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/shufflingpixels/jsontime-go v0.0.0-20240622163621-cf4b2804c92d // indirect @@ -68,16 +65,16 @@ require ( github.com/vmihailenco/go-tinylfu v0.2.2 // indirect github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect - go.uber.org/mock v0.4.0 // indirect + go.uber.org/mock v0.5.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/crypto v0.31.0 // indirect - golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect - golang.org/x/mod v0.17.0 // indirect - golang.org/x/net v0.25.0 // indirect + golang.org/x/exp v0.0.0-20241215155358-4a5509556b9e // indirect + golang.org/x/mod v0.22.0 // indirect + golang.org/x/net v0.32.0 // indirect golang.org/x/sync v0.10.0 // indirect golang.org/x/sys v0.28.0 // indirect golang.org/x/text v0.21.0 // indirect - golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect + golang.org/x/tools v0.28.0 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/ini.v1 v1.67.0 // indirect ) diff --git a/go.sum b/go.sum index 883609a..90931ae 100644 --- a/go.sum +++ b/go.sum @@ -2,8 +2,8 @@ github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZp github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= github.com/alicebob/miniredis/v2 v2.30.2 h1:lc1UAUT9ZA7h4srlfBmBt2aorm5Yftk9nBjxz7EyY9I= github.com/alicebob/miniredis/v2 v2.30.2/go.mod h1:b25qWj4fCEsBeAAR2mlb0ufImGC6uH3VlUfb/HS5zKg= -github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1U3M= -github.com/andybalholm/brotli v1.1.0/go.mod h1:sms7XGricyQI9K10gOSf56VKKWS4oLer58Q+mhRPtnY= +github.com/andybalholm/brotli v1.1.1 h1:PR2pgnyFznKEugtsUo0xLdDop5SKXd5Qf5ysW+7XdTA= +github.com/andybalholm/brotli v1.1.1/go.mod h1:05ib4cKhjx3OQYUY22hTVd34Bc8upXjOLL2rKwwZBoA= github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs= github.com/bsm/ginkgo/v2 v2.12.0/go.mod h1:SwYbGRRDovPVboqFv0tPTcG1sN61LM1Z4ARdbAV9g4c= github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA= @@ -17,8 +17,8 @@ github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU= -github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA= +github.com/cloudflare/circl v1.5.0 h1:hxIWksrX6XN5a1L2TI/h53AGPhNHoUBo+TD1ms9+pys= +github.com/cloudflare/circl v1.5.0/go.mod h1:uddAzsPgqdMAYatqJ0lsjX1oECcQLIlRpzZh3pJrofs= github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -40,15 +40,15 @@ github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4 github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= -github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= +github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-redis/cache/v9 v9.0.0 h1:0thdtFo0xJi0/WXbRVu8B066z8OvVymXTJGaXrVWnN0= github.com/go-redis/cache/v9 v9.0.0/go.mod h1:cMwi1N8ASBOufbIvk7cdXe2PbPjK/WMRL95FFHWsSgI= github.com/go-redis/redismock/v9 v9.2.0 h1:ZrMYQeKPECZPjOj5u9eyOjg8Nnb0BS9lkVIZ6IpsKLw= github.com/go-redis/redismock/v9 v9.2.0/go.mod h1:18KHfGDK4Y6c2R0H38EUGWAdc7ZQS9gfYxc94k7rWT0= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= -github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= -github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= +github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= +github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/go-telegram-bot-api/telegram-bot-api v4.6.4+incompatible h1:2cauKuaELYAEARXRkq2LrJ0yDDv1rW7+wrTEdVL3uaU= github.com/go-telegram-bot-api/telegram-bot-api v4.6.4+incompatible/go.mod h1:qf9acutJ8cwBUhm1bqgz6Bei9/C/c93FPDljKWwsOgM= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -60,8 +60,6 @@ github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvq github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= @@ -72,8 +70,8 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20240227163752-401108e1b7e7 h1:y3N7Bm7Y9/CtpiVkw/ZWj6lSlDF3F74SfKwfTCer72Q= -github.com/google/pprof v0.0.0-20240227163752-401108e1b7e7/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik= +github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad h1:a6HEuzUHeKH6hwfN/ZoQgRgVIWFJljSWa/zetS2WTvg= +github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY= github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -85,8 +83,8 @@ github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/imroc/req/v3 v3.43.4 h1:NSXlB5dELZuxzGEFRWLWEQ9dQmh8d9pUMPa7MevK1K4= -github.com/imroc/req/v3 v3.43.4/go.mod h1:SQIz5iYop16MJxbo8ib+4LnostGCok8NQf8ToyQc2xA= +github.com/imroc/req/v3 v3.49.0 h1:5Rac2qvz7Dq0E3PeBo/c2szV3hagPQIGLoHtfBmYhu4= +github.com/imroc/req/v3 v3.49.0/go.mod h1:XZf4t94DNJzcA0UOBlA68hmSrWsAyvN407ADdH4mzCA= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jordan-wright/email v4.0.1-0.20210109023952-943e75fe5223+incompatible h1:jdpOPRN1zP63Td1hDQbZW73xKmzDvZHzVdNYxhnTMDA= @@ -97,8 +95,8 @@ github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHm github.com/karlseguin/typed v1.1.8 h1:ND0eDpwiUFIrm/n1ehxUyh/XNGs9zkYrLxtGqENSalY= github.com/karlseguin/typed v1.1.8/go.mod h1:pZlmYaWQ7MVpwfIOP88fASh3LopVxKeE+uNXW3hQ2D8= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/klauspost/compress v1.17.8 h1:YcnTYrq7MikUT7k0Yb5eceMmALQPYBW/Xltxn0NAMnU= -github.com/klauspost/compress v1.17.8/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= +github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc= +github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= @@ -138,8 +136,8 @@ github.com/onsi/ginkgo/v2 v2.3.0/go.mod h1:Eew0uilEqZmIEZr8JrvYlvOM7Rr6xzTmMV8Ay github.com/onsi/ginkgo/v2 v2.4.0/go.mod h1:iHkDK1fKGcBoEHT5W7YBq4RFWaQulw+caOMkAt4OrFo= github.com/onsi/ginkgo/v2 v2.5.0/go.mod h1:Luc4sArBICYCS8THh8v3i3i5CuSZO+RaQRaJoeNwomw= github.com/onsi/ginkgo/v2 v2.7.0/go.mod h1:yjiuMwPokqY1XauOgju45q3sJt6VzQ/Fict1LFVcsAo= -github.com/onsi/ginkgo/v2 v2.16.0 h1:7q1w9frJDzninhXxjZd+Y/x54XNjG/UlRLIYPZafsPM= -github.com/onsi/ginkgo/v2 v2.16.0/go.mod h1:llBI3WDLL9Z6taip6f33H76YcWtJv+7R3HigUjbIBOs= +github.com/onsi/ginkgo/v2 v2.22.0 h1:Yed107/8DjTr0lKCNt7Dn8yQ6ybuDRQoMGrNFKzMfHg= +github.com/onsi/ginkgo/v2 v2.22.0/go.mod h1:7Du3c42kxCUegi0IImZ1wUQzMBVecgIHjR1C+NkhLQo= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= @@ -150,8 +148,8 @@ github.com/onsi/gomega v1.22.1/go.mod h1:x6n7VNe4hw0vkyYUM4mjIXx3JbLiPaBPNgB7PRQ github.com/onsi/gomega v1.24.0/go.mod h1:Z/NWtiqwBrwUt4/2loMmHL63EDLnYHmVbuBpDr2vQAg= github.com/onsi/gomega v1.24.1/go.mod h1:3AOiACssS3/MajrniINInwbfOOtfZvplPzuRSmvt1jM= github.com/onsi/gomega v1.25.0/go.mod h1:r+zV744Re+DiYCIPRlYOTxn0YkOLcAnW8k1xXdMPGhM= -github.com/onsi/gomega v1.31.1 h1:KYppCUK+bUgAZwHOu7EXVBKyQA6ILvOESHkn/tgoqvo= -github.com/onsi/gomega v1.31.1/go.mod h1:y40C95dwAD1Nz36SsEnxvfFe8FFfNxzI5eJ0EYGyAy0= +github.com/onsi/gomega v1.34.2 h1:pNCwDkzrsv7MS9kpaQvVb1aVLahQXyJ/Tv5oAZMI3i8= +github.com/onsi/gomega v1.34.2/go.mod h1:v1xfxRgk0KIsG+QOdm7p8UosrOzPYRo60fd3B/1Dukc= github.com/pelletier/go-toml/v2 v2.1.1 h1:LWAJwfNvjQZCFIDKWYQaM62NcYeYViCmWIwmOStowAI= github.com/pelletier/go-toml/v2 v2.1.1/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -159,15 +157,15 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/quic-go/qpack v0.4.0 h1:Cr9BXA1sQS2SmDUWjSofMPNKmvF6IiIfDRmgU0w1ZCo= -github.com/quic-go/qpack v0.4.0/go.mod h1:UZVnYIfi5GRk+zI9UMaCPsmZ2xKJP7XBUvVyT1Knj9A= -github.com/quic-go/quic-go v0.42.0 h1:uSfdap0eveIl8KXnipv9K7nlwZ5IqLlYOpJ58u5utpM= -github.com/quic-go/quic-go v0.42.0/go.mod h1:132kz4kL3F9vxhW3CtQJLDVwcFe5wdWeJXXijhsO57M= +github.com/quic-go/qpack v0.5.1 h1:giqksBPnT/HDtZ6VhtFKgoLOWmlyo9Ei6u9PqzIMbhI= +github.com/quic-go/qpack v0.5.1/go.mod h1:+PC4XFrEskIVkcLzpEkbLqq1uCoxPhQuvK5rH1ZgaEg= +github.com/quic-go/quic-go v0.48.2 h1:wsKXZPeGWpMpCGSWqOcqpW2wZYic/8T3aqiOID0/KWE= +github.com/quic-go/quic-go v0.48.2/go.mod h1:yBgs3rWBOADpga7F+jJsb6Ybg1LSYiQvwWlLX+/6HMs= github.com/redis/go-redis/v9 v9.0.0-rc.4/go.mod h1:Vo3EsyWnicKnSKCA7HhgnvnyA74wOA69Cd2Meli5mmA= github.com/redis/go-redis/v9 v9.5.1 h1:H1X4D3yHPaYrkL5X06Wh6xNVM/pX0Ft4RV0vMGvLBh8= github.com/redis/go-redis/v9 v9.5.1/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M= -github.com/refraction-networking/utls v1.6.3 h1:MFOfRN35sSx6K5AZNIoESsBuBxS2LCgRilRIdHb6fDc= -github.com/refraction-networking/utls v1.6.3/go.mod h1:yil9+7qSl+gBwJqztoQseO6Pr3h62pQoY1lXiNR/FPs= +github.com/refraction-networking/utls v1.6.7 h1:zVJ7sP1dJx/WtVuITug3qYUq034cDq9B2MR1K67ULZM= +github.com/refraction-networking/utls v1.6.7/go.mod h1:BC3O4vQzye5hqpmDTWUqi4P5DDhzJfkV1tdqtawQIH0= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= @@ -220,13 +218,15 @@ github.com/vmihailenco/msgpack/v5 v5.4.1 h1:cQriyiUvjTwOHg8QZaPihLWeRAAVoCpE00IU github.com/vmihailenco/msgpack/v5 v5.4.1/go.mod h1:GaZTsDaehaPpQVyxrf5mtQlH+pc21PIudVV/E3rRQok= github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g= github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= +github.com/xyproto/randomstring v1.0.5 h1:YtlWPoRdgMu3NZtP45drfy1GKoojuR7hmRcnhZqKjWU= +github.com/xyproto/randomstring v1.0.5/go.mod h1:rgmS5DeNXLivK7YprL0pY+lTuhNQW3iGxZ18UQApw/E= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yuin/gopher-lua v1.1.0 h1:BojcDhfyDWgU2f2TOzYK/g5p2gxMrku8oupLDqlnSqE= github.com/yuin/gopher-lua v1.1.0/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw= -go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU= -go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= +go.uber.org/mock v0.5.0 h1:KAMbZvZPyBPWgD14IrIQ38QCyjwpvVVV6K/bHl1IwQU= +go.uber.org/mock v0.5.0/go.mod h1:ge71pBPLYDk7QIi1LupWxdAykm7KIEFchiOqd6z7qMM= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= @@ -236,15 +236,15 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= -golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 h1:LfspQV/FYTatPTr/3HzIcmiUFH7PGP+OQ6mgDYo3yuQ= -golang.org/x/exp v0.0.0-20240222234643-814bf88cf225/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= +golang.org/x/exp v0.0.0-20241215155358-4a5509556b9e h1:4qufH0hlUYs6AO6XmZC3GqfDPGSXHVXUFR6OND+iJX4= +golang.org/x/exp v0.0.0-20241215155358-4a5509556b9e/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= -golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4= +golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -260,8 +260,8 @@ golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.3.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= -golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= -golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= +golang.org/x/net v0.32.0 h1:ZqPmj8Kzc+Y6e0+skZsuACbx+wzMgo5MQsJh9Qd6aYI= +golang.org/x/net v0.32.0/go.mod h1:CwU0IoeOlnQQWJ6ioyFrfRuomB8GKF6KbYXZVyeXNfs= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -320,8 +320,8 @@ golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= golang.org/x/tools v0.4.0/go.mod h1:UE5sM2OK9E/d67R0ANs2xJizIymRP5gJU295PvKXxjQ= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= -golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= +golang.org/x/tools v0.28.0 h1:WuB6qZ4RPCQo5aP3WdKZS7i595EdWqWR8vqJTlwTVK8= +golang.org/x/tools v0.28.0/go.mod h1:dcIOrVd3mfQKTgrDVQHqCPMWy6lnhfhtX3hLXYVLfRw= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -335,8 +335,8 @@ google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2 google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= +google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= From af5593b5f337b18748f5ce8342254c2d20d4888e Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Sat, 21 Dec 2024 19:50:01 +0100 Subject: [PATCH 65/68] github workflows: update to go version 1.22 --- .github/workflows/devbuild.yaml | 4 ++-- .github/workflows/release.yml | 6 +++--- .github/workflows/test.yml | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/devbuild.yaml b/.github/workflows/devbuild.yaml index 763d9a1..4576b25 100644 --- a/.github/workflows/devbuild.yaml +++ b/.github/workflows/devbuild.yaml @@ -22,7 +22,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: 1.21 + go-version: 1.22 - name: compile id: compile @@ -53,7 +53,7 @@ jobs: runs-on: ubuntu-latest name: musl (${{ matrix.arch }}) container: - image: golang:1.21-alpine3.19 + image: golang:1.22-alpine3.19 steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c8f2b0d..9c900d7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,7 +21,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: 1.21 + go-version: 1.22 - name: compile id: compile @@ -70,7 +70,7 @@ jobs: runs-on: ubuntu-latest name: Build musl (${{ matrix.arch }}) container: - image: golang:1.21-alpine3.19 + image: golang:1.22-alpine3.19 steps: - uses: actions/checkout@v4 @@ -129,7 +129,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: 1.21 + go-version: 1.22 - name: Install build dependencies run: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 936561a..1b69220 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,7 +13,7 @@ jobs: strategy: fail-fast: false matrix: - go-version: ["1.21"] + go-version: ["1.22"] arch: [ 386, amd64 ] runs-on: ubuntu-latest name: Test (${{matrix.arch}} go v${{ matrix.go-version }}) @@ -35,7 +35,7 @@ jobs: strategy: fail-fast: false matrix: - tag: [ "1.21-alpine3.19"] + tag: [ "1.22-alpine3.19"] runs-on: ubuntu-latest name: Test alpine (${{ matrix.tag }}) container: From 07ccab4628a6520a6d93b3aecf158811b33d144a Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Mon, 23 Dec 2024 09:30:24 +0100 Subject: [PATCH 66/68] Version 1.1.8 --- Makefile | 2 +- debian/changelog | 8 ++++++++ docker/Dockerfile | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index d4f8331..b96ea39 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ GO=go GOLDFLAGS=-v -s -w -X main.VersionString=$(PROGRAM_VERSION) GOBUILDFLAGS+=-v -p $(shell nproc) -ldflags="$(GOLDFLAGS)" PROGRAM=thalos-server -PROGRAM_VERSION ?= 1.1.8-rc1 +PROGRAM_VERSION ?= 1.1.8 PREFIX=/usr/local BINDIR=$(PREFIX)/bin CFGDIR=$(PREFIX)/etc/thalos diff --git a/debian/changelog b/debian/changelog index 6e5c94a..50b934f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +thalos (1.1.8) bionic focal jammy; urgency=medium + + * Support for wildcard contracts in Blacklist + * [Security CVE-2024-45337] Update golang.org/x/crypto to 0.31.0 + * [Security CVE-2024-53259] Update github.com/quic-go/quic-go to 0.48.2 + + -- Henrik Hautakoski Mon, 23 Dec 2024 09:25:44 +0100 + thalos (1.1.8~rc1) bionic focal jammy; urgency=medium * Support for wildcard contracts in Blacklist diff --git a/docker/Dockerfile b/docker/Dockerfile index 8a27563..ac810bf 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,6 +1,6 @@ FROM alpine:latest LABEL maintainer="Henrik Hautakoski " -ARG VERSION=1.1.8-rc1 +ARG VERSION=1.1.8 WORKDIR /thalos ADD --chmod=755 https://github.com/eosswedenorg/thalos/releases/download/v$VERSION/thalos-server-${VERSION}-linux-amd64-musl thalos-server ENTRYPOINT [ "./thalos-server" ] From 438699fb10b59cdc596667e0feddecd7d440e08d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 23 Jan 2025 18:26:09 +0000 Subject: [PATCH 67/68] build(deps): bump golang.org/x/net from 0.32.0 to 0.33.0 Bumps [golang.org/x/net](https://github.com/golang/net) from 0.32.0 to 0.33.0. - [Commits](https://github.com/golang/net/compare/v0.32.0...v0.33.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: indirect ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index f8d1b28..b7de7b0 100644 --- a/go.mod +++ b/go.mod @@ -70,7 +70,7 @@ require ( golang.org/x/crypto v0.31.0 // indirect golang.org/x/exp v0.0.0-20241215155358-4a5509556b9e // indirect golang.org/x/mod v0.22.0 // indirect - golang.org/x/net v0.32.0 // indirect + golang.org/x/net v0.33.0 // indirect golang.org/x/sync v0.10.0 // indirect golang.org/x/sys v0.28.0 // indirect golang.org/x/text v0.21.0 // indirect diff --git a/go.sum b/go.sum index 90931ae..7a6c686 100644 --- a/go.sum +++ b/go.sum @@ -260,8 +260,8 @@ golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.3.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= -golang.org/x/net v0.32.0 h1:ZqPmj8Kzc+Y6e0+skZsuACbx+wzMgo5MQsJh9Qd6aYI= -golang.org/x/net v0.32.0/go.mod h1:CwU0IoeOlnQQWJ6ioyFrfRuomB8GKF6KbYXZVyeXNfs= +golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= +golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= From 6ad6b444339a1547e9f904d2186fb2da0e97e5f9 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Thu, 23 Jan 2025 19:32:45 +0100 Subject: [PATCH 68/68] Version 1.1.9 --- Makefile | 2 +- debian/changelog | 6 ++++++ docker/Dockerfile | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index b96ea39..33fd99f 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ GO=go GOLDFLAGS=-v -s -w -X main.VersionString=$(PROGRAM_VERSION) GOBUILDFLAGS+=-v -p $(shell nproc) -ldflags="$(GOLDFLAGS)" PROGRAM=thalos-server -PROGRAM_VERSION ?= 1.1.8 +PROGRAM_VERSION ?= 1.1.9 PREFIX=/usr/local BINDIR=$(PREFIX)/bin CFGDIR=$(PREFIX)/etc/thalos diff --git a/debian/changelog b/debian/changelog index 50b934f..ecc01aa 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +thalos (1.1.9) bionic focal jammy; urgency=medium + + * [Security CVE-2024-45338] Update golang.org/x/net to 0.33.0 + + -- Henrik Hautakoski Thu, 23 Jan 2025 19:30:31 +0100 + thalos (1.1.8) bionic focal jammy; urgency=medium * Support for wildcard contracts in Blacklist diff --git a/docker/Dockerfile b/docker/Dockerfile index ac810bf..b8fb57f 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,6 +1,6 @@ FROM alpine:latest LABEL maintainer="Henrik Hautakoski " -ARG VERSION=1.1.8 +ARG VERSION=1.1.9 WORKDIR /thalos ADD --chmod=755 https://github.com/eosswedenorg/thalos/releases/download/v$VERSION/thalos-server-${VERSION}-linux-amd64-musl thalos-server ENTRYPOINT [ "./thalos-server" ]