Skip to content

Commit 10cedc9

Browse files
authored
Re-enable e2e log trigger test using beholder logs (#20307)
* hopeful attempt using beholder logs * stop this for now * stop this as well * just pause everything for now * silence regression * Revert and remove flake, pending removal of read cap for logtrigger test * stop sending tx on log trigger * tidy * final stuff * final stuff
1 parent a9834d0 commit 10cedc9

File tree

5 files changed

+12
-35
lines changed

5 files changed

+12
-35
lines changed

system-tests/tests/go.mod

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ require (
7272
github.com/smartcontractkit/chainlink/system-tests/tests/smoke/cre/evm/logtrigger v0.0.0-00010101000000-000000000000
7373
github.com/smartcontractkit/chainlink/system-tests/tests/smoke/cre/evmread v0.0.0-20250917232237-c4ecf802c6f8
7474
github.com/smartcontractkit/libocr v0.0.0-20251031190958-7324c200a6b0
75-
github.com/smartcontractkit/quarantine v0.0.0-20250909213106-ece491bef618
7675
github.com/stretchr/testify v1.11.1
7776
golang.org/x/sync v0.17.0
7877
google.golang.org/protobuf v1.36.10

system-tests/tests/smoke/cre/cre_suite_test.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ import (
66

77
"github.com/stretchr/testify/require"
88

9-
"github.com/smartcontractkit/quarantine"
10-
119
"github.com/smartcontractkit/chainlink/system-tests/lib/cre/environment/blockchains"
1210
t_helpers "github.com/smartcontractkit/chainlink/system-tests/tests/test-helpers"
1311
)
@@ -162,7 +160,6 @@ func Test_CRE_V2_EVM_Suite(t *testing.T) {
162160
})
163161

164162
t.Run("[v2] EVM LogTrigger - "+topology, func(t *testing.T) {
165-
quarantine.Flaky(t, "PLEX-1894")
166163
ExecuteEVMLogTriggerTest(t, testEnv)
167164
})
168165
}

system-tests/tests/smoke/cre/evm/logtrigger/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ go 1.24.5
44

55
require (
66
github.com/ethereum/go-ethereum v1.16.3
7-
github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20250911124514-5874cc6d62b2
87
github.com/smartcontractkit/cre-sdk-go v0.8.0
98
github.com/smartcontractkit/cre-sdk-go/capabilities/blockchain/evm v0.8.0
109
github.com/stretchr/testify v1.11.1
@@ -18,6 +17,7 @@ require (
1817
github.com/holiman/uint256 v1.3.2 // indirect
1918
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
2019
github.com/shopspring/decimal v1.4.0 // indirect
20+
github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20250911124514-5874cc6d62b2 // indirect
2121
golang.org/x/crypto v0.36.0 // indirect
2222
golang.org/x/sys v0.34.0 // indirect
2323
google.golang.org/protobuf v1.36.8 // indirect

system-tests/tests/smoke/cre/evm/logtrigger/main.go

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import (
99
"strings"
1010

1111
"github.com/ethereum/go-ethereum/accounts/abi"
12-
"github.com/ethereum/go-ethereum/common"
13-
sdkpb "github.com/smartcontractkit/chainlink-protos/cre/go/sdk"
1412
"github.com/smartcontractkit/cre-sdk-go/capabilities/blockchain/evm"
1513
"github.com/smartcontractkit/cre-sdk-go/cre"
1614
"github.com/smartcontractkit/cre-sdk-go/cre/wasm"
@@ -104,32 +102,9 @@ func onTrigger(cfg logtrigger.Config, runtime sdk.Runtime, outputs *evm.Log) (st
104102
return "", fmt.Errorf("OnTrigger error decoding log data: %w", err)
105103
}
106104
runtime.Logger().Info(fmt.Sprintf("OnTrigger decoded message: %s", decodedMessageString))
107-
client := evm.Client{ChainSelector: cfg.ChainSelector}
108-
txHash := sendTx(t, runtime, cfg, client, decodedMessageString)
109-
runtime.Logger().Info("Successfully sent transaction", "hash", common.Hash(txHash).String())
110105
return "success", nil
111106
}
112107

113-
func sendTx(t *T, runtime sdk.Runtime, cfg logtrigger.Config, client evm.Client, msg string) []byte {
114-
// NOTE: This is not a right way to send a transaction. Msg must be properly encoded to trigger a proper receiver contract call.
115-
// In this case we just need to see transaction on chain, so it's sufficient.
116-
report, err := runtime.GenerateReport(&sdkpb.ReportRequest{
117-
EncodedPayload: []byte(msg),
118-
EncoderName: "evm",
119-
SigningAlgo: "ecdsa",
120-
HashingAlgo: "keccak256",
121-
}).Await()
122-
require.NoError(t, err, "failed to generate report")
123-
reportReply, err := client.WriteReport(runtime, &evm.WriteCreReportRequest{
124-
Receiver: common.HexToAddress(cfg.Addresses[0]).Bytes(),
125-
Report: report,
126-
GasConfig: &evm.GasConfig{GasLimit: 500_000},
127-
}).Await()
128-
require.NoError(t, err, "failed to write report")
129-
require.NotNil(t, reportReply)
130-
return reportReply.TxHash
131-
}
132-
133108
func printDecodedData(t *T, runtime sdk.Runtime, eventABI string, eventName string, data []byte) (string, error) {
134109
require.NotNil(t, eventABI, "eventABI input should not be nil")
135110
require.NotNil(t, eventName, "eventName input should not be nil")

system-tests/tests/smoke/cre/v2_evm_capability_test.go

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -233,17 +233,23 @@ func ExecuteEVMLogTriggerTest(t *testing.T, testEnv *ttypes.TestEnvironment) {
233233
for chainID, bcOutput := range chainsToTest {
234234
lggr.Info().Msgf("Creating EVM LogTrigger workflow configuration for chain %s", chainID)
235235
workflowConfig, msgEmitter := configureEVMLogTriggerWorkflow(t, lggr, bcOutput)
236-
236+
listenerCtx, messageChan, kafkaErrChan := t_helpers.StartBeholder(t, lggr, testEnv)
237237
workflowName := fmt.Sprintf("evm-logTrigger-workflow-%s-%04d", chainID, rand.Intn(10000))
238238
lggr.Info().Msgf("About to deploy Workflow %s on chain %s", workflowName, chainID)
239239
t_helpers.CompileAndDeployWorkflow(t, testEnv, lggr, workflowName, &workflowConfig, workflowFileLocation)
240240

241-
time.Sleep(30 * time.Second) // wait for trigger to be registered
241+
triggersUpAndRunning := "Trigger RunSimpleEvmLogTriggerWorkflow called"
242+
err := t_helpers.AssertBeholderMessage(listenerCtx, t, triggersUpAndRunning, lggr, messageChan, kafkaErrChan, 4*time.Minute)
243+
require.NoError(t, err, "LogTrigger capability test failed, Beholder should not return an error")
244+
245+
// wait for trigger to be registered across the workflow engine of all workflow nodes
246+
time.Sleep(10 * time.Second)
242247

243248
message := "Data for log trigger"
244-
startBlock := emitEvent(t, lggr, chainID, bcOutput, msgEmitter, message, workflowConfig)
245-
evmChain := bcOutput.(*evm.Blockchain)
246-
validateWorkflowExecution(t, lggr, testEnv, evmChain, workflowName, common.HexToAddress(workflowConfig.Addresses[0]), startBlock)
249+
_ = emitEvent(t, lggr, chainID, bcOutput, msgEmitter, message, workflowConfig)
250+
expectedUserLog := "OnTrigger decoded message: message:" + message
251+
err = t_helpers.AssertBeholderMessage(listenerCtx, t, expectedUserLog, lggr, messageChan, kafkaErrChan, 4*time.Minute)
252+
require.NoError(t, err, "Expected user log test failed")
247253

248254
lggr.Info().Msgf("🎉 LogTrigger Workflow %s executed successfully on chain %s", workflowName, chainID)
249255
successfulLogTriggerChains = append(successfulLogTriggerChains, chainID)

0 commit comments

Comments
 (0)