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

feat: PRT Block Hash Retry Archive After Redesign Part 2 - Add Archive logic to CRSM #1727

Open
wants to merge 24 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
fa37bf5
feat: PRT Block Hash Retry Archive
ranlavanet Oct 3, 2024
b220be9
fix deref
ranlavanet Oct 3, 2024
f62f488
feat: PRT-Block-Hash-Cache-after-redesign-part-2
ranlavanet Oct 3, 2024
a347619
fix lint
ranlavanet Oct 3, 2024
7ae96c3
Merge branch 'PRT-Block-Hash-Cache-after-redesign' into PRT-Block-Has…
ranlavanet Oct 3, 2024
b6803e9
WIP
ranlavanet Oct 3, 2024
63cd0b1
Part 2 complete?
ranlavanet Oct 3, 2024
f18b9fc
fix lint
ranlavanet Oct 3, 2024
1ff6245
apply archive only on 2nd relay.
ranlavanet Oct 6, 2024
f0864a5
using parse msg to create a new protocol message with archive.
ranlavanet Oct 7, 2024
78fd6dc
lint
ranlavanet Oct 7, 2024
2ec6855
removing sdk tests
ranlavanet Oct 7, 2024
7bbda53
fix test
ranlavanet Oct 8, 2024
6182a66
remove extensions from all flows and save RouterKey in singleConsumer…
omerlavanet Nov 3, 2024
25a873c
Merge remote-tracking branch 'origin/main' into PRT-Block-Hash-Cache-…
omerlavanet Nov 3, 2024
e325c5c
version merge
omerlavanet Nov 3, 2024
71e11b7
rename function for better description on functionality
omerlavanet Nov 3, 2024
2a2ff6f
Merge branch 'PRT-Block-Hash-Cache-after-redesign' into PRT-Block-Has…
omerlavanet Nov 3, 2024
518296e
Merge remote-tracking branch 'origin/main' into PRT-Block-Hash-Cache-…
omerlavanet Nov 3, 2024
a3cc9ab
bigger consistency timeout to succeed on actions
omerlavanet Nov 3, 2024
8beacb9
adding initialized flag
ranlavanet Nov 6, 2024
c33e5e0
append existing extensions to archive
ranlavanet Nov 6, 2024
aaf3cc0
WIP
ranlavanet Nov 7, 2024
618fa81
finished state machine
ranlavanet Nov 7, 2024
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
41 changes: 41 additions & 0 deletions .github/workflows/lava.yml
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,47 @@ jobs:
# name: SDK E2E Logs
# path: "testutil/e2e/sdkLogs/*"

# This part came from lava_sdk_tests.yml that was removed. just not to lose functionality it moved here.
# name: Lava SDK Tests

# on:
# pull_request

# jobs:
# main:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v4

# - name: Cache dependencies
# uses: actions/cache@v4
# with:
# path: ~/.yarn
# key: yarn-${{ hashFiles('yarn.lock') }}
# restore-keys: yarn-

# - uses: actions/setup-go@v5
# with:
# go-version: "1.20.5"

# - uses: actions/setup-node@v4
# with:
# node-version: "21.2.0"

# - name: Init the SDK
# run: GOPATH=~/go ./scripts/init_sdk.sh -s
# working-directory: ./ecosystem/lava-sdk

# - name: ESLint
# run: ./node_modules/.bin/eslint '**/*.ts'
# working-directory: ./ecosystem/lava-sdk

# - name: Test
# run: ./node_modules/.bin/jest ./src --ci
# working-directory: ./ecosystem/lava-sdk


test-payment-e2e:
runs-on: ubuntu-latest
steps:
Expand Down
38 changes: 0 additions & 38 deletions .github/workflows/lava_sdk_tests.yml

This file was deleted.

1 change: 0 additions & 1 deletion protocol/chainlib/chainlib.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ type RelaySender interface {
connectionType string,
dappID string,
consumerIp string,
analytics *metrics.RelayMetrics,
metadata []pairingtypes.Metadata,
) (ProtocolMessage, error)
SendParsedRelay(
Expand Down
8 changes: 4 additions & 4 deletions protocol/chainlib/chainlib_mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion protocol/chainlib/consumer_websocket_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ func (cwm *ConsumerWebsocketManager) ListenToMessages() {

metricsData := metrics.NewRelayAnalytics(dappID, cwm.chainId, cwm.apiInterface)

protocolMessage, err := cwm.relaySender.ParseRelay(webSocketCtx, "", string(msg), cwm.connectionType, dappID, userIp, metricsData, nil)
protocolMessage, err := cwm.relaySender.ParseRelay(webSocketCtx, "", string(msg), cwm.connectionType, dappID, userIp, nil)
if err != nil {
utils.LavaFormatDebug("ws manager could not parse message", utils.LogAttr("message", msg), utils.LogAttr("err", err))
formatterMsg := logger.AnalyzeWebSocketErrorAndGetFormattedMessage(websocketConn.LocalAddr().String(), err, msgSeed, msg, cwm.apiInterface, time.Since(startTime))
Expand Down
2 changes: 1 addition & 1 deletion protocol/chainlib/consumer_ws_subscription_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ func (cwsm *ConsumerWSSubscriptionManager) craftUnsubscribeMessage(hashedParams,

// Craft the unsubscribe chain message
ctx := context.Background()
protocolMessage, err := cwsm.relaySender.ParseRelay(ctx, "", unsubscribeRequestData, cwsm.connectionType, dappID, consumerIp, metricsData, nil)
protocolMessage, err := cwsm.relaySender.ParseRelay(ctx, "", unsubscribeRequestData, cwsm.connectionType, dappID, consumerIp, nil)
if err != nil {
return nil, utils.LavaFormatError("could not craft unsubscribe chain message", err,
utils.LogAttr("hashedParams", utils.ToHexString(hashedParams)),
Expand Down
12 changes: 6 additions & 6 deletions protocol/chainlib/consumer_ws_subscription_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func TestConsumerWSSubscriptionManagerParallelSubscriptionsOnSameDappIdIp(t *tes

relaySender.
EXPECT().
ParseRelay(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).
ParseRelay(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).
Return(protocolMessage1, nil).
AnyTimes()

Expand Down Expand Up @@ -244,7 +244,7 @@ func TestConsumerWSSubscriptionManagerParallelSubscriptions(t *testing.T) {

relaySender.
EXPECT().
ParseRelay(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).
ParseRelay(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).
Return(protocolMessage1, nil).
AnyTimes()

Expand Down Expand Up @@ -484,7 +484,7 @@ func TestConsumerWSSubscriptionManager(t *testing.T) {
require.True(t, ok)
areEqual := reqData == string(play.unsubscribeMessage1)
return areEqual
}), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).
}), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).
Return(unsubscribeProtocolMessage1, nil).
AnyTimes()

Expand All @@ -495,7 +495,7 @@ func TestConsumerWSSubscriptionManager(t *testing.T) {
require.True(t, ok)
areEqual := reqData == string(play.subscriptionRequestData1)
return areEqual
}), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).
}), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).
Return(subscribeProtocolMessage1, nil).
AnyTimes()

Expand Down Expand Up @@ -600,7 +600,7 @@ func TestConsumerWSSubscriptionManager(t *testing.T) {
require.True(t, ok)
areEqual := reqData == string(play.unsubscribeMessage2)
return areEqual
}), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).
}), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).
Return(unsubscribeProtocolMessage2, nil).
AnyTimes()

Expand All @@ -611,7 +611,7 @@ func TestConsumerWSSubscriptionManager(t *testing.T) {
require.True(t, ok)
areEqual := reqData == string(play.subscriptionRequestData2)
return areEqual
}), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).
}), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).
Return(subscribeProtocolMessage2, nil).
AnyTimes()

Expand Down
4 changes: 3 additions & 1 deletion protocol/chainlib/extensionslib/extension_parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import (
spectypes "github.com/lavanet/lava/v4/x/spec/types"
)

const ArchiveExtension = "archive"

type ExtensionInfo struct {
ExtensionOverride []string
LatestBlock uint64
Expand Down Expand Up @@ -84,7 +86,7 @@ func (ep *ExtensionParser) ExtensionParsing(addon string, extensionsChainMessage

func NewExtensionParserRule(extension *spectypes.Extension) ExtensionParserRule {
switch extension.Name {
case "archive":
case ArchiveExtension:
return ArchiveParserRule{extension: extension}
default:
// unsupported rule
Expand Down
Loading
Loading