Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upstream v2.58.2 #163

Merged
merged 107 commits into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
4ea4f74
fix(cmd/downloader): trackers/embed.go have been deleted (#9256)
ddl-hust Jan 18, 2024
e2235b7
params: begin 2.58 release cycle (#9264)
yperbasis Jan 18, 2024
56fc80a
Remove downloaderTip (#9263)
yperbasis Jan 18, 2024
934dbfd
Added Holesky network to Caplin (#9272)
Giulio2002 Jan 19, 2024
48a60b6
events endpoint (#9258)
elee1766 Jan 20, 2024
a284e04
Add more err messages for hive (#9270)
somnathb1 Jan 22, 2024
30d8195
fix potential nil ptr in bor sn retirement (#9268)
AskAlexSharov Jan 22, 2024
c020723
Caplin: Fixed EL<->CL communication for Deneb (#9257)
Giulio2002 Jan 22, 2024
739e99b
Fixed chain stall caplin (#9280)
Giulio2002 Jan 22, 2024
fa79cc1
Pass slice of versionedHashes by value (#9281)
yperbasis Jan 22, 2024
e787017
sais: remove unused gsa, fix readme (#9278)
battlmonstr Jan 22, 2024
4ac0e57
On success validationError should be null (#9283)
yperbasis Jan 22, 2024
cb6aa2f
turbo/jsonrpc: add support for bor state sync event tx tracing in deb…
taratorio Jan 22, 2024
e3784c1
turbo/jsonrpc: fix GetBlockTransactionCountByNumber & ByHash for bloc…
taratorio Jan 22, 2024
ed571b4
Unbound variable error in silkworm_compat_check (#9284)
jyellick Jan 23, 2024
1755404
use right function (#9285)
elee1766 Jan 23, 2024
9ea9482
Add tests (#9286)
elee1766 Jan 23, 2024
353fcbd
Caplin: Better Errors (#9282)
Giulio2002 Jan 23, 2024
f8ca251
p2p/sentry/simulator: skip TestSimulatorStart - manual runs only for …
taratorio Jan 23, 2024
57280b9
devnet: skip TestStateSync until fixed (#9290) (#9291)
battlmonstr Jan 23, 2024
cc01ac3
devnet: skip tests until stabilised (#9298)
taratorio Jan 24, 2024
56db532
downloader: prohibit_new_downloads.lock check missed download .torren…
AskAlexSharov Jan 24, 2024
c96ff1e
e2 mumbai 45m (#9277)
AskAlexSharov Jan 24, 2024
3c87567
txpool: fix initial blockGasLimit and setBlobFee() (#9301)
yperbasis Jan 24, 2024
e2b524b
polygon/sync: fix implementations naming conventions (#9302)
battlmonstr Jan 24, 2024
9c8a2a5
dvovk/nsync (#9306)
dvovk Jan 25, 2024
fce6ece
silkworm: recreate tx batch and disable read-ahead in block execution…
canepat Jan 25, 2024
0d9b2f3
Fix mapmutation size update (#9309)
canepat Jan 25, 2024
ef50335
Handle nil in GetBodiesByRange (#9308)
somnathb1 Jan 25, 2024
c3e5c96
patch race (#9317)
elee1766 Jan 26, 2024
aefb97b
Mapmutation.Flush to use less ram and close collectors earlier (#9320)
AskAlexSharov Jan 26, 2024
39f9acb
Reverted blob handling (#9322)
Giulio2002 Jan 26, 2024
e38c424
Append nil to return array in GetBodiesByHashes when body isn't found…
racytech Jan 27, 2024
6760e0e
Dvovk/nsync (#9324)
dvovk Jan 27, 2024
767d8a2
Fix validator_index field name on beacon API (#9329)
wmitsuda Jan 27, 2024
df4622f
Upgrade execution-spec-tests to v2.0.0 (#9323)
yperbasis Jan 27, 2024
3591046
updateForkChoice: support --sync.loop.block.limit (#9315)
AskAlexSharov Jan 28, 2024
a1022f1
dvovk/wseedrates (#9328)
dvovk Jan 28, 2024
aab2eca
added snapshot files names list collection for diagnostics (#9332)
dvovk Jan 29, 2024
0494d26
use go 1.21 for release binaries build (#9331)
AskAlexSharov Jan 29, 2024
867957d
RpcDaemon doesn't see recently retired blocks (#9318)
AskAlexSharov Jan 29, 2024
4f76c6d
turbo/jsonrpc: add support for bor state sync txn in Trace API endpoi…
taratorio Jan 29, 2024
db3149a
eth, polygon/bor: fix fetch span logic for devnets (#9312)
manav2401 Jan 29, 2024
79b009d
integration/commands: add unwind feature for bor heimdall cmd (#9337)
taratorio Jan 29, 2024
56ee94d
core: log marshalled receipts upon receipt hash mismatch err in dbg m…
taratorio Jan 29, 2024
2b77bf5
add napoli block (#9345)
temaniarpit27 Jan 30, 2024
93e22f5
tests: clean exit small improvements (#9279)
mriccobene Jan 30, 2024
8fbb0ea
integration/commands: minor - use errorf without printf in stageBorHe…
taratorio Jan 30, 2024
361cfdd
Bor waypoints (#9342)
mh0lt Jan 30, 2024
0d50327
bor snaps: gen bor snaps, if they are behind block snaps (#9344)
AskAlexSharov Jan 30, 2024
38de61f
Fixed error that makes CL not download (#9348)
Giulio2002 Jan 30, 2024
96b508c
fix: typos (#9334)
vuittont60 Jan 31, 2024
57c1a81
Updated sepolia fork digest in tests (#9352)
Giulio2002 Jan 31, 2024
8669a82
Block building: Fix duplicate request check (#9353)
yperbasis Jan 31, 2024
8e1203f
Remove private S3 buckets webseed feature (and was sdk dependency) …
AskAlexSharov Feb 1, 2024
ffc12d8
turbo/jsonrpc: fix accidental regression in ReplayBlockTransactions (…
taratorio Feb 1, 2024
ba34ca4
eth/stagedsync: add tests for bor heimdall mining stage (#9361)
taratorio Feb 1, 2024
ea37d0a
turbo/snapshotsync/freezeblocks: move pending funcs to full block rea…
taratorio Feb 1, 2024
7318c0a
Added Full Lightclient Server support (#9354)
Giulio2002 Feb 1, 2024
55d653c
eth/stagedsync: fix span fetch logic for span 0 and 1 (#9367)
taratorio Feb 2, 2024
f7586cd
eth/stagedsync: minor code style cleanup of stage_bor_heimdall.go (#9…
taratorio Feb 2, 2024
413a931
Bor related snapshot changes (#9311)
mh0lt Feb 3, 2024
7ef0ee7
Added Eth/V1/Node endpoints to Caplin (#9366)
Giulio2002 Feb 3, 2024
3190d31
Fixed concurrent map write on Caplin (#9365)
Giulio2002 Feb 3, 2024
4f5d0d9
Fixed small hiccup in BeaconBlocks snapshots (#9372)
Giulio2002 Feb 5, 2024
c0a83da
ethstats: Fix Issue with Unreported Pending Transaction Information (…
lyfsn Feb 5, 2024
e190189
fix `find` warning (#9377)
AskAlexSharov Feb 5, 2024
791097e
snapshots cfg: check arr len when parsing file name (#9375)
AskAlexSharov Feb 5, 2024
a973536
Added Archive node sanitizer checker (#9374)
Giulio2002 Feb 5, 2024
2276c55
Fix for the outsync in fork choice (#9373)
Giulio2002 Feb 5, 2024
303ed00
Caplin: Fixed MetadataV2 format (#9370)
Giulio2002 Feb 5, 2024
5ea8d91
silkworm: libmdbx version check (#9169)
battlmonstr Feb 5, 2024
031c2ab
Return error when no blob hashes in txn (#9382)
somnathb1 Feb 5, 2024
507c947
Bor fix bodies prev progress (#9369)
mh0lt Feb 5, 2024
255d22b
clean-exit test: avoid disk space exhaustion (#9381)
mriccobene Feb 5, 2024
63a1422
Replaced CatchUpEpochs with ForwardDownloader (#9383)
Giulio2002 Feb 5, 2024
66b0aa7
Added Unit testing (Sentinel/Beacon API) (#9387)
Giulio2002 Feb 6, 2024
114baa0
polygon/sync: cleanup waypoint naming (#9395)
taratorio Feb 7, 2024
a19ae55
Schedule Dencun on mainnet (#9409)
yperbasis Feb 8, 2024
cb7bb42
silkworm: dev env using local silkworm-go (#9412)
canepat Feb 9, 2024
9820577
Add totalBlobPoolLimit flag (#9406)
somnathb1 Feb 9, 2024
0d35c1c
bor-mainnet: remove lost files after 50.5M (#9411)
AskAlexSharov Feb 9, 2024
f7bb443
fix nil-ptr in txpool fee calc (#9410)
AskAlexSharov Feb 9, 2024
3507174
[Caplin Archive node]: full sepolia read experiment bug fixes (#9393)
Giulio2002 Feb 9, 2024
b79f28d
Hive: Do not validate payload attributes if nil or syncing and pre-ca…
racytech Feb 10, 2024
f2a2ede
Fixed Caplin archive past deneb (#9416)
Giulio2002 Feb 10, 2024
9468e31
fix: update broken link to gnosis (#9415)
krauspt Feb 11, 2024
2cfa099
integration: bor stage forward (#9417)
AskAlexSharov Feb 11, 2024
ce78ba6
Add lock for downloader version map (#9419)
mh0lt Feb 11, 2024
24d4f1c
Don't touch file for !cfg.SnapshotLock (#9420)
mh0lt Feb 11, 2024
321b8d9
Don't default to mainnet if NetworkID != 1 (#9408)
yperbasis Feb 12, 2024
8d9967b
[release] Add default config for txpool explicitly (#9429) (#9434)
yperbasis Feb 13, 2024
ef9e04f
[release] Schedule Dencun for Gnosis (#9437)
yperbasis Feb 13, 2024
9731f71
[release] fix to get .torrent from snaps (#9452)
yperbasis Feb 15, 2024
ab1ee7b
[release] mainnet: remove beacon after 8M (#9480)
yperbasis Feb 22, 2024
f12e451
snapshots: fix filesByRange (#9472) (#9489)
battlmonstr Feb 22, 2024
125509e
Finalize cancun/napoli HF block number for polygon mainnet (#9674)
yperbasis Mar 11, 2024
07edcad
Merge tag 'v2.58.2' into upstream-v2.58.2
ImTei Apr 22, 2024
e197332
Update erigon-interfaces version
ImTei Apr 22, 2024
e4256b7
Run erigon-lib make gen
ImTei Apr 22, 2024
7ff6fd5
Fix build errors
ImTei Apr 22, 2024
fc16e97
Add optimism support to new MarshalReceipt method
ImTei Apr 22, 2024
69e658b
Revert go version
ImTei Apr 22, 2024
d75c6d3
Ignore gocritic lint errors
ImTei Apr 22, 2024
749fc15
Update mainnet fork digest
ImTei Apr 22, 2024
c03be74
Use go 1.21 in CI
ImTei Apr 22, 2024
44a82c9
Update test fork digest
ImTei Apr 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: '1.21'
- name: Install dependencies on Linux
if: runner.os == 'Linux'
run: sudo apt update && sudo apt install build-essential
Expand Down Expand Up @@ -91,7 +91,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: '1.21'

- uses: actions/cache@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: '1.21'

- name: install dependencies on Linux
if: runner.os == 'Linux'
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/qa-clean-exit-block-downloading.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ jobs:

- name: Restore Erigon Testbed Data Directory
run: |
rsync -av --delete $ERIGON_REFERENCE_DATA_DIR/ $ERIGON_TESTBED_DATA_DIR/
rm -rf $ERIGON_TESTBED_DATA_DIR/chaindata
rsync -a --delete $ERIGON_REFERENCE_DATA_DIR/ $ERIGON_TESTBED_DATA_DIR/

- name: Clean Erigon Build Directory
run: |
Expand All @@ -51,10 +52,6 @@ jobs:
make erigon
working-directory: ${{ github.workspace }}

#- name: Download Python Script for Logs Checking
# run: |
# curl -o check_erigon_exit.py 'https://gist.githubusercontent.com/mriccobene/8db4030a745de34d527f136f2caa104f/raw/3c1a860cb87d61075e78ce399e17f0ab157cacc6/check_erigon_exit.py'

- name: Run Erigon, send ctrl-c and check for clean exiting
run: |
# Run Erigon, send ctrl-c and check logs
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/qa-clean-exit-snapshot-downloading.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@ jobs:
make erigon
working-directory: ${{ github.workspace }}

#- name: Download Python Script for Logs Checking
# run: |
# curl -o check_erigon_exit.py 'https://gist.githubusercontent.com/mriccobene/8db4030a745de34d527f136f2caa104f/raw/3c1a860cb87d61075e78ce399e17f0ab157cacc6/check_erigon_exit.py'

- name: Run Erigon, send ctrl-c and check for clean exiting
run: |
# Run Erigon, send ctrl-c and check logs
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-integration-caplin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: '1.21'
- name: Install dependencies on Linux
if: runner.os == 'Linux'
run: sudo apt update && sudo apt install build-essential
Expand All @@ -46,7 +46,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: '1.21'

- uses: actions/cache@v3
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- run: git submodule update --init --recursive --force
- uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: '1.21'
- name: Install dependencies on Linux
if: runner.os == 'Linux'
run: sudo apt update && sudo apt install build-essential
Expand All @@ -52,7 +52,7 @@ jobs:
- run: git submodule update --init --recursive --force
- uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: '1.21'

- uses: actions/cache@v3
with:
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# syntax = docker/dockerfile:1.2
FROM docker.io/library/golang:1.20-alpine3.17 AS builder
FROM docker.io/library/golang:1.21-alpine3.17 AS builder

RUN apk --no-cache add build-base linux-headers git bash ca-certificates libstdc++

Expand All @@ -18,7 +18,7 @@ RUN --mount=type=cache,target=/root/.cache \
make BUILD_TAGS=nosqlite,noboltdb,nosilkworm all


FROM docker.io/library/golang:1.20-alpine3.17 AS tools-builder
FROM docker.io/library/golang:1.21-alpine3.17 AS tools-builder
RUN apk --no-cache add build-base linux-headers git bash ca-certificates libstdc++
WORKDIR /app

Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.debian
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# syntax = docker/dockerfile:1.2
FROM docker.io/library/golang:1.20-bullseye AS builder
FROM docker.io/library/golang:1.21-bullseye AS builder

RUN apt update
RUN apt install -y build-essential git bash ca-certificates libstdc++6
Expand All @@ -17,7 +17,7 @@ RUN --mount=type=cache,target=/root/.cache \
make all


FROM docker.io/library/golang:1.20-alpine3.17 AS tools-builder
FROM docker.io/library/golang:1.21-alpine3.17 AS tools-builder

RUN apk --no-cache add build-base linux-headers git bash ca-certificates libstdc++
WORKDIR /app
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ install:
@ls -al "$(DIST)"

PACKAGE_NAME := github.com/testinprod-io/op-erigon
GOLANG_CROSS_VERSION ?= v1.20.7
GOLANG_CROSS_VERSION ?= v1.21.6

.PHONY: release-dry-run
release-dry-run: git-submodules
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ Use `--datadir` to choose where to store data.
Use `--chain=gnosis` for [Gnosis Chain](https://www.gnosis.io/), `--chain=bor-mainnet` for Polygon Mainnet,
`--chain=mumbai` for Polygon Mumbai and `--chain=amoy` for Polygon Amoy.
For Gnosis Chain you need a [Consensus Layer](#beacon-chain-consensus-layer) client alongside
Erigon (https://docs.gnosischain.com/node/guide/beacon).
Erigon (https://docs.gnosischain.com/node/manual/beacon).

Running `make help` will list and describe the convenience commands available in the [Makefile](./Makefile).

Expand Down
6 changes: 3 additions & 3 deletions cl/antiquary/antiquary.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ func (a *Antiquary) Loop() error {
if to-from < snaptype.Erigon2MergeLimit {
continue
}
if err := a.antiquate(a.sn.Version(), from, to); err != nil {
if err := a.antiquate(from, to); err != nil {
return err
}
case <-a.ctx.Done():
Expand All @@ -218,12 +218,12 @@ func (a *Antiquary) Loop() error {
}

// Antiquate will antiquate a specific block range (aka. retire snapshots), this should be ran in the background.
func (a *Antiquary) antiquate(version uint8, from, to uint64) error {
func (a *Antiquary) antiquate(from, to uint64) error {
if a.downloader == nil {
return nil // Just skip if we don't have a downloader
}
log.Info("[Antiquary]: Antiquating", "from", from, "to", to)
if err := freezeblocks.DumpBeaconBlocks(a.ctx, a.mainDB, a.beaconDB, version, from, to, snaptype.Erigon2MergeLimit, a.dirs.Tmp, a.dirs.Snap, 1, log.LvlDebug, a.logger); err != nil {
if err := freezeblocks.DumpBeaconBlocks(a.ctx, a.mainDB, a.beaconDB, from, to, a.dirs.Tmp, a.dirs.Snap, 1, log.LvlDebug, a.logger); err != nil {
return err
}

Expand Down
16 changes: 13 additions & 3 deletions cl/antiquary/state_antiquary.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ func (s *Antiquary) loopStates(ctx context.Context) {
return
}

_, beforeFinalized, err := s.readHistoricalProcessingProgress(ctx)
if err != nil {
s.logger.Error("Failed to read historical processing progress", "err", err)
return
}

for {
select {
// Check if we are behind finalized
Expand All @@ -78,15 +84,16 @@ func (s *Antiquary) loopStates(ctx context.Context) {
continue
}
// Check if we are behind finalized
progress, finalized, err := s.readHistoricalProcessingProgress(ctx)
_, finalized, err := s.readHistoricalProcessingProgress(ctx)
if err != nil {
s.logger.Error("Failed to read historical processing progress", "err", err)
continue
}
// Stay behind a little bit we rely on forkchoice up until (finalized - 2*slotsPerEpoch)
if progress+s.cfg.SlotsPerEpoch/2 >= finalized {
// We wait for updated finality.
if finalized == beforeFinalized {
continue
}
beforeFinalized = finalized
if err := s.IncrementBeaconState(ctx, finalized); err != nil {
slot := uint64(0)
if s.currentState != nil {
Expand Down Expand Up @@ -427,6 +434,9 @@ func (s *Antiquary) IncrementBeaconState(ctx context.Context, to uint64) error {
if err := transition.TransitionState(s.currentState, block, blockRewardsCollector, fullValidation); err != nil {
return err
}
// if s.currentState.Slot() == 4293952 {
// s.dumpFullBeaconState()
// }
blocksProcessed++

first = false
Expand Down
71 changes: 71 additions & 0 deletions cl/beacon/beaconevents/emitter.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
package beaconevents

import (
"sync"

"github.com/google/uuid"
"golang.org/x/sync/errgroup"
)

type Subscription struct {
id string
topics map[string]struct{}
cb func(topic string, item any)
}

type EventName string

// Emitters creates pub/sub connection
type Emitters struct {
cbs map[string]*Subscription
mu sync.RWMutex
}

func NewEmitters() *Emitters {
return &Emitters{
cbs: map[string]*Subscription{},
}
}

// publish to all subscribers. each callback is run in a separate goroutine
func (e *Emitters) Publish(s string, a any) {
// forward gossip object
e.mu.Lock()
values := make([]*Subscription, 0, len(e.cbs))
for _, v := range e.cbs {
values = append(values, v)
}
e.mu.Unlock()

egg := errgroup.Group{}
for idx := range values {
v := values[idx]
exec := func() error { v.cb(s, a); return nil }
if _, ok := v.topics["*"]; ok {
egg.Go(exec)
} else if _, ok := v.topics[s]; ok {
egg.Go(exec)
}
}
egg.Wait()
}

// subscribe with callback. call the returned cancelfunc to unregister the callback
// publish will block until all callbacks for the message are resolved
func (e *Emitters) Subscribe(topics []string, cb func(topic string, item any)) (func(), error) {
subid := uuid.New().String()
sub := &Subscription{
id: subid,
topics: map[string]struct{}{},
cb: cb,
}
for _, v := range topics {
sub.topics[v] = struct{}{}
}
e.cbs[subid] = sub
return func() {
e.mu.Lock()
defer e.mu.Unlock()
delete(e.cbs, subid)
}, nil
}
54 changes: 54 additions & 0 deletions cl/beacon/beaconevents/emitter_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package beaconevents_test

import (
"sync/atomic"
"testing"

"github.com/ledgerwatch/erigon/cl/beacon/beaconevents"
"github.com/stretchr/testify/require"
)

func TestEmitterSet(t *testing.T) {
e := beaconevents.NewEmitters()
var called int
e.Subscribe([]string{"set"}, func(topic string, item any) {
require.EqualValues(t, "set", topic)
require.EqualValues(t, "hello", item.(string))
called = called + 1
})
e.Publish("set", "hello")
require.EqualValues(t, 1, called)
}
func TestEmitterFilters(t *testing.T) {
e := beaconevents.NewEmitters()
var a atomic.Int64
var b atomic.Int64
var ab atomic.Int64
var wild atomic.Int64
e.Subscribe([]string{"a"}, func(topic string, item any) {
require.EqualValues(t, topic, item.(string))
a.Add(1)
})
e.Subscribe([]string{"b"}, func(topic string, item any) {
require.EqualValues(t, topic, item.(string))
b.Add(1)
})
e.Subscribe([]string{"a", "b"}, func(topic string, item any) {
require.EqualValues(t, topic, item.(string))
ab.Add(1)
})
e.Subscribe([]string{"*"}, func(topic string, item any) {
require.EqualValues(t, topic, item.(string))
wild.Add(1)
})

e.Publish("a", "a")
e.Publish("b", "b")
e.Publish("b", "b")
e.Publish("c", "c")

require.EqualValues(t, 1, a.Load())
require.EqualValues(t, 2, b.Load())
require.EqualValues(t, 3, ab.Load())
require.EqualValues(t, 4, wild.Load())
}
Loading
Loading