Skip to content

Commit

Permalink
bump firehose core and fix encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
jubeless committed Aug 3, 2023
1 parent 70c1866 commit ebfd89f
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 7 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). See [MAINTAINERS.md](./MAINTAINERS.md)
for instructions to keep up to date.

### Changed

* Migrated to firehose-core
* change block reader-node block encoding from hex to base64


## v0.2.2-rc1

This release candidate is a hotfix for an issue introduced at v0.2.1 and affecting `production-mode` where the stream will hang and some `map_outputs` will not be produced over some specific ranges of the chains.
Expand Down
8 changes: 4 additions & 4 deletions cmd/firesol/tools_bigtable_blocks.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package main

import (
"encoding/hex"
"encoding/base64"
"encoding/json"
"fmt"
"strconv"
Expand All @@ -25,7 +25,7 @@ func newToolsBigTableBlocksCmd(logger *zap.Logger, tracer logging.Tracer) *cobra
RunE: bigtableBlocksRunE(logger, tracer),
}

cmd.Flags().Bool("firehose-enabled", false, "When enable the blocks read will output Firehose formated logs 'FIRE <block_num> <block_payload_in_hex>'")
cmd.Flags().Bool("firehose-enabled", false, "When enable the blocks read will output Firehose formatted logs 'FIRE <block_num> <block_payload_in_hex>'")
cmd.Flags().Bool("compact", false, "When printing in JSON it will print compact instead of pretty-printed output")
cmd.Flags().Bool("linkable", false, "Ensure that no block is skipped they are linkeable")
return cmd
Expand Down Expand Up @@ -75,8 +75,8 @@ func bigtableBlocksRunE(logger *zap.Logger, tracer logging.Tracer) firecore.Comm
if err != nil {
return fmt.Errorf("failed to proto marshal pb sol block: %w", err)
}

lineCnt := fmt.Sprintf("FIRE BLOCK %d %s", block.Slot, hex.EncodeToString(cnt))
b64Cnt := base64.StdEncoding.EncodeToString(cnt)
lineCnt := fmt.Sprintf("FIRE BLOCK %d %s", block.Slot, b64Cnt)
if _, err := fmt.Println(lineCnt); err != nil {
return fmt.Errorf("failed to write log line (char lenght %d): %w", len(lineCnt), err)
}
Expand Down
4 changes: 2 additions & 2 deletions codec/consolereader-bt.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package codec

import (
"bufio"
"encoding/hex"
"encoding/base64"
"fmt"
"io"
"strconv"
Expand Down Expand Up @@ -117,7 +117,7 @@ func (cr *BigtableConsoleReader) readBlock(line string) (out *bstream.Block, err
}

var cnt []byte
if cnt, err = hex.DecodeString(chunks[2]); err != nil {
if cnt, err = base64.StdEncoding.DecodeString(chunks[2]); err != nil {
return nil, fmt.Errorf("unable to hex decode content: %w", err)
}

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ require (
github.com/streamingfast/cli v0.0.4-0.20230608140431-f501fec4f1ce
github.com/streamingfast/dlauncher v0.0.0-20230607184145-76399faad89e
github.com/streamingfast/dstore v0.1.1-0.20230620124109-3924b3b36c77
github.com/streamingfast/firehose-core v0.1.7-0.20230801203914-74cb1d9688b4
github.com/streamingfast/firehose-core v0.1.7-0.20230803185901-18849126b832
github.com/streamingfast/jsonpb v0.0.0-20210811021341-3670f0aa02d0
github.com/streamingfast/logging v0.0.0-20230608130331-f22c91403091
github.com/streamingfast/node-manager v0.0.2-0.20230406142433-692298a8b8d2
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,8 @@ github.com/streamingfast/firehose-core v0.1.7-0.20230801191843-3fb4368c70e7 h1:3
github.com/streamingfast/firehose-core v0.1.7-0.20230801191843-3fb4368c70e7/go.mod h1:DfOy2XdI8zaH+NONVX75X+coBugZ5zO+14DTd4+6Nxs=
github.com/streamingfast/firehose-core v0.1.7-0.20230801203914-74cb1d9688b4 h1:a2Jego7HU/LqKgu2h3P+X8RvgrvUnUh/hDNFmEnCszY=
github.com/streamingfast/firehose-core v0.1.7-0.20230801203914-74cb1d9688b4/go.mod h1:DfOy2XdI8zaH+NONVX75X+coBugZ5zO+14DTd4+6Nxs=
github.com/streamingfast/firehose-core v0.1.7-0.20230803185901-18849126b832 h1:pC6wZWdHZobIMMW5ruAGieZhnBpPdj4j8DKt1KhVVhM=
github.com/streamingfast/firehose-core v0.1.7-0.20230803185901-18849126b832/go.mod h1:DfOy2XdI8zaH+NONVX75X+coBugZ5zO+14DTd4+6Nxs=
github.com/streamingfast/index-builder v0.0.0-20221031203737-fa2e70f09dc2 h1:dgYLhP3STiPi30fISAijFPEB11D4r1fQFc8D3cpgV5s=
github.com/streamingfast/index-builder v0.0.0-20221031203737-fa2e70f09dc2/go.mod h1:OYv1UX/kRsV9aP4SEwa9zpt34qGzdtJzOvdGn+n56as=
github.com/streamingfast/jsonpb v0.0.0-20210811021341-3670f0aa02d0 h1:g8eEYbFSykyzIyuxNMmHEUGGUvJE0ivmqZagLDK42gw=
Expand Down

0 comments on commit ebfd89f

Please sign in to comment.