diff --git a/.github/workflows/docker-release.yml b/.github/workflows/docker-release.yml index d1274f425a..0e58d544cc 100644 --- a/.github/workflows/docker-release.yml +++ b/.github/workflows/docker-release.yml @@ -46,4 +46,6 @@ jobs: echo IMAGE_ID=$IMAGE_ID echo VERSION=$VERSION docker tag $IMAGE_NAME $IMAGE_ID:$VERSION + docker tag $IMAGE_NAME $IMAGE_ID:latest docker push $IMAGE_ID:$VERSION + docker push $IMAGE_ID:latest diff --git a/core/blockarchiver/client.go b/core/blockarchiver/client.go index 97d9398b2e..a49f161bc2 100644 --- a/core/blockarchiver/client.go +++ b/core/blockarchiver/client.go @@ -13,6 +13,7 @@ import ( "time" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/log" bundlesdk "github.com/bnb-chain/greenfield-bundle-sdk/bundle" ) @@ -145,23 +146,24 @@ func (c *Client) GetBundleBlocks(ctx context.Context, objectName string) ([]*Blo tempFile, err := os.CreateTemp("", "bundle") if err != nil { - fmt.Printf("Failed to create temporary file: %v\n", err) + log.Error("Failed to create temporary file: %v\n", err) return nil, err } defer os.Remove(tempFile.Name()) // Write the content to the temporary file _, err = tempFile.Write(body) if err != nil { - fmt.Printf("Failed to write downloaded bundle to file: %v\n", err) + log.Error("Failed to write downloaded bundle to file: %v\n", err) return nil, err } defer tempFile.Close() bundleObjects, err := bundlesdk.NewBundleFromFile(tempFile.Name()) if err != nil { - fmt.Printf("Failed to create bundle from file: %v\n", err) + log.Error("Failed to create bundle from file: %v\n", err) return nil, err } + var blocksInfo []*Block for _, objMeta := range bundleObjects.GetBundleObjectsMeta() { objFile, _, err := bundleObjects.GetObject(objMeta.Name) @@ -184,7 +186,7 @@ func (c *Client) GetBundleBlocks(ctx context.Context, objectName string) ([]*Blo } blocksInfo = append(blocksInfo, blockInfo) } - + log.Info("fetched bundle of blocks", "number", blocksInfo[0].Number) return blocksInfo, nil } diff --git a/core/blockarchiver/types.go b/core/blockarchiver/types.go index 6c22cd5fd1..db707091a3 100644 --- a/core/blockarchiver/types.go +++ b/core/blockarchiver/types.go @@ -4,10 +4,10 @@ import ( "math/big" "strconv" "strings" - "sync" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/log" + "github.com/sasha-s/go-deadlock" ) // JsonError represents an error in JSON format @@ -123,7 +123,7 @@ type RequestLock struct { // if the number is within any of the ranges, but we don't need to populate the lookup every time a new range is added. rangeMap map[uint64]*Range lookupMap map[uint64]*Range - mu sync.RWMutex + mu deadlock.RWMutex } // NewRequestLock creates a new RequestLock