Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- `blockstream.Source` now sends gRPC keepalive pings after `30s` without data (was `5m` from dgrpc) and drops the connection after `10s` without an ack, so a relayer that disappears without closing the connection (e.g. host reboot) is detected in about 40s instead of 5 minutes.
- The hub no longer reads the `SOURCE_CHAN_SIZE` environment variable; set `hub.SubscriptionMaxBufferedBlocks` instead. The default goes from `100` to `10000` blocks: on fast chains, a burst of live blocks after a short pause from the live source filled 100 slots before the consumer could send the first block, closing healthy subscriptions. A consumer that cannot keep up is now caught by `SubscriptionCatchUpTimeout` instead.
- `OneBlockFile.CanonicalName` no longer includes the LIB number (`num-id-prevID` instead of `num-id-prevID-lib`). Readers whose view of the LIB differs, as on Polygon PoS / Amoy, write the same block with different LIB numbers, and these copies used to be seen as different blocks.
- `DBinBlockReader.Read` no longer copies the block payload out of the message it decodes: `Payload.Value` (and the legacy `PayloadBuffer`) now point into the buffer the message was read into. Reading merged blocks is 30-47% faster and allocates half as much.

### Fixed
Expand Down
3 changes: 2 additions & 1 deletion oneblockfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ func ParseFilename(filename string) (blockNum uint64, blockIDSuffix string, prev
err = fmt.Errorf("failed parsing lib num %q: %s", parts[4], parseErr)
return
}
canonicalName = strings.Join(parts[0:4], "-")
// readers can disagree on the LIB of a same block, so it is not part of its identity
canonicalName = strings.Join(parts[0:3], "-")

return
}
Expand Down
5 changes: 2 additions & 3 deletions oneblockfile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ package bstream

import (
"fmt"
"strings"
"testing"

pbbstream "github.com/streamingfast/bstream/pb/sf/bstream/v1"
Expand All @@ -35,7 +34,7 @@ func TestOneBlockFile_MustNewOneBlockFile(t *testing.T) {
name := "0000000100-0000000000000100a-0000000000000099a-90-suffix"
obf := MustNewOneBlockFile(name)
require.IsType(t, OneBlockFile{}, *obf)
require.Equal(t, obf.CanonicalName, strings.Split(name, "-suffix")[0])
require.Equal(t, "0000000100-0000000000000100a-0000000000000099a", obf.CanonicalName)
}

func TestOneBlockFile_ParseFilename(t *testing.T) {
Expand Down Expand Up @@ -66,7 +65,7 @@ func TestOneBlockFile_ParseFilename(t *testing.T) {
expectLibNum: 90,
expectBlockIDSuffix: "aaaabbbb24a07267",
expectPreviousBlockIDSuffix: "ccccdddde5914b39",
expectCanonicalName: "0000000100-aaaabbbb24a07267-ccccdddde5914b39-90",
expectCanonicalName: "0000000100-aaaabbbb24a07267-ccccdddde5914b39",
},
}

Expand Down
Loading