Skip to content

Commit a27b6b7

Browse files
committed
add 'substreams-tier1-quicksave-store' and bump substreams for quicksave support, switch to wasmtime
1 parent e8b3166 commit a27b6b7

File tree

5 files changed

+27
-15
lines changed

5 files changed

+27
-15
lines changed

CHANGELOG.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ If you were at `firehose-core` version `1.0.0` and are bumping to `1.1.0`, you s
1616

1717
### Substreams
1818

19+
#### Reconnection time
20+
21+
* Added flag `substreams-tier1-quicksave-store` to enable quicksave of stores on tier1, allowing for a fast reconnection of clients using stores.
22+
1923
#### Capacity Management
2024

2125
* Integrated the `GlobalRequestPool` service in the `Tier1App` to manage global requests pooling.
@@ -34,10 +38,17 @@ If you were at `firehose-core` version `1.0.0` and are bumping to `1.1.0`, you s
3438

3539
#### Performance
3640

37-
* Fixed a regression since "v1.7.3" where the SkipEmptyOutput instruction was ignored in substreams mappers
3841
* Add shared cache for tier1 execution near HEAD, to prevent multiple tier1 instances from reprocessing the same module on the same block when it comes in (ex: foundational modules)
3942
* Improved fetching of state caches on tier1 requests to speed up "time to first data"
4043

44+
* Rust modules will now be executed with `wasmtime` by default instead of `wazero`.
45+
- Prevents the whole server from stalling in certain memory-intensive operations in wazero.
46+
- Speed improvement: cuts the execution time in half in some circumstances.
47+
- Wazero is still used for modules with `wbindgen` and modules compiled with `tinygo`.
48+
- Set env var `SUBSTREAMS_WASM_RUNTIME=wazero` to revert to previous behavior.
49+
50+
* Fixed a regression since "v1.7.3" where the SkipEmptyOutput instruction was ignored in substreams mappers
51+
4152
### Tools
4253

4354
* make 'compare-blocks' command support one-blocks stores as well as merged-blocks

Dockerfile

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.23.4-alpine as build
1+
FROM golang:1.24.0-bookworm as build
22
WORKDIR /app
33

44
COPY go.mod go.sum ./
@@ -7,17 +7,14 @@ RUN go mod download
77
COPY . ./
88

99
ARG VERSION="dev"
10-
RUN apk --no-cache add git
10+
RUN apt-get update && apt-get install git
1111
RUN go build -v -ldflags "-X main.version=${VERSION}" ./cmd/firecore
1212

1313
####
1414

15-
FROM alpine:3
15+
FROM ubuntu:24.04
1616

17-
18-
RUN apk --no-cache add \
19-
ca-certificates htop iotop sysstat \
20-
strace lsof curl jq tzdata
17+
RUN apt-get update && apt-get -y install ca-certificates htop iotop sysstat strace lsof curl jq tzdata
2118

2219
RUN mkdir -p /app/ && curl -Lo /app/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/v0.4.12/grpc_health_probe-linux-amd64 && chmod +x /app/grpc_health_probe
2320

cmd/apps/substreams_tier1.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ func RegisterSubstreamsTier1App[B firecore.Block](chain *firecore.Chain[B], root
7373
This is useful to prevent the tier1 from being overwhelmed by too many requests, most client auto-reconnects on 'Unavailable' code
7474
so they should end up on another tier1 instance, assuming you have proper auto-scaling of the number of instances available.
7575
`))
76+
cmd.Flags().String("substreams-tier1-quicksave-store", "", "If enabled, substreams will use this store to put 'quicksave' data when shutting down while running requests with 'stores'. Use this flag with a non-zero --common-system-shutdown-signal-delay")
7677
cmd.Flags().String("substreams-tier1-global-worker-pool-address", "", "Address of the global worker pool to use for the substreams tier1. (disabled if empty)")
7778
cmd.Flags().String("substreams-tier1-global-request-pool-address", "", "Address of the global worker pool to use for the substreams tier1. (disabled if empty)")
7879
cmd.Flags().Duration("substreams-tier1-global-worker-pool-keep-alive-delay", 25*time.Second, "Delay between two keep alive call to the global worker pool. Default is 25s")
@@ -163,6 +164,7 @@ func RegisterSubstreamsTier1App[B firecore.Block](chain *firecore.Chain[B], root
163164
config.GRPCListenAddr = viper.GetString("substreams-tier1-grpc-listen-addr")
164165
config.GRPCShutdownGracePeriod = time.Second
165166
config.ServiceDiscoveryURL = serviceDiscoveryURL
167+
config.QuickSaveStoreURL = viper.GetString("substreams-tier1-quicksave-store")
166168

167169
subRequestsClientConfig := client.NewSubstreamsClientConfig(
168170
config.SubrequestsEndpoint,

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ require (
1717
github.com/spf13/cobra v1.7.0
1818
github.com/spf13/pflag v1.0.5
1919
github.com/spf13/viper v1.15.0
20-
github.com/streamingfast/bstream v0.0.2-0.20250129191551-5539724f4b12
20+
github.com/streamingfast/bstream v0.0.2-0.20250221181559-fb0809660f91
2121
github.com/streamingfast/cli v0.0.4-0.20250116003948-fbf66c930cce
2222
github.com/streamingfast/dauth v0.0.0-20250130223258-c615a033a660
2323
github.com/streamingfast/dbin v0.9.1-0.20231117225723-59790c798e2c
@@ -31,7 +31,7 @@ require (
3131
github.com/streamingfast/payment-gateway v0.0.0-20240426151444-581e930c76e2
3232
github.com/streamingfast/pbgo v0.0.6-0.20250114182320-0b43084f4000
3333
github.com/streamingfast/snapshotter v0.0.0-20230316190750-5bcadfde44d0
34-
github.com/streamingfast/substreams v1.12.5-0.20250220140015-91e8dc3e5576
34+
github.com/streamingfast/substreams v1.13.1-0.20250226131308-66bde512c25e
3535
github.com/streamingfast/worker-pool-protocol v0.0.0-20250218145136-4ad271e36e39
3636
github.com/stretchr/testify v1.10.0
3737
github.com/test-go/testify v1.1.4
@@ -54,6 +54,7 @@ require (
5454
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
5555
github.com/bobg/go-generics/v3 v3.5.0 // indirect
5656
github.com/bufbuild/protocompile v0.4.0 // indirect
57+
github.com/bytecodealliance/wasmtime-go/v30 v30.0.0 // indirect
5758
github.com/charmbracelet/lipgloss v1.0.0 // indirect
5859
github.com/charmbracelet/x/ansi v0.4.2 // indirect
5960
github.com/felixge/httpsnoop v1.0.4 // indirect
@@ -217,7 +218,6 @@ require (
217218
replace (
218219
cloud.google.com/go => github.com/streamingfast/google-cloud-go v0.0.0-20241202194114-f77ff78d4f66
219220
github.com/ShinyTrinkets/overseer => github.com/streamingfast/overseer v0.2.1-0.20210326144022-ee491780e3ef
220-
github.com/bytecodealliance/wasmtime-go/v4 => github.com/streamingfast/wasmtime-go/v4 v4.0.0-freemem3
221221
github.com/jhump/protoreflect => github.com/streamingfast/protoreflect v0.0.0-20231205191344-4b629d20ce8d
222222
github.com/tetratelabs/wazero => github.com/streamingfast/wazero v0.0.0-20241202185309-91287c3640ed
223223

go.sum

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1639,6 +1639,8 @@ github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl
16391639
github.com/boombuler/barcode v1.0.1/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
16401640
github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA=
16411641
github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8=
1642+
github.com/bytecodealliance/wasmtime-go/v30 v30.0.0 h1:e/niRqzC1keW4Z3yLK3k3gyEKdVyzFWhYAMhTFgEx+4=
1643+
github.com/bytecodealliance/wasmtime-go/v30 v30.0.0/go.mod h1:eLGFEIgQI47f/3/RK1MNY5knv85j6lsCoVG3/edFD0M=
16421644
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
16431645
github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
16441646
github.com/census-instrumentation/opencensus-proto v0.4.1 h1:iKLQ0xPNFxR/2hzXZMrBo8f1j86j5WHzznCCQxV/b8g=
@@ -2152,8 +2154,8 @@ github.com/spf13/viper v1.15.0 h1:js3yy885G8xwJa6iOISGFwd+qlUo5AvyXb7CiihdtiU=
21522154
github.com/spf13/viper v1.15.0/go.mod h1:fFcTBJxvhhzSJiZy8n+PeW6t8l+KeT/uTARa0jHOQLA=
21532155
github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8=
21542156
github.com/stoewer/go-strcase v1.3.0/go.mod h1:fAH5hQ5pehh+j3nZfvwdk2RgEgQjAoM8wodgtPmh1xo=
2155-
github.com/streamingfast/bstream v0.0.2-0.20250129191551-5539724f4b12 h1:Kh4ZxZwv/bccTLFNugEbj9wfxuukbLkE6Mmkqc3OACw=
2156-
github.com/streamingfast/bstream v0.0.2-0.20250129191551-5539724f4b12/go.mod h1:n5wy+Vmwp4xbjXO7B81MAkAgjnf1vJ/lI2y6hWWyFbg=
2157+
github.com/streamingfast/bstream v0.0.2-0.20250221181559-fb0809660f91 h1:n4Ws5vS8dF4J6WYP7mE0C9DsE1Inju7BKd6XWI4T18c=
2158+
github.com/streamingfast/bstream v0.0.2-0.20250221181559-fb0809660f91/go.mod h1:n5wy+Vmwp4xbjXO7B81MAkAgjnf1vJ/lI2y6hWWyFbg=
21572159
github.com/streamingfast/cli v0.0.4-0.20250116003948-fbf66c930cce h1:RWla1PaRrlDf/MOwVoN/dJhIM/dXa9O4rmKZkv9T5bg=
21582160
github.com/streamingfast/cli v0.0.4-0.20250116003948-fbf66c930cce/go.mod h1:qOksW3DPhHVYBo8dcYxS7K3Q09wlcOChSdopeOjLWng=
21592161
github.com/streamingfast/dauth v0.0.0-20250130223258-c615a033a660 h1:QwuploKvaXyvwpxhFWKmPFrvesJRJb7gK+gsgEbAY5c=
@@ -2197,8 +2199,8 @@ github.com/streamingfast/shutter v1.5.0 h1:NpzDYzj0HVpSiDJVO/FFSL6QIK/YKOxY0gJAt
21972199
github.com/streamingfast/shutter v1.5.0/go.mod h1:B/T6efqdeMGbGwjzPS1ToXzYZI4kDzI5/u4I+7qbjY8=
21982200
github.com/streamingfast/snapshotter v0.0.0-20230316190750-5bcadfde44d0 h1:Y15G1Z4fpEdm2b+/70owI7TLuXadlqBtGM7rk4Hxrzk=
21992201
github.com/streamingfast/snapshotter v0.0.0-20230316190750-5bcadfde44d0/go.mod h1:/Rnz2TJvaShjUct0scZ9kKV2Jr9/+KBAoWy4UMYxgv4=
2200-
github.com/streamingfast/substreams v1.12.5-0.20250220140015-91e8dc3e5576 h1:7g3xTNv5C3w5+3l8/IvM5RbF+fwZRsaIE66f7+uZm1s=
2201-
github.com/streamingfast/substreams v1.12.5-0.20250220140015-91e8dc3e5576/go.mod h1:2/yOQAnNP4EQ66buwMF4eOVUgPN6RWrh8VxHT5LL5vc=
2202+
github.com/streamingfast/substreams v1.13.1-0.20250226131308-66bde512c25e h1:lFzj1E8g5gPYnUeMSp5qG+uCJyuQRRUtTTZumzIqXWc=
2203+
github.com/streamingfast/substreams v1.13.1-0.20250226131308-66bde512c25e/go.mod h1:ObwCa5VmHsSiGLmjdzDNIwvDLDslrqrheC08FOl61+g=
22022204
github.com/streamingfast/wazero v0.0.0-20241202185309-91287c3640ed h1:LU6/c376zP1cMAo9L6rFLyjo0W7RU+hIh7BegH8Zo5M=
22032205
github.com/streamingfast/wazero v0.0.0-20241202185309-91287c3640ed/go.mod h1:yAI0XTsMBhREkM/YDAK/zNou3GoiAce1P6+rp/wQhjs=
22042206
github.com/streamingfast/worker-pool-protocol v0.0.0-20250218145136-4ad271e36e39 h1:NBBLx99rrGz/hxwHjHi+QyN07DfqcDC4zzuBEsH0/vE=

0 commit comments

Comments
 (0)