Skip to content

Commit

Permalink
fix: debug
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgao001 committed Jul 29, 2024
1 parent 6bbe0ff commit eb37704
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/docker-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,4 @@ 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
6 changes: 4 additions & 2 deletions core/blockarchiver/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func (c *BlockArchiverService) getBlockByNumber(number uint64) (*types.Body, *ty
// if the number is within any of the ranges, should not fetch the bundle from the block archiver service but
// wait for a while and fetch from the cache
if c.requestLock.IsWithinAnyRange(number) {
log.Debug("getBlockByNumber is within any range", number)
log.Info("getBlockByNumber is within any range", number)
if blockRange := c.requestLock.GetRangeForNumber(number); blockRange != nil {
select {
case <-blockRange.done:
Expand Down Expand Up @@ -152,10 +152,12 @@ func (c *BlockArchiverService) getBlockByNumber(number uint64) (*types.Body, *ty
log.Error("failed to get bundle blocks", "bundleName", bundleName, "err", err)
return nil, nil, err
}
log.Info("fetched bundle of blocks", "number", number)

var body *types.Body
var header *types.Header

log.Debug("populating block cache", "start", start, "end", end)
log.Info("populating block cache", "start", start, "end", end)
for _, b := range blocks {
block, err := convertBlock(b)
if err != nil {
Expand Down
3 changes: 3 additions & 0 deletions core/blockarchiver/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"sync"

"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/log"
)

// JsonError represents an error in JSON format
Expand Down Expand Up @@ -143,6 +144,7 @@ func (rl *RequestLock) IsWithinAnyRange(num uint64) bool {

// AddRange adds a new range to the cache
func (rl *RequestLock) AddRange(from, to uint64) {
log.Info("adding range", "from", from, "to", to)
rl.mu.Lock()
defer rl.mu.Unlock()
newRange := &Range{
Expand All @@ -159,6 +161,7 @@ func (rl *RequestLock) AddRange(from, to uint64) {

// RemoveRange removes a range from the cache
func (rl *RequestLock) RemoveRange(from, to uint64) {
log.Info("removing range", "from", from, "to", to)
rl.mu.Lock()
defer rl.mu.Unlock()

Expand Down

0 comments on commit eb37704

Please sign in to comment.