[KLC-1595] Change naming to Klever Blockchain#14
Conversation
WalkthroughThis update systematically transitions the entire codebase, documentation, tests, and configuration from supporting the MultiversX blockchain to supporting the Klever Blockchain (KC). All identifiers, comments, configuration keys, and logic referencing MultiversX or its abbreviations (e.g., "mvx", "erd") are replaced with Klever Blockchain equivalents (e.g., "kc", "klv"). This includes renaming types, interfaces, constants, method and function names, error variables, metrics, and configuration sections. Test suites, Docker and CI/CD files, and all supporting documentation are similarly updated to reflect the new blockchain context. The core logic, control flow, and error handling remain unchanged except for the systematic renaming and retargeting. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant BridgeApp
participant KCClient
participant EthereumClient
User->>BridgeApp: Initiate cross-chain transfer
BridgeApp->>KCClient: Fetch KC batch/status
KCClient-->>BridgeApp: Return batch/status
BridgeApp->>EthereumClient: Check/execute batch on Ethereum
EthereumClient-->>BridgeApp: Confirm execution
BridgeApp->>KCClient: Update KC batch status
KCClient-->>BridgeApp: Confirm status update
BridgeApp-->>User: Notify transfer completion
Poem
Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (1)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Actionable comments posted: 17
🔭 Outside diff range comments (13)
bridges/ethKc/steps/ethToKc/step04WaitForQuorum_test.go (1)
56-60: Assertion always passes – useassert.Falsefor boolean
IsInterfaceNil()returns abool;assert.NotNilwill never fail for a non-pointer boolean.
Assert on the actual value instead:-// Test IsInterfaceNil -assert.NotNil(t, step.IsInterfaceNil()) +// Test IsInterfaceNil +assert.False(t, step.IsInterfaceNil())executors/kc/scCallsExecutor_test.go (1)
15-20: Duplicate import of the same package breaks compilation
github.com/klever-io/klv-bridge-eth-go/clients/klever/blockchain/addressis imported twice
(line 17 without alias, line 18 with alias). Go forbids duplicate imports and the test file
will not compile.Suggested fix:
- "github.com/klever-io/klv-bridge-eth-go/clients/klever/blockchain/address" - kleverAddress "github.com/klever-io/klv-bridge-eth-go/clients/klever/blockchain/address" + kleverAddress "github.com/klever-io/klv-bridge-eth-go/clients/klever/blockchain/address"Then replace every occurrence of
address.withkleverAddress.inside this file.This change touches many lines, but is purely mechanical and avoids a hard build failure.
testsCommon/testKcCodec.go (1)
103-110: Length-sanity check is wrong – decoder panics on any valid payload
decodeCallData()comparesnumChars(the first 4-byte value) withlen(buff)after those 4 bytes were already sliced off.
For a normal payload this can never be equal – the buffer still contains the function name, gas-limit, args, etc. The code therefore panics for every non-empty call-data.- buff, numChars, err := parsers.ExtractUint32(buff) + // totalLen is the size of the encoded call-data that follows this field + buff, totalLen, err := parsers.ExtractUint32(buff) if err != nil { panic(err) } - if numChars != len(buff) { - panic("mismatch for len") + if int(totalLen) > len(buff) { + panic(fmt.Sprintf("declared length %d exceeds remaining buffer %d", totalLen, len(buff))) }The subsequent parsing should operate on
buff[:totalLen](and advance the pointer) to keep the decoder robust.
Please add a unit-test exercising a round-trip for a non-emptyCallDatainstance – it currently fails.testsCommon/addressGenerators.go (1)
18-26: Ignored constructor error may hide invalid addresses
address.NewAddressFromBytesreturns an error; ignoring it risks propagating an invalid KC address into tests.- addr, _ := address.NewAddressFromBytes(buff) + addr, err := address.NewAddressFromBytes(buff) + if err != nil { + panic(err) // tests should fail loudly + }Do the same in
CreateRandomKcSCAddress.api/swagger/swagger/openapi.yaml (1)
1-60: Swagger 2.0 + “components” = spec violationYou kept
swagger: "2.0"but switched to OpenAPI-3 style sections (components,content,$ref: '#components/…').
This mix renders the spec invalid and will break code-gen / swagger-ui.-swagger: "2.0" +openapi: 3.0.3 … -components: - schemas: +components: + schemas:Either (1) upgrade fully to OpenAPI-3 or (2) revert to Swagger-2 keywords (
definitions,responses.schema, etc.).integrationTests/relayers/slowTests/framework/bridgeComponents.go (1)
100-105: Potential deadlock:require.Nilbeforewg.Done
require.NilinvokesFailNow, which aborts the goroutine without reachingwg.Done, leavingwg.Wait()hanging forever.- go func() { - err = relayer.Start() - log.LogIfError(err) - require.Nil(bridge, err) - wg.Done() - }() + go func() { + defer wg.Done() + err := relayer.Start() + log.LogIfError(err) + assert.Nil(bridge, err) // assert is safe inside goroutines + }()Switch to
assert(non-fatal) or movewg.Doneinto adeferto avoid the latent deadlock.executors/ethereum/migrationBatchCreator_test.go (1)
440-448: Duplicate branch – likely copy-paste typo
DecimalsCalledcontains two identical checks fortkn2Erc20Address, the second one probably meanttkn3Erc20Address.- if string(erc20Address.Bytes()) == string(tkn2Erc20Address) { - return 0, nil - } + if string(erc20Address.Bytes()) == string(tkn3Erc20Address) { + return 0, nil + }Without this fix
tkn3falls into the default branch and returns0, which may hide decimals-handling bugs.core/batchProcessor/batchProcessor_test.go (1)
52-68:assert.Equalwill fail for[]*big.Int– compare values, not pointer addresses
big.NewIntallocates a fresh pointer every call; therefore the two slices contain different pointer addresses even though the numeric values match.
assert.Equal(viareflect.DeepEqual) compares pointers, so these assertions will always fail.Refactor to use value comparison, e.g.:
-assert.Equal(t, expectedAmounts, args.Amounts) +for i, want := range expectedAmounts { + assert.Zero(t, want.Cmp(args.Amounts[i]), "amount mismatch at index %d", i) +}Do the same for
expectedNonces.
Without this, the test suite will be red immediately after merge.integrationTests/relayers/slowTests/framework/keys.go (1)
150-158: Ethereum-funding filter uses Klever key instead of Ethereum key
WalletsToFundOnEthereumskips entries wherelen(key.KlvSk)==0.
The presence of a Klever private key is irrelevant when deciding which wallets need ETH funding; the intended guard is usually the Ethereum key.- if len(key.KlvSk) == 0 { + if key.EthSK == nil { continue }factory/ethKcBridgeComponents.go (1)
259-269: Production code left with TODOs that mask potential decoding bugsBoth
// TODO: change decoder to use klever from string to hexcomments signal that the addresses are still decoded with MultiversX assumptions.
If the byte layout / checksum differs, signatures or contract calls will silently revert at runtime.Resolve the TODO before merging or guard the code with feature flags/tests so relayers do not start with invalid addresses.
clients/balanceValidator/balanceValidator.go (2)
60-99: Potential mismatch betweenDirectionenum and switch cases
checkRequiredBalanceswitches onbatchProcessor.DirectionexpectingFromKcandToKc, yet onlyFromKcis visible in the current constants.
IfToKcis absent the default branch will always fire, returningErrInvalidDirection.Please verify the enum definition and add the missing constant or update the switch.
271-300: Endless loop risk when no executed batch is ever foundBoth
getTotalTransferAmountInPendingKlvBatchesand its Ethereum counterpart iterate with an unboundedfor { … }and monotonicbatchID--/++.
If the chain returns an uninterrupted sequence of pending batches, the loop never exits.Guard against runaway iterations, e.g.:
-for { +maxIterations := 1_000_000 +for i := 0; i < maxIterations; i++ { ... } +return nil, fmt.Errorf("safety stop hit while scanning pending batches")testsCommon/bridge/bridgeExecutorStub.go (1)
420-427:CheckAvailableTokensneither increments the counter nor returnsnotImplemented
- Add the counter increment to stay coherent with the other stub methods.
- When the callback is not injected, return
notImplementedinstead ofnilso that tests can detect missing expectations.func (stub *BridgeExecutorStub) CheckAvailableTokens(ctx context.Context, ethTokens []common.Address, kdaTokens [][]byte, amounts []*big.Int, direction batchProcessor.Direction) error { + stub.incrementFunctionCounter() if stub.CheckAvailableTokensCalled != nil { return stub.CheckAvailableTokensCalled(ctx, ethTokens, kdaTokens, amounts, direction) } - return nil + return notImplemented }
♻️ Duplicate comments (3)
integrationTests/relayers/slowTests/framework/tokensRegistry.go (1)
56-64: Ditto onkdaChainSpecificTokennamingSame mismatch here – align the parameter with the field.
integrationTests/relayers/ethToKc_test.go (1)
257-283: Same duplication pattern in the second testThe same
AddBatch(batch)duplication appears here. Clean-up for consistency.testsCommon/bridge/bridgeExecutorStub.go (1)
387-393: Symmetric issue inCheckEthereumClientAvailabilityMirror the fix applied to the KC counterpart for consistency and correct metrics.
🧹 Nitpick comments (87)
executors/kc/errors.go (1)
6-18: Nit: Align error message with variable name.The message for
errInvalidNumberOfResponseLinesreads"invalid number of responses", which may mislead; consider updating it to"invalid number of response lines"for consistency.clients/klever/proxy/interface.go (1)
11-11: Remove duplicate "blockchain"The comment repeats "blockchain". Consider simplifying:
-// Proxy defines the behavior of a proxy able to serve Klever Blockchain blockchain requests +// Proxy defines the behavior of a proxy able to serve Klever Blockchain requestsclients/klever/proxy/endpointProviders/proxyEndpointProvider.go (1)
11-11: Add trailing period in commentAlign with Go doc conventions by ending the sentence with a period:
-// proxyEndpointProvider is suitable to work with a Klever Blockchain Proxy +// proxyEndpointProvider is suitable to work with a Klever Blockchain Proxy.executors/kc/interface.go (1)
25-25: Terminate doc comment with a periodFor consistency in Go documentation comments, append a period:
-// Codec defines the operations implemented by a Klever Blockchain codec +// Codec defines the operations implemented by a Klever Blockchain codec.clients/klever/proxy/endpointProviders/nodeEndpointProvider.go (1)
11-11: Add trailing period in commentEnsure uniform doc style by ending with a period:
-// nodeEndpointProvider is suitable to work with a Klever Blockchain node (observer) +// nodeEndpointProvider is suitable to work with a Klever Blockchain node (observer).clients/klever/mappers/interface.go (1)
5-5: Fix duplicated word in comment.The comment reads “Klever Blockchain blockchain”. Remove the redundant “blockchain” to improve clarity.
clients/klever/proxy/proxy.go (2)
32-33: Standardize naming in comment.The comment uses “kc proxy” — consider updating to “Klever Blockchain proxy” or capitalize the abbreviation as “Kc proxy” to match project conventions.
45-46: Align comment with naming convention.Similar to
ArgsProxy, update “kc Proxy” to “Klever Blockchain proxy” or “Kc proxy” for consistency.parsers/types.go (1)
41-48: Consider standardizing address case labels.The output uses “Eth address” and “Klv address”. For consistency with other logs and outputs, consider using uppercase abbreviations (e.g.,
ETH addressandKLV address) or full names (e.g.,Ethereum addressandKlever address).README.md (2)
21-21: Grammar nit: adjust verb formChange “considering to help out” to “considering helping out” for correct verb usage.
-Thank you for considering to help out with the source code! +Thank you for considering helping out with the source code!
23-23: Grammar nit: refine “both ... as well as”Use “and” after “both” instead of “as well as” for idiomatic phrasing.
-which can make both your efforts much lighter as well as our review and merge procedures quick and simple. +which can make both your efforts much lighter and our review and merge procedures quick and simple.bridges/ethKc/errors.go (1)
1-1: Enforce Go package naming conventions.
The package nameethKcuses mixed case. Go style recommends all lowercase package names (e.g.,ethkc) to avoid casing issues and adhere to standard conventions.scCallsExecutor.Dockerfile (1)
22-22: Copy only the executable for leaner image.
Currently, theCOPY --from=builder /kc/cmd/scCallsExecutor /kccopies the entire directory. Consider limiting this to the binary:-COPY --from=builder /kc/cmd/scCallsExecutor /kc +COPY --from=builder /kc/cmd/scCallsExecutor/scCallsExecutor /kc/to reduce image size.
clients/klever/proxy/baseProxy.go (1)
18-18: Rebrand logger namespace invocation.
Updated the logger context from"mx-sdk-go/blockchain"to"klever-go-sdk/blockchain". However, the import path still points togithub.com/multiversx/mx-chain-logger-go. Consider renaming or forking the logger package for Klever-specific branding if available.bridges/ethKc/constants.go (1)
7-10: Export or documentdurationLimitto clarify its intentUnlike
InvalidActionID,durationLimitis unexported and lacks a comment.
If callers in other packages need this timeout, they cannot reference it, which may lead to duplicated literals.
Either export it (DurationLimit) or add a comment explaining that it is intentionally package-private.-const durationLimit = time.Second +// durationLimit defines the maximum time allowed for on-chain polling operations. +// It is package-private because no external package should rely on it directly. +const durationLimit = time.Secondbridges/ethKc/steps/kcToEth/step02SignProposedTransfer.go (1)
15-27: Context parameter is ignored – consider wiring it through
Executereceives acontext.Contextbut discards it (_).
If downstream methods (e.g.SignTransferOnEthereum) ever need cancellation or deadlines, the information is lost.-func (step *signProposedTransferStep) Execute(_ context.Context) core.StepIdentifier { +func (step *signProposedTransferStep) Execute(ctx context.Context) core.StepIdentifier { ... - err := step.bridge.SignTransferOnEthereum() + // propagate ctx once bridge APIs accept it + err := step.bridge.SignTransferOnEthereum() // TODO: accept ctxEven if the current bridge API doesn’t accept a context, keeping the param name (
ctx) documents intent and eases future refactors.clients/klever/proxy/proxy_test.go (1)
459-460: Large in-line JSON literals hamper readabilityThe two ~600-character JSON literals make the test hard to scan.
Consider extracting them into helper functions or embedding testdata files to reduce noise and improve maintainability.executors/kc/filters/pendingOperationFilter_test.go (1)
261-262: Rename the sub-test for clarityThe label
"kda address"no longer matches the content (we deal with KLV addresses here).
Consider updating to avoid confusion in future test reports.-t.Run("kda address", func(t *testing.T) { +t.Run("klv address", func(t *testing.T) {cmd/scCallsExecutor/flags.go (2)
72-75: Consider defining a sane default or env-var fallback for--network-address
The Usage text now points to a Klever test-net node, but the flag still has no default value. Supplying either:
- a default pointing to the public test-net gateway, or
- the ability to read
KLV_NETWORK_ADDRESSfrom the environmentwould spare operators from always having to provide the flag manually.
81-85: Tighten wording and avoid comment/Usage duplicationBoth the line comment and the
Usagestring repeat identical information and contain the singular “transaction”. A concise phrasing removes the duplication and fixes the grammar.-// privateKeyFile is the Klever Blockchain private key file used to issue transaction for the SC calls +// Path to the PEM file holding the Klever Blockchain private key used to sign SC-call transactions ... -Usage: "The Klever Blockchain private key file used to issue transaction for the SC calls", +Usage: "Path to the PEM file that holds the Klever private key used to sign SC-call transactions",p2p/interface.go (1)
27-28: Minor wording & lingering dependency note
- English article should be “a Klever Blockchain role provider”, not “an Klever…”.
- While the interface was renamed to
KcRoleProvider, the file still importsmultiversx/mx-chain-core-go. Make sure the long-term plan is to phase out this dependency to avoid mixed terminology and potential incompatibilities.bridges/ethKc/steps/ethToKc/step05PerformActionID.go (1)
17-22: Log message mismatch – should reference “performed”, not “proposed”The check is
WasActionPerformedOnKc, but the error text still says “proposed”.- step.bridge.PrintInfo(logger.LogError, "error determining if the action ID was proposed or not", + step.bridge.PrintInfo(logger.LogError, "error determining if the action ID was performed or not",executors/kc/scCallsExecutor_test.go (1)
594-606: Minor nit – typo in comment
// only the second pending operation gor through the filter
→ “goes through the filter”Not blocking, but worth a quick touch-up on your next sweep.
testsCommon/testKcCodec.go (2)
16-29: Top-level marker hard-codes “data present”
EncodeCallDataWithLenAndMarker()always prefixesbridgeCore.DataPresentProtocolMarker, even if the caller intends to convey missing data (e.g. an emptyCallData). This makes it impossible to encode the “missing data” variant.Consider:
- result = append(result, bridgeCore.DataPresentProtocolMarker) // marker + marker := bridgeCore.DataPresentProtocolMarker + if callData.Type == bridgeCore.MissingDataProtocolMarker { + marker = bridgeCore.MissingDataProtocolMarker + } + result = append(result, marker)At minimum, document that the helper only supports the “data present” scenario.
63-81: Inefficient buffer handling – drop the 1 MB pre-allocationAll three helpers (
EncodeCallData*,encodeArgs) pre-allocate 1 MiB. For test utilities this wastes memory and obscures intent.-initialAlloc := 1024 * 1024 // 1MB initial buffer -result := make([]byte, 0, initialAlloc) +var result []byteIf you want to avoid reallocations, use
bytes.BufferwithGrow()or pick a modest guess (e.g. 128 B).bridges/ethKc/steps/kcToEth/stepsFactory.go (2)
6-8: Left-over MultiversX dependencyWhile the file was renamed to
kcToEth, it still imports
github.com/multiversx/mx-chain-core-go/core/check.
If the intention is a full re-branding, consider vendoring or mirroring the tinycheck.IfNilhelper to remove the residual dependency.Not blocking, just a branding consistency note.
60-60: Error wrapping already adds context – avoid duplicated wording
fmt.Errorf("%w for identifier '%s'", ethKc.ErrDuplicatedStepIdentifier, s.Identifier())The wrapped error already explains the problem; the suffix duplicates it.
Prefer:- return nil, fmt.Errorf("%w for identifier '%s'", ethKc.ErrDuplicatedStepIdentifier, s.Identifier()) + return nil, fmt.Errorf("%w: '%s'", ethKc.ErrDuplicatedStepIdentifier, s.Identifier())testsCommon/addressGenerators.go (1)
28-37: Smart-contract address generator: magic constants deserve a comment
firstPart := append(make([]byte, 8), []byte{5, 0}...)silently encodes the SC prefix.
Add a short comment or constant (scPrefix) explaining the0x0500meaning to future readers.cmd/migration/main.go (1)
157-165: Use un-exported identifiers for local vars
argsKLVClientDataGetterandKLVDataGetterstart with an upper-case letter, which makes the identifiers exported, even though they are scoped only withincreateInternalComponentsWithBatchCreator. Most linters (revive,golint) will flag this as a style issue.- argsKLVClientDataGetter := klever.ArgsKLVClientDataGetter{ + argsKlvClientDataGetter := klever.ArgsKLVClientDataGetter{ ... - KLVDataGetter, err := klever.NewKLVClientDataGetter(argsKLVClientDataGetter) + klvDataGetter, err := klever.NewKLVClientDataGetter(argsKlvClientDataGetter) ... - KlvDataGetter: KLVDataGetter, + KlvDataGetter: klvDataGetter,Renaming avoids accidental export and keeps the codebase consistent with standard Go naming conventions.
Also applies to: 201-207
clients/klever/klvClientDataGetter.go (1)
48-49: Comment refers to non-existent identifiersThe docstring mentions
ArgsklvClientDataGetterandNewklvClientDataGetter, whereas the actual symbols areArgsKLVClientDataGetterandNewKLVClientDataGetter.-// ArgsklvClientDataGetter is the arguments DTO used in the NewklvClientDataGetter constructor +// ArgsKLVClientDataGetter is the arguments DTO used in the NewKLVClientDataGetter constructorKeeping comments in sync with code prevents confusion and helps tooling that parses documentation.
api/swagger/swagger/openapi.yaml (1)
40-41: Enum casing inconsistency
KleverBlockchainToEth/EthToKleverBlockchainuse PascalCase whileklever-client/eth-clientuse kebab-case.
Clients doing strict enum validation may fail. Align casing across all values.bridges/ethKc/steps/kcToEth/step06ResolveSetStatus_test.go (1)
121-123: Constant cast is redundant
ProposingSetStatusOnKcis already acore.StepIdentifier(type alias). The extra cast is unnecessary:-expectedStep := bridgeCore.StepIdentifier(ProposingSetStatusOnKc) +expectedStep := ProposingSetStatusOnKcbridges/ethKc/steps/kcToEth/step10PerformSetStatus.go (1)
6-9: Left-over MultiversX logger importWhile the business logic was rebranded, the logger package still points to
github.com/multiversx/mx-chain-logger-go.
If Klever provides its own fork, consider switching; otherwise leave as-is and document the dependency.clients/klever/mappers/mappers_test.go (1)
46-99: Minor semantic nit – argument namingSeveral test invocations pass a byte slice labelled
"klvAddress"where the mapper expects a token-id (ticker).
The label is harmless for the test but could confuse future readers – consider renaming the literal to"tokenId"for clarity.integrationTests/mock/tokensRegistryMock.go (2)
27-31: Misspelling in log/panic messages
"tiker"→"ticker"appears twice. Small but worth fixing for grep-ability.- panic("tiker for erc20 address " + erc20Address.String() + " not found") + panic("ticker for erc20 address " + erc20Address.String() + " not found")
44-57: Still not goroutine-safe — add mutex if future concurrency is expectedComment already states “not concurrent safe”. If this mock ever gets reused in parallel tests, race conditions will bite.
Wrapping the maps with async.RWMutexis trivial and future-proof.bridges/ethKc/steps/kcToEth/step08SignProposedSetStatus_test.go (1)
7-7: Redundant alias – simplify import
ethKcis already the package name; adding an explicit alias with the same spelling is noise and may confuse linters.- ethKc "github.com/klever-io/klv-bridge-eth-go/bridges/ethKc" + "github.com/klever-io/klv-bridge-eth-go/bridges/ethKc"bridges/ethKc/steps/ethToKc/step01GetPending.go (1)
18-61: Retry counter reset only for Kc – is Ethereum side intentional?
ResetRetriesCountOnKc()is invoked, but the symmetric Ethereum retry counter (if any) is untouched.
If the intention is to clear all retry state when a new loop starts, add an Ethereum reset; otherwise document the asymmetry.config/config.go (1)
164-166: Doc-comment uses a different struct name than the declaration
// KcGasMapConfig ...documents a struct that does not exist – the actual type that follows isKleverGasMapConfig.
This will breakgodoc/ IDE navigation and is an easy source of confusion during later renames.-// KcGasMapConfig represents the gas limits for Klever Blockchain operations +// KleverGasMapConfig represents the gas limits for Klever Blockchain operationsintegrationTests/relayers/slowTests/common.go (1)
56-58: Token-balance helpers still use theKDAprefixThroughout the test helpers the new standard is
Klv/Kc, yet fields such asKDASafeExtraBalanceand inline comments still talk about “kda”.
For the sake of consistency (and grep-ability) consider switching these identifiers toKlvSafeExtraBalance.No functional impact, but tightening naming early prevents drift.
Also applies to: 98-100, 140-142, 182-184
clients/klever/mappers/kcToErc20.go (1)
27-29: Comment contradicts the implementation
ConvertTokencallsGetERC20AddressForTokenId, i.e. it maps KLV token-ID ➜ ERC-20 address.
The comment claims the opposite.-// ConvertToken will return klv token id given a specific erc20 address +// ConvertToken returns the ERC-20 address corresponding to the supplied KLV token-ID.integrationTests/relayers/slowTests/startsFromEthereumEdgecaseFlow.go (1)
15-18: Variable names no longer match the direction of transfer
kdaToEthDoneis updated in the Kc ➜ Eth branch (SendFromKcToEthereum/IsTransferDoneFromKc).
To avoid mental mapping errors, rename the flag tokcToEthDone(orklvToEthDone) and update its usages.- kdaToEthDone bool + kcToEthDone bool ... - if !flow.kdaToEthDone && isTransferDoneFromKc { - flow.kdaToEthDone = true + if !flow.kcToEthDone && isTransferDoneFromKc { + flow.kcToEthDone = trueAlso applies to: 41-45
p2p/broadcaster.go (1)
28-38: Minor naming drift between Args and struct fieldConstructor arg is
KcRoleProviderwhile the internal field iskleverRoleProvider.
Although harmless, using the same prefix (“kc”) everywhere eases grepping and reduces room for future copy-paste errors.Not blocking, just consider:
- kleverRoleProvider KcRoleProvider + kcRoleProvider KcRoleProviderAlso applies to: 44-48, 105-107, 155-157
clients/klever/mappers/erc20ToKc.go (1)
12-29: Optional: consider exporting the mapper type for reuse
erc20ToKcis currently unexported, while the constructorNewErc20ToKcMapperis exported.
If any external packages need to assert the concrete type (e.g. in tests), exporting the struct (Erc20ToKc) will avoidgo vetwarnings about returning unexported concrete types.-type erc20ToKc struct { +type Erc20ToKc struct {Not critical, purely a style / usability choice.
bridges/ethKc/steps/kcToEth/step07ProposeSetStatus_test.go (2)
76-82: Comment / name mismatch – very minorThe inner test case title still says “
SigningProposedSetStatusOnKc” but the constant used was already correct.
Consider aligning the description text for clarity during test failure output; code logic itself is sound.
110-118: Same nit – update descriptionHeading mentions
SigningProposedTransferOnKcbut expectation isSigningProposedSetStatusOnKc.
Purely cosmetic, but fixing avoids confusion when reading test results.bridges/ethKc/steps/ethToKc/step02ProposeTransfer.go (2)
6-9: Use KC-branded logger dependency for consistencyAll multiversx identifiers are being removed, yet we still pull
github.com/multiversx/mx-chain-logger-go.
If Klever has its own fork/package, switch to it; otherwise add a TODO explaining why MultiversX’ logger remains.
25-27: Avoid logging a possibly-nilerrIf
WasTransferProposedOnKcreturns(false, nil)the second log prints
"error", <nil>, which is confusing. Emit the message only whenerr != nil.- step.bridge.PrintInfo(logger.LogError, "error determining if the batch was proposed or not on Kc", - "batch ID", batch.ID, "error", err) + if err != nil { + step.bridge.PrintInfo(logger.LogError, "error determining if the batch was proposed or not on Kc", + "batch ID", batch.ID, "error", err) + }bridges/ethKc/steps/ethToKc/step03SignProposedTransfer.go (2)
6-10: Logger import still references MultiversXSame remark as in step02: consider migrating to a Klever logger package to complete the re-branding.
30-33: Do not logerrwhen it is guaranteed to benil
errcomes from the previous call and isnilif we reached the invalid-ID branch.
Logging it adds noise; drop the key or assign a meaningful value.- step.bridge.PrintInfo(logger.LogError, "contract error, got invalid action ID", - "batch ID", batch.ID, "error", err, "action ID", actionID) + step.bridge.PrintInfo(logger.LogError, "contract error, got invalid action ID", + "batch ID", batch.ID, "action ID", actionID)bridges/ethKc/steps/kcToEth/constants.go (2)
16-18: Typo: “confirmating” → “confirmation”- WaitingTransferConfirmation = "wait transfer confirmating" + WaitingTransferConfirmation = "wait transfer confirmation"
22-24: Typo: “idetifier” → “identifier”- // ProposingSetStatusOnKc is the step idetifier for proposing set status action on Kc + // ProposingSetStatusOnKc is the step identifier for proposing set status action on Kcbridges/ethKc/steps/kcToEth/step07ProposeSetStatus.go (2)
46-48: Incorrect log message – refers to “transfer” instead of “set status”- step.bridge.PrintInfo(logger.LogError, "error proposing transfer on Kc", + step.bridge.PrintInfo(logger.LogError, "error proposing set status on Kc",
6-9: MultiversX logger importSame branding concern as previous files – consider moving to a Klever-named logger.
clients/ethereum/client.go (2)
204-206: Comment & identifier drift (KlvvsKcvskda)The comment says “Klv”, the receiver is an Ethereum client, and the parameter below is named
kdaBatchID.
Pick ONE canonical acronym (preferably the same you decided above) to avoid cognitive overhead.
242-245: Rename argument for clarity
kdaBatchIDis passed straight toWasBatchExecuted; if this is indeed a batch id on Klever, preferkcBatchID(or whatever common acronym you settle on) for uniformity.executors/kc/filters/pendingOperationFilter.go (3)
79-98: Redundant stringify-lowercase cycle – consider trimming onceEvery
parseListcall lower-cases and trims again in the helper. Doing it here once is extra work and creates two slightly different code paths to keep in sync. Removing the pre-loopitem = strings.ToLower(item)fromparseListis the leaner spot-fix.
134-142: Missing validation for duplicate entries
checkListvalidates syntax but silently accepts duplicates.
Having the same KLV address twice inAllowedKlvAddressesorDeniedKlvAddressesserves no purpose and hides operator mistakes.
Quick win: keep amap[string]struct{}insidecheckListand raise on repeats.
162-165:checkKlvItemValidloses HRP / checksum feedback
address.NewAddress(item)returns an error but does not say why the address is invalid (length? HRP? checksum?). Enhancing the wrapped error with context will help ops debug bad configs:- _, errNewAddr := address.NewAddress(item) - return errNewAddr + if _, err := address.NewAddress(item); err != nil { + return fmt.Errorf("invalid KLV address %q: %w", item, err) + } + return nilintegrationTests/relayers/slowTests/framework/tokensRegistry.go (2)
35-37: Spelling drift between Ticker and DisplayName
KlvChainSpecificTokenTickerreceivesparams.KlvChainSpecificTokenDisplayName.
Either the field or the param name is off – pick one noun and stick with it to avoid confusion downstream in JSON marshaling & assertions.
45-53: Inconsistent prefix:kdaUniversalTokenvsKlvUniversalTokenThe API now mixes
kda(function parameter) withKlv(field). For searchability and consistency favor one acronym:-func (registry *tokensRegistry) RegisterUniversalToken(abstractTokenIdentifier string, kdaUniversalToken string) { +func (registry *tokensRegistry) RegisterUniversalToken(abstractTokenIdentifier string, klvUniversalToken string) { ... - data.KlvUniversalToken = kdaUniversalToken + data.KlvUniversalToken = klvUniversalTokenintegrationTests/relayers/slowTests/framework/ethereumHandler.go (1)
466-475:SendFromEthereumToKcduplicates loop logic – extract helper?
SendFromEthereumToKcandCreateBatchOnEthereumnow share identical looping code. Consider keeping only one and calling it from the other to avoid future divergence.parsers/kcCodec.go (1)
158-182: Receiver pointer vs value
func (codec *KcCodec) ExtractGasLimitFromRawCallDataand the other methods use a value receiver; any future state you add won’t propagate. Probably fine today, but switching to*KcCodecnow costs nothing and avoids surprises.integrationTests/relayers/slowTests/startsFromKcFlow.go (2)
15-17: Variable naming:kdaToEthDonevs “KLV” / “KC”The struct mixes
ethToKlvDonewithkdaToEthDone. Using three different abbreviations (klv,kda,kc) in the same file is easy to slip on during debugging. Rename toklvToEthDonefor symmetry.
31-44: Missing context cancellation pathAfter the
SendFromEthereumToKckick-off, the test may hang indefinitely if the transfer never finalises. Consider adding a context with timeout to avoid endless CI runs.bridges/ethKc/steps/kcToEth/step01GetPending_test.go (1)
86-95: Duplicate / misleading test titleBoth this
t.Runblock and the one at lines 71-78 are named"error on WasTransferPerformedOnEthereum", yet this block is actually exercising an error returned byCheckAvailableTokens.
Rename the description to avoid confusion and to keepgo test -runfilters usable.- t.Run("error on WasTransferPerformedOnEthereum", func(t *testing.T) { + t.Run("error on CheckAvailableTokens", func(t *testing.T) {integrationTests/relayers/slowTests/framework/keys.go (1)
204-210: Unencrypted PEM export may leak private keys
SaveKlvKeywrites raw hex-encoded secret keys directly into PEM blocks without any encryption or pass-phrase.
Even in test utilities, consider at least documenting the risk or usingEncryptPEMBlockwhen the file is intended to be reused outside CI.bridges/ethKc/steps/kcToEth/semiIntegrated_test.go (1)
311-314: Hard-coded string compared against typed constantComparing
stepThatErrors(typebridgeCore.StepIdentifier) with the untyped string literal"SignActionOnKc"works but is brittle.
Prefer comparing against the previously declared constantsignActionOnKcto avoid typos and keep refactors mechanical.- if stepThatErrors == "SignActionOnKc" { + if stepThatErrors == signActionOnKc {core/batchProcessor/batchProcessor.go (2)
30-32: Small perf win: pre-allocate slices
arg := &ArgListsBatch{ Direction: FromKc }is followed by multipleappendcalls in a loop.
Consider sizing the slices up-front to avoid repeated reallocations – e.g.:-arg := &ArgListsBatch{ Direction: FromKc } +arg := &ArgListsBatch{ + Direction: FromKc, + EthTokens: make([]common.Address, 0, len(batch.Deposits)), + Recipients: make([]common.Address, 0, len(batch.Deposits)), + KdaTokenBytes: make([][]byte, 0, len(batch.Deposits)), + Amounts: make([]*big.Int, 0, len(batch.Deposits)), + Nonces: make([]*big.Int, 0, len(batch.Deposits)), +}
56-58: Typo in comment-// The transfer is from Ehtereum to Klever Blockchain +// The transfer is from Ethereum to Klever Blockchainbridges/ethKc/steps/kcToEth/step01GetPending.go (1)
6-10: Logger import still points to MultiversX repoEven though only the previous line changed, note that the logger path is still
github.com/multiversx/mx-chain-logger-go.
If Klever maintains its own fork/package name, update accordingly to avoid a
transitive dependency on the old organisation.integrationTests/relayers/slowTests/ethToKcWithChainSimulator_test.go (1)
267-288: Prefer consistent abbreviations –KDAvsKlvInside
createBadTokenthe struct now mixesKlv...fields with
KDASafeExtraBalance. Consider aligning to one prefix (Klv) to avoid cognitive
overhead.executors/ethereum/migrationBatchCreator.go (1)
23-32: Field name drifts from new terminologyInternal field is called
kdaDataGetterbut the interface isKlvDataGetter.
Renaming the variable will improve readability:-type migrationBatchCreator struct { - kdaDataGetter KlvDataGetter +type migrationBatchCreator struct { + klvDataGetter KlvDataGetter(and update usages).
integrationTests/relayers/slowTests/framework/types.go (1)
41-46: Struct field naming driftAll new fields were renamed with
Klvprefixes, butHasChainSpecificToken(l.24) kept the old generic name.
For searchability and grep-based tooling stick to the same prefix, e.g.HasKlvChainSpecificToken.factory/ethKcBridgeComponents.go (2)
116-117: Public constructor comment and name are out-of-syncThe doc-comment says
NewethKleverBridgeComponents(lower-case “eth”), the exported function isNewEthKleverBridgeComponents.Doc-comments must start with the exact identifier to satisfy
golintand IDE quick-docs.-// NewethKleverBridgeComponents creates a new eth-kc bridge components holder +// NewEthKleverBridgeComponents creates a new eth-kc bridge components holder
665-669: Possible nil-pointer in balance validator creation
components.kcClientandcomponents.ethClientare injected unconditionally; if either previous factory step failed and returnednilwithout error (e.g. due to config gating) this will panic here.
Consider early-returning if either client isnil.integrationTests/relayers/slowTests/framework/address.go (2)
20-27: Local variable shadows imported packageaddressInside
NewKlvAddressFromBytesyou createaddress := &KlvAddress{ ... }This shadows the imported
addresspackage for the remainder of the function, hurting readability.- address := &KlvAddress{ + klvAddr := &KlvAddress{and return
klvAddr.
50-67: Receiver name shadows package as wellMethods use
(address *KlvAddress)which again hides the imported package for the whole method body.
Use a short receiver (ka,a, etc.) to avoid confusion:-func (address *KlvAddress) Bytes() []byte { - return address.bytes +func (ka *KlvAddress) Bytes() []byte { + return ka.bytesintegrationTests/relayers/slowTests/framework/testSetup.go (1)
181-188: Atomic counter increment may overflow uint32 in long test suites
numScCallsInTestisuint32. A large fuzz run could silently wrap after 4 billion calls.
Useuint64to be future-proof.clients/balanceValidator/balanceValidator_test.go (1)
1375-1403: Duplicated magic slicekdaTokeninside helper mutates global
applyDummyFromKlvDepositsToBatchalways injects the globalkdaTokeneven when the caller passes a different slice incfg.kdaToken. Use the value fromcfginstead to reflect the scenario under test.-SourceTokenBytes: kdaToken, +SourceTokenBytes: cfg.kdaToken,integrationTests/relayers/ethToKc_test.go (1)
82-100: DuplicateAddBatch()calls can hide test intent
ethereumChainMock.AddBatch(batch)is invoked twice (lines 82 and 99).
Although idempotent in the current mock, duplicating calls:
- Inflates the mock’s internal counter – some assertions may later rely on the exact call-count.
- Obscures the intended chronology (before vs. after deposits).
Consider removing the second call unless you really need two identical entries.
-ethereumChainMock.AddBatch(batch) ... -ethereumChainMock.AddBatch(batch) // duplicatebridges/ethKc/steps/ethToKc/semiIntegrated_test.go (1)
255-266:stepsThatCanErrorslice contains duplicates
wasTransferProposedOnKcappears twice (260, 261). The duplicate adds no value and makes the intent of the test less clear.- wasTransferProposedOnKc, - proposeTransferOnKc, - wasTransferProposedOnKc, // duplicate + wasTransferProposedOnKc, + proposeTransferOnKc,bridges/ethKc/bridgeExecutor_test.go (1)
181-203: Assertion counters seem brittleAll counters are hard-coded to
4. When the step list changes these tests will silently become wrong.
Consider deriving the expected counter fromnumStepsor the executor’s step table to reduce maintenance overhead.testsCommon/bridge/bridgeExecutorStub.go (3)
14-15: Logger import still references MultiversX packageThe re-branding effort removes “multiversx” from identifiers, yet the logger import is still
logger "github.com/multiversx/mx-chain-logger-go"Consider switching to an equivalent Klever-branded fork (if one exists) or, at minimum, add a TODO explaining why the original package is intentionally kept.
23-60: Field names updated – 👍 but doc-strings lag behindThe struct fields were consistently renamed (
…OnKcCalled, etc.) – good job.
However, many godoc comments above the methods still start with the old “// …” pattern that doesn’t match the new identifiers (e.g.// GetBatchFromKc -). Consider updating the comment summaries to keep IDE symbol search in sync.
414-417: Use read lock inGetFunctionCounterThe method only reads the map; using
RLockreduces contention.- stub.mutExecutor.Lock() - defer stub.mutExecutor.Unlock() + stub.mutExecutor.RLock() + defer stub.mutExecutor.RUnlock()executors/ethereum/errors.go (1)
7-7: Inconsistent capitalization of proper noun in error messageProper nouns (e.g., “Ethereum” in
"nil Ethereum chain wrapper") are capitalized in other errors. To stay consistent, capitalize “Klever Blockchain” here:-var errNilKlvDataGetter = errors.New("nil klever blockchain data getter") +var errNilKlvDataGetter = errors.New("nil Klever Blockchain data getter")Please verify that other error messages referring to Klever/KLV follow the same capitalization.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (148)
.github/ISSUE_TEMPLATE/bug-report.md(1 hunks).github/ISSUE_TEMPLATE/feature.md(1 hunks).github/ISSUE_TEMPLATE/question.md(1 hunks).github/workflows/create_release.yml(1 hunks)README.md(3 hunks)api/swagger/README.md(1 hunks)api/swagger/swagger/openapi.yaml(3 hunks)bridges/ethKc/bridgeExecutor.go(23 hunks)bridges/ethKc/bridgeExecutor_test.go(53 hunks)bridges/ethKc/constants.go(1 hunks)bridges/ethKc/converters.go(1 hunks)bridges/ethKc/errors.go(2 hunks)bridges/ethKc/interface.go(4 hunks)bridges/ethKc/signaturesHolder.go(1 hunks)bridges/ethKc/signaturesHolder_test.go(1 hunks)bridges/ethKc/steps/ethToKc/constants.go(1 hunks)bridges/ethKc/steps/ethToKc/semiIntegrated_test.go(7 hunks)bridges/ethKc/steps/ethToKc/step01GetPending.go(4 hunks)bridges/ethKc/steps/ethToKc/step01GetPending_test.go(9 hunks)bridges/ethKc/steps/ethToKc/step02ProposeTransfer.go(2 hunks)bridges/ethKc/steps/ethToKc/step02ProposeTransfer_test.go(7 hunks)bridges/ethKc/steps/ethToKc/step03SignProposedTransfer.go(4 hunks)bridges/ethKc/steps/ethToKc/step03SignProposedTransfer_test.go(8 hunks)bridges/ethKc/steps/ethToKc/step04WaitForQuorum.go(2 hunks)bridges/ethKc/steps/ethToKc/step04WaitForQuorum_test.go(5 hunks)bridges/ethKc/steps/ethToKc/step05PerformActionID.go(3 hunks)bridges/ethKc/steps/ethToKc/step05PerformActionID_test.go(6 hunks)bridges/ethKc/steps/ethToKc/stepsFactory.go(2 hunks)bridges/ethKc/steps/ethToKc/stepsFactory_test.go(2 hunks)bridges/ethKc/steps/interface.go(2 hunks)bridges/ethKc/steps/kcToEth/constants.go(2 hunks)bridges/ethKc/steps/kcToEth/semiIntegrated_test.go(7 hunks)bridges/ethKc/steps/kcToEth/step01GetPending.go(4 hunks)bridges/ethKc/steps/kcToEth/step01GetPending_test.go(9 hunks)bridges/ethKc/steps/kcToEth/step02SignProposedTransfer.go(2 hunks)bridges/ethKc/steps/kcToEth/step02SignProposedTransfer_test.go(2 hunks)bridges/ethKc/steps/kcToEth/step03WaitForQuorumOnTransfer.go(2 hunks)bridges/ethKc/steps/kcToEth/step03WaitForQuorumOnTransfer_test.go(1 hunks)bridges/ethKc/steps/kcToEth/step04PerformTransfer.go(2 hunks)bridges/ethKc/steps/kcToEth/step04PerformTransfer_test.go(3 hunks)bridges/ethKc/steps/kcToEth/step05WaitTransferConfirmation.go(1 hunks)bridges/ethKc/steps/kcToEth/step05WaitTransferConfirmation_test.go(1 hunks)bridges/ethKc/steps/kcToEth/step06ResolveSetStatus.go(2 hunks)bridges/ethKc/steps/kcToEth/step06ResolveSetStatus_test.go(8 hunks)bridges/ethKc/steps/kcToEth/step07ProposeSetStatus.go(2 hunks)bridges/ethKc/steps/kcToEth/step07ProposeSetStatus_test.go(8 hunks)bridges/ethKc/steps/kcToEth/step08SignProposedSetStatus.go(2 hunks)bridges/ethKc/steps/kcToEth/step08SignProposedSetStatus_test.go(8 hunks)bridges/ethKc/steps/kcToEth/step09WaitForQuorumOnSetStatus.go(2 hunks)bridges/ethKc/steps/kcToEth/step09WaitForQuorumOnSetStatus_test.go(6 hunks)bridges/ethKc/steps/kcToEth/step10PerformSetStatus.go(2 hunks)bridges/ethKc/steps/kcToEth/step10PerformSetStatus_test.go(7 hunks)bridges/ethKc/steps/kcToEth/stepsFactory.go(2 hunks)bridges/ethKc/steps/kcToEth/stepsFactory_test.go(2 hunks)bridges/ethMultiversX/constants.go(0 hunks)clients/balanceValidator/balanceValidator.go(11 hunks)clients/balanceValidator/balanceValidator_test.go(25 hunks)clients/balanceValidator/errors.go(1 hunks)clients/balanceValidator/interface.go(2 hunks)clients/ethereum/client.go(3 hunks)clients/ethereum/client_test.go(7 hunks)clients/ethereum/wrappers/ethereumChainWrapper_test.go(1 hunks)clients/klever/client.go(3 hunks)clients/klever/client_test.go(2 hunks)clients/klever/errors.go(1 hunks)clients/klever/klvClientDataGetter.go(2 hunks)clients/klever/klvClientDataGetter_test.go(29 hunks)clients/klever/mappers/erc20ToKc.go(2 hunks)clients/klever/mappers/interface.go(1 hunks)clients/klever/mappers/kcToErc20.go(2 hunks)clients/klever/mappers/mappers_test.go(2 hunks)clients/klever/proxy/baseProxy.go(2 hunks)clients/klever/proxy/endpointProviders/nodeEndpointProvider.go(1 hunks)clients/klever/proxy/endpointProviders/proxyEndpointProvider.go(1 hunks)clients/klever/proxy/interface.go(1 hunks)clients/klever/proxy/proxy.go(2 hunks)clients/klever/proxy/proxy_test.go(1 hunks)cmd/bridge/config/config.toml(1 hunks)cmd/bridge/main.go(5 hunks)cmd/migration/config/config-mainnet-bsc.toml(1 hunks)cmd/migration/config/config-mainnet-eth.toml(1 hunks)cmd/migration/config/config.toml(1 hunks)cmd/migration/main.go(3 hunks)cmd/scCallsExecutor/config/config.toml(2 hunks)cmd/scCallsExecutor/flags.go(1 hunks)cmd/scCallsExecutor/main.go(2 hunks)config/config.go(2 hunks)config/tomlConfigs_test.go(13 hunks)core/batchProcessor/batchProcessor.go(3 hunks)core/batchProcessor/batchProcessor_test.go(6 hunks)core/constants.go(2 hunks)docker/scCallsExecutor-docker-compose.yml(1 hunks)executors/ethereum/bridgeV2Wrappers/ethereumChainWrapper_test.go(1 hunks)executors/ethereum/errors.go(1 hunks)executors/ethereum/interface.go(1 hunks)executors/ethereum/migrationBatchCreator.go(5 hunks)executors/ethereum/migrationBatchCreator_test.go(7 hunks)executors/kc/errors.go(1 hunks)executors/kc/filters/pendingOperationFilter.go(8 hunks)executors/kc/filters/pendingOperationFilter_test.go(7 hunks)executors/kc/interface.go(2 hunks)executors/kc/module/scCallsModule.go(3 hunks)executors/kc/module/scCallsModule_test.go(2 hunks)executors/kc/scCallsExecutor.go(1 hunks)executors/kc/scCallsExecutor_test.go(11 hunks)factory/ethKcBridgeComponents.go(17 hunks)factory/ethKcBridgeComponents_test.go(1 hunks)integrationTests/broadcaster/broadcaster_test.go(1 hunks)integrationTests/mock/tokensRegistryMock.go(4 hunks)integrationTests/relayers/ethToKc_test.go(15 hunks)integrationTests/relayers/kcToEth_test.go(10 hunks)integrationTests/relayers/slowTests/common.go(5 hunks)integrationTests/relayers/slowTests/edgeCases_test.go(2 hunks)integrationTests/relayers/slowTests/ethToKcWithChainSimulator_test.go(9 hunks)integrationTests/relayers/slowTests/framework/address.go(3 hunks)integrationTests/relayers/slowTests/framework/bridgeComponents.go(2 hunks)integrationTests/relayers/slowTests/framework/chainSimulatorWrapper.go(11 hunks)integrationTests/relayers/slowTests/framework/common.go(1 hunks)integrationTests/relayers/slowTests/framework/ethereumHandler.go(3 hunks)integrationTests/relayers/slowTests/framework/interface.go(2 hunks)integrationTests/relayers/slowTests/framework/kcHandler.go(38 hunks)integrationTests/relayers/slowTests/framework/keys.go(8 hunks)integrationTests/relayers/slowTests/framework/testSetup.go(15 hunks)integrationTests/relayers/slowTests/framework/tokensRegistry.go(2 hunks)integrationTests/relayers/slowTests/framework/types.go(2 hunks)integrationTests/relayers/slowTests/refundWithChainSimulator_test.go(13 hunks)integrationTests/relayers/slowTests/startsFromEthereumEdgecaseFlow.go(1 hunks)integrationTests/relayers/slowTests/startsFromEthereumFlow.go(1 hunks)integrationTests/relayers/slowTests/startsFromKcFlow.go(1 hunks)integrationTests/relayers/slowTests/startsFromMultiversxFlow.go(0 hunks)integrationTests/testscommon.go(1 hunks)p2p/broadcaster.go(4 hunks)p2p/broadcaster_test.go(4 hunks)p2p/errors.go(1 hunks)p2p/interface.go(1 hunks)parsers/errors.go(1 hunks)parsers/kcCodec.go(5 hunks)parsers/kcCodec_test.go(8 hunks)parsers/types.go(1 hunks)parsers/types_test.go(3 hunks)scCallsExecutor.Dockerfile(2 hunks)testsCommon/addressGenerators.go(2 hunks)testsCommon/balanceValidatorStub.go(1 hunks)testsCommon/bridge/bridgeExecutorStub.go(8 hunks)testsCommon/bridge/kcClientStub.go(22 hunks)testsCommon/kcCodecStub.go(3 hunks)testsCommon/roleProviders/kcRoleProviderStub.go(1 hunks)testsCommon/testKcCodec.go(4 hunks)
💤 Files with no reviewable changes (2)
- bridges/ethMultiversX/constants.go
- integrationTests/relayers/slowTests/startsFromMultiversxFlow.go
🧰 Additional context used
🧬 Code Graph Analysis (65)
bridges/ethKc/steps/kcToEth/step04PerformTransfer_test.go (2)
core/types.go (1)
StepIdentifier(9-9)bridges/ethKc/steps/kcToEth/constants.go (1)
ResolvingSetStatusOnKc(20-20)
executors/ethereum/migrationBatchCreator_test.go (3)
executors/ethereum/interface.go (1)
KlvDataGetter(32-36)testsCommon/bridge/dataGetterStub.go (1)
DataGetterStub(8-13)executors/ethereum/migrationBatchCreator.go (1)
NewMigrationBatchCreator(39-60)
bridges/ethKc/steps/kcToEth/step04PerformTransfer.go (1)
bridges/ethKc/steps/kcToEth/constants.go (2)
GettingPendingBatchFromKc(5-5)ResolvingSetStatusOnKc(20-20)
bridges/ethKc/steps/kcToEth/step08SignProposedSetStatus_test.go (1)
bridges/ethKc/constants.go (1)
InvalidActionID(8-8)
integrationTests/broadcaster/broadcaster_test.go (2)
integrationTests/testscommon.go (3)
Log(21-21)TestKeyGenerator(25-25)TestSingleSigner(28-28)p2p/interface.go (1)
KcRoleProvider(28-31)
integrationTests/relayers/slowTests/framework/bridgeComponents.go (1)
integrationTests/relayers/slowTests/framework/address.go (1)
KlvAddress(12-17)
bridges/ethKc/steps/ethToKc/stepsFactory_test.go (1)
bridges/ethKc/errors.go (1)
ErrNilExecutor(27-27)
bridges/ethKc/steps/kcToEth/step02SignProposedTransfer.go (1)
bridges/ethKc/steps/kcToEth/constants.go (1)
GettingPendingBatchFromKc(5-5)
executors/kc/scCallsExecutor_test.go (4)
executors/kc/scCallsExecutor.go (1)
ArgsScCallExecutor(35-49)testsCommon/interactors/proxyStub.go (1)
ProxyStub(13-25)executors/kc/interface.go (1)
Codec(26-30)testsCommon/kcCodecStub.go (1)
KcCodecStub(6-9)
bridges/ethKc/steps/kcToEth/step02SignProposedTransfer_test.go (2)
core/types.go (1)
StepIdentifier(9-9)bridges/ethKc/steps/kcToEth/constants.go (1)
GettingPendingBatchFromKc(5-5)
integrationTests/relayers/slowTests/edgeCases_test.go (2)
integrationTests/relayers/slowTests/framework/kcHandler.go (1)
KcHandler(86-101)integrationTests/relayers/slowTests/framework/ethereumHandler.go (1)
EthereumHandler(48-63)
bridges/ethKc/steps/kcToEth/stepsFactory.go (3)
bridges/ethKc/steps/interface.go (1)
Executor(14-66)core/types.go (1)
MachineStates(12-12)bridges/ethKc/errors.go (2)
ErrNilExecutor(27-27)ErrDuplicatedStepIdentifier(30-30)
bridges/ethKc/steps/kcToEth/step03WaitForQuorumOnTransfer.go (1)
bridges/ethKc/steps/kcToEth/constants.go (1)
GettingPendingBatchFromKc(5-5)
bridges/ethKc/steps/kcToEth/step07ProposeSetStatus.go (2)
bridges/ethKc/steps/kcToEth/constants.go (3)
GettingPendingBatchFromKc(5-5)SigningProposedSetStatusOnKc(26-26)ProposingSetStatusOnKc(23-23)core/types.go (1)
StepIdentifier(9-9)
testsCommon/balanceValidatorStub.go (2)
clients/klever/blockchain/address/interfaces.go (1)
Address(3-10)core/batchProcessor/batchProcessor.go (1)
Direction(11-11)
clients/klever/client_test.go (2)
core/constants.go (3)
MetricKcClientStatus(67-67)MetricLastKcClientError(70-70)MetricLastBlockNonce(79-79)testsCommon/statusHandlerMock.go (1)
StatusHandlerMock(10-15)
bridges/ethKc/steps/kcToEth/stepsFactory_test.go (1)
bridges/ethKc/errors.go (1)
ErrNilExecutor(27-27)
testsCommon/testKcCodec.go (1)
parsers/types.go (1)
CallData(13-18)
clients/ethereum/client_test.go (4)
testsCommon/addressGenerators.go (2)
CreateRandomKcAddress(19-26)CreateRandomEthereumAddress(11-16)core/batchProcessor/batchProcessor.go (1)
ExtractListKlvToEth(32-54)core/constants.go (2)
MetricKcClientStatus(67-67)MetricLastKcClientError(70-70)testsCommon/statusHandlerMock.go (1)
StatusHandlerMock(10-15)
bridges/ethKc/steps/kcToEth/step10PerformSetStatus.go (1)
bridges/ethKc/steps/kcToEth/constants.go (1)
GettingPendingBatchFromKc(5-5)
bridges/ethKc/steps/ethToKc/step01GetPending_test.go (3)
clients/klever/blockchain/address/interfaces.go (1)
Address(3-10)core/batchProcessor/batchProcessor.go (1)
Direction(11-11)bridges/ethKc/steps/ethToKc/constants.go (1)
ProposingTransferOnKc(8-8)
bridges/ethKc/steps/ethToKc/step03SignProposedTransfer_test.go (4)
bridges/ethKc/constants.go (1)
InvalidActionID(8-8)core/batch.go (1)
TransferBatch(14-19)core/types.go (1)
StepIdentifier(9-9)bridges/ethKc/steps/ethToKc/constants.go (1)
SigningProposedTransferOnKc(11-11)
bridges/ethKc/steps/kcToEth/step06ResolveSetStatus_test.go (3)
core/batch.go (1)
TransferBatch(14-19)core/types.go (1)
StepIdentifier(9-9)bridges/ethKc/steps/kcToEth/constants.go (1)
ProposingSetStatusOnKc(23-23)
testsCommon/addressGenerators.go (1)
clients/klever/blockchain/address/interfaces.go (1)
Address(3-10)
bridges/ethKc/steps/ethToKc/step04WaitForQuorum.go (1)
bridges/ethKc/steps/ethToKc/constants.go (1)
GettingPendingBatchFromEthereum(5-5)
p2p/broadcaster.go (3)
p2p/interface.go (3)
NetMessenger(12-25)KcRoleProvider(28-31)SignatureProcessor(34-37)core/types.go (1)
BroadcastClient(44-48)p2p/errors.go (1)
ErrNilKcRoleProvider(21-21)
bridges/ethKc/steps/ethToKc/step02ProposeTransfer_test.go (3)
core/batch.go (1)
TransferBatch(14-19)core/types.go (1)
StepIdentifier(9-9)bridges/ethKc/steps/ethToKc/constants.go (1)
SigningProposedTransferOnKc(11-11)
bridges/ethKc/steps/ethToKc/step03SignProposedTransfer.go (2)
bridges/ethKc/steps/ethToKc/constants.go (2)
GettingPendingBatchFromEthereum(5-5)SigningProposedTransferOnKc(11-11)bridges/ethKc/constants.go (1)
InvalidActionID(8-8)
integrationTests/relayers/slowTests/startsFromEthereumFlow.go (2)
integrationTests/relayers/slowTests/framework/types.go (1)
TestTokenParams(49-54)integrationTests/relayers/slowTests/framework/testSetup.go (1)
LogStepMarker(21-21)
integrationTests/relayers/slowTests/startsFromEthereumEdgecaseFlow.go (4)
integrationTests/relayers/slowTests/framework/types.go (1)
TestTokenParams(49-54)integrationTests/relayers/slowTests/framework/testSetup.go (1)
LogStepMarker(21-21)integrationTests/relayers/slowTests/framework/ethereumHandler.go (1)
EthereumHandler(48-63)integrationTests/relayers/slowTests/framework/kcHandler.go (1)
KcHandler(86-101)
bridges/ethKc/steps/kcToEth/step09WaitForQuorumOnSetStatus.go (1)
bridges/ethKc/steps/kcToEth/constants.go (1)
GettingPendingBatchFromKc(5-5)
clients/klever/client.go (1)
core/constants.go (2)
MetricKcClientStatus(67-67)MetricLastKcClientError(70-70)
integrationTests/relayers/slowTests/framework/keys.go (1)
integrationTests/relayers/slowTests/framework/address.go (2)
KlvAddress(12-17)NewKlvAddressFromBytes(20-34)
clients/klever/mappers/mappers_test.go (4)
clients/klever/mappers/erc20ToKc.go (1)
NewErc20ToKcMapper(17-25)clients/errors.go (1)
ErrNilDataGetter(10-10)testsCommon/bridge/dataGetterStub.go (1)
DataGetterStub(8-13)clients/klever/mappers/kcToErc20.go (1)
NewKcToErc20Mapper(17-25)
clients/klever/mappers/kcToErc20.go (1)
clients/errors.go (1)
ErrNilDataGetter(10-10)
core/batchProcessor/batchProcessor.go (2)
clients/klever/blockchain/address/interfaces.go (1)
Address(3-10)core/batch.go (1)
TransferBatch(14-19)
bridges/ethKc/steps/kcToEth/step08SignProposedSetStatus.go (3)
bridges/ethKc/steps/kcToEth/constants.go (3)
GettingPendingBatchFromKc(5-5)WaitingForQuorumOnSetStatus(29-29)SigningProposedSetStatusOnKc(26-26)bridges/ethKc/constants.go (1)
InvalidActionID(8-8)core/types.go (1)
StepIdentifier(9-9)
parsers/kcCodec_test.go (1)
parsers/kcCodec.go (1)
KcCodec(17-18)
clients/klever/mappers/erc20ToKc.go (1)
clients/errors.go (1)
ErrNilDataGetter(10-10)
core/batchProcessor/batchProcessor_test.go (1)
core/batchProcessor/batchProcessor.go (2)
ExtractListEthToKlv(58-80)ExtractListKlvToEth(32-54)
testsCommon/bridge/kcClientStub.go (1)
core/batch.go (1)
TransferBatch(14-19)
bridges/ethKc/steps/ethToKc/step02ProposeTransfer.go (2)
bridges/ethKc/steps/ethToKc/constants.go (3)
GettingPendingBatchFromEthereum(5-5)SigningProposedTransferOnKc(11-11)ProposingTransferOnKc(8-8)core/types.go (1)
StepIdentifier(9-9)
clients/ethereum/client.go (1)
core/constants.go (2)
MetricKcClientStatus(67-67)MetricLastKcClientError(70-70)
p2p/broadcaster_test.go (4)
p2p/interface.go (2)
KcRoleProvider(28-31)SignatureProcessor(34-37)testsCommon/roleProviders/kcRoleProviderStub.go (1)
KleverRoleProviderStub(8-10)p2p/broadcaster.go (1)
NewBroadcaster(55-87)p2p/errors.go (1)
ErrNilKcRoleProvider(21-21)
executors/ethereum/migrationBatchCreator.go (3)
executors/ethereum/interface.go (3)
KlvDataGetter(32-36)Erc20ContractsHolder(19-23)EthereumChainWrapper(39-50)clients/ethereum/interface.go (1)
Erc20ContractsHolder(42-46)clients/klever/blockchain/address/interfaces.go (1)
Address(3-10)
clients/balanceValidator/interface.go (1)
core/batch.go (1)
TransferBatch(14-19)
integrationTests/relayers/slowTests/framework/ethereumHandler.go (1)
integrationTests/relayers/slowTests/framework/address.go (1)
KlvAddress(12-17)
parsers/kcCodec.go (2)
parsers/types.go (1)
ProxySCCompleteCallData(21-28)clients/klever/blockchain/address/address.go (1)
NewAddressFromBytes(25-43)
config/tomlConfigs_test.go (1)
config/config.go (1)
PendingOperationsFilterConfig(184-191)
integrationTests/relayers/slowTests/startsFromKcFlow.go (4)
integrationTests/relayers/slowTests/framework/testSetup.go (2)
TestSetup(30-48)LogStepMarker(21-21)integrationTests/relayers/slowTests/framework/types.go (1)
TestTokenParams(49-54)integrationTests/relayers/slowTests/framework/ethereumHandler.go (1)
EthereumHandler(48-63)integrationTests/relayers/slowTests/framework/kcHandler.go (1)
KcHandler(86-101)
bridges/ethKc/steps/kcToEth/step06ResolveSetStatus.go (4)
bridges/ethKc/steps/kcToEth/constants.go (3)
GettingPendingBatchFromKc(5-5)ProposingSetStatusOnKc(23-23)ResolvingSetStatusOnKc(20-20)clients/errors.go (1)
ErrNoPendingBatchAvailable(37-37)core/types.go (1)
StepIdentifier(9-9)core/batch.go (1)
TransferBatch(14-19)
bridges/ethKc/interface.go (2)
clients/klever/blockchain/address/interfaces.go (1)
Address(3-10)core/batchProcessor/batchProcessor.go (1)
Direction(11-11)
bridges/ethKc/steps/kcToEth/step01GetPending_test.go (4)
core/batch.go (1)
TransferBatch(14-19)core/batchProcessor/batchProcessor.go (1)
Direction(11-11)core/types.go (1)
StepIdentifier(9-9)bridges/ethKc/steps/kcToEth/constants.go (1)
ResolvingSetStatusOnKc(20-20)
integrationTests/mock/tokensRegistryMock.go (2)
clients/klever/blockchain/address/interfaces.go (1)
Address(3-10)integrationTests/testscommon.go (1)
Log(21-21)
bridges/ethKc/steps/kcToEth/step07ProposeSetStatus_test.go (2)
core/types.go (1)
StepIdentifier(9-9)bridges/ethKc/steps/kcToEth/constants.go (1)
SigningProposedSetStatusOnKc(26-26)
testsCommon/kcCodecStub.go (1)
parsers/types.go (1)
ProxySCCompleteCallData(21-28)
bridges/ethKc/steps/ethToKc/semiIntegrated_test.go (1)
core/types.go (1)
StepIdentifier(9-9)
bridges/ethKc/steps/interface.go (3)
core/batch.go (1)
TransferBatch(14-19)clients/klever/blockchain/address/interfaces.go (1)
Address(3-10)core/batchProcessor/batchProcessor.go (1)
Direction(11-11)
bridges/ethKc/bridgeExecutor_test.go (10)
testsCommon/bridge/kcClientStub.go (1)
KcClientStub(14-43)testsCommon/bridge/ethereumClientStub.go (1)
EthereumClientStub(14-32)bridges/ethKc/interface.go (2)
TopologyProvider(70-73)BalanceValidator(83-86)testsCommon/bridge/topologyProviderStub.go (1)
TopologyProviderStub(4-6)testsCommon/statusHandlerMock.go (1)
NewStatusHandlerMock(18-24)testsCommon/balanceValidatorStub.go (1)
BalanceValidatorStub(12-14)bridges/ethKc/bridgeExecutor.go (1)
NewBridgeExecutor(63-71)core/batch.go (1)
TransferBatch(14-19)bridges/ethKc/constants.go (1)
InvalidActionID(8-8)core/batchProcessor/batchProcessor.go (2)
FromKc(15-15)Direction(11-11)
integrationTests/relayers/slowTests/framework/address.go (2)
clients/klever/blockchain/address/interfaces.go (1)
Address(3-10)clients/klever/blockchain/address/address.go (2)
NewAddressFromBytes(25-43)NewAddress(59-80)
integrationTests/relayers/slowTests/framework/interface.go (1)
integrationTests/relayers/slowTests/framework/address.go (1)
KlvAddress(12-17)
clients/klever/klvClientDataGetter_test.go (5)
clients/klever/proxy/interface.go (1)
Proxy(12-23)clients/klever/proxy/models/entity.go (1)
Proxy(10-10)testsCommon/interactors/proxyStub.go (1)
ProxyStub(13-25)clients/klever/proxy/models/vmValues.go (2)
VmValueRequest(29-35)VmValuesResponseData(8-10)clients/klever/blockchain/address/interfaces.go (1)
Address(3-10)
integrationTests/relayers/slowTests/framework/chainSimulatorWrapper.go (2)
integrationTests/relayers/slowTests/framework/address.go (2)
KlvAddress(12-17)NewKlvAddressFromBech32(37-47)clients/klever/blockchain/address/interfaces.go (1)
Address(3-10)
bridges/ethKc/bridgeExecutor.go (6)
bridges/ethKc/interface.go (2)
TopologyProvider(70-73)BalanceValidator(83-86)core/batch.go (1)
TransferBatch(14-19)core/constants.go (1)
MetricNumBatches(38-38)bridges/ethKc/constants.go (1)
InvalidActionID(8-8)core/batchProcessor/batchProcessor.go (2)
ExtractListKlvToEth(32-54)Direction(11-11)clients/klever/blockchain/address/interfaces.go (1)
Address(3-10)
testsCommon/bridge/bridgeExecutorStub.go (3)
core/batch.go (1)
TransferBatch(14-19)clients/klever/blockchain/address/interfaces.go (1)
Address(3-10)core/batchProcessor/batchProcessor.go (1)
Direction(11-11)
🪛 LanguageTool
README.md
[uncategorized] ~21-~21: This verb may not be in the correct form. Consider using a different form for this context.
Context: ... Contribution Thank you for considering to help out with the source code! We welcome co...
(AI_EN_LECTOR_REPLACEMENT_VERB_FORM)
[grammar] ~23-~23: Probable usage error. Use “and” after ‘both’.
Context: ...can make both your efforts much lighter as well as our review and merge procedures quick a...
(BOTH_AS_WELL_AS)
🔇 Additional comments (135)
executors/kc/errors.go (1)
1-1: Package rename to align with branding.The package is correctly renamed from
kleverchaintokc, matching the new directory and branding standards.bridges/ethKc/converters.go (1)
1-1: Approve package rename.The package declaration has been updated to
ethKc, consistent with the repository's new naming conventions.bridges/ethKc/steps/kcToEth/step03WaitForQuorumOnTransfer_test.go (1)
1-1: Approve package rename.
packagehas been updated tokctoeth, aligning with the Klever Blockchain-to-Ethereum bridge context.bridges/ethKc/signaturesHolder.go (1)
1-1: Approve package rename.The package is correctly renamed to
ethKc, aligning with other bridge components.bridges/ethKc/signaturesHolder_test.go (1)
1-1: Approve package rename.The test package has been updated to
ethKc, ensuring consistency with the implementation code.executors/kc/scCallsExecutor.go (1)
1-1: Consistent package renaming.The package declaration has been updated to
kc, aligning with the new Klever Blockchain branding. No functional impact.bridges/ethKc/steps/kcToEth/step05WaitTransferConfirmation_test.go (1)
1-1: Align test package tokctoeth.The package declaration now matches the directory structure and new naming conventions.
testsCommon/roleProviders/kcRoleProviderStub.go (1)
7-7: Update stub comment forKleverRoleProviderStub.The struct comment has been updated to reflect the new
KleverRoleProviderStubname, ensuring consistency.integrationTests/relayers/slowTests/framework/common.go (1)
12-12: Update Bech32 prefix toklv.The pubkey converter now uses the
"klv"prefix, aligning integration tests with the Klever Blockchain environment..github/ISSUE_TEMPLATE/feature.md (1)
3-3: Rebrand issue template toklv-bridge-eth-go.The
aboutfield now referencesklv-bridge-eth-go, matching the project’s new name..github/ISSUE_TEMPLATE/bug-report.md (1)
3-3: Approve renaming in issue templateThe reference to
klv-bridge-eth-gocorrectly replaces the old project slug.#!/bin/bash # Search for any leftover "multiversx" references across the repository rg -i multiversxbridges/ethKc/steps/kcToEth/step05WaitTransferConfirmation.go (2)
1-1: Verify package directory alignment.The package name was updated to
kctoeth. Ensure the file path (bridges/ethKc/steps/kcToEth/step05WaitTransferConfirmation.go) matches this package name to avoid import conflicts.
6-6: Import path updated correctly.The import now references
bridges/ethKc/steps, aligning with theethKcbridge. Paths and aliases look consistent.integrationTests/testscommon.go (1)
109-109: Confirm protocol ID consistency.The
ProtocolIDwas updated from"/erd/relay/1.0.0"to"/klv/relay/1.0.0". Ensure that all peers and production configurations also use the same"/klv/relay/1.0.0"to avoid mismatches during discovery.factory/ethKcBridgeComponents_test.go (1)
264-265: Assertion looks good – keep naming consistent across tests.The new assertion on
kcToEthStatusHandlermirrors the previous check forethtoKleverStatusHandlerand keeps both directions covered.
Double-check that all other tests & production code refer to the same field name (kcToEthStatusHandler) to avoid compile-time mismatches.cmd/bridge/config/config.toml (1)
26-28: Comments updated only – no functional impact.Nothing to flag; the addresses / key paths remain unchanged.
At some point consider validating that these example Bech32 strings are still valid on the latest Klever test-net (not urgent for this PR).api/swagger/README.md (1)
3-3: Doc string reflects new branding – LGTM.Pure documentation change, no further action required.
executors/ethereum/bridgeV2Wrappers/ethereumChainWrapper_test.go (1)
266-267: Parameter rename compiles but verify stub/interface alignment.The stub now expects
batchNonceKcETH *big.Int. Ensure the generated Go bindings (abigen) and the production wrapper code use the same parameter identifier; otherwise the anonymous parameter “_” pattern might be safer for tests.clients/ethereum/wrappers/ethereumChainWrapper_test.go (1)
280-281: Consistent renaming – no logic change.Same note as above: confirm all mocks & interfaces use the new
batchNonceKcETHidentifier to prevent accidental drift..github/ISSUE_TEMPLATE/question.md (1)
3-3: Correct project reference in issue templateThe
aboutfield now accurately referencesklv-bridge-eth-go, aligning with the repository rename.README.md (2)
1-2: Project name updated in header and descriptionRenamed occurrences to
KleverBlockchainto reflect the rebranding in the main title and first paragraph.
33-33: Documentation link updatedReference to
https://docs.klever.org/correctly aligns with the Klever Blockchain branding.cmd/scCallsExecutor/config/config.toml (3)
1-1: Clear default SC proxy addressThe default
ScProxyBech32Addresshas been reset to an empty string, removing the old MultiversX address. Ensure users provide the correct Klever Blockchain proxy address or document this requirement.
11-11: Update private key file pathChanged
PrivateKeyFilefromkeys/multiversx.pemtokeys/walletKey.pem. Confirm that deployment scripts and documentation refer to the new path.
16-16: Rename filter keyRenamed
AllowedMvxAddressestoAllowedKlvAddresses. Verify that the struct field and code references are updated accordingly:#!/bin/bash # Verify config key usage rg -n "AllowedKlvAddresses" rg -n "AllowedMvxAddresses"bridges/ethKc/steps/ethToKc/stepsFactory_test.go (3)
1-1: Update package declarationPackage name updated to
ethtokcto match the new bridge directory and naming convention.
6-6: Adjust import aliasImport alias updated to
ethKcreflecting the newbridges/ethKcpath.
18-18: Update error constant referenceAssertion now checks
ethKc.ErrNilExecutor, aligning with the renamed constant inbridges/ethKc.cmd/scCallsExecutor/main.go (2)
12-12: Import path updatedThe executor import path now uses
executors/kc/moduleto reflect the renamed package structure.
51-52: CLI authorship metadata updatedUpdated
Authorsto “The Klever Blockchain Team” and contact email tocontact@klever.io.cmd/migration/config/config-mainnet-bsc.toml (1)
21-27: Renamed MultiversX section to Klever
Section[Klever]with nested[Klever.Proxy]correctly replaces the old[MultiversX]and[MultiversX.Proxy]sections. Clearing out contract addresses is expected for this environment.parsers/types_test.go (3)
28-29: Updated label from MvX to Klv
The test string now correctly references "Klv address" instead of "MvX address" for nilTovalues.
42-43: Rebranded invalid address label
Changed the expected output label to "Klv address" for invalid addresses, maintaining consistency with the Klever naming standard.
59-60: Rebranded valid address label
The valid address case now uses "Klv address" as the label, aligning the test output with the new naming convention..github/workflows/create_release.yml (1)
46-46: Adjusted archive naming prefix
The release archive name has been updated from "multiversx_eth_bridge" to "kc_eth_bridge", matching the Klever rebranding. The version, OS, and architecture concatenation format remains intact.bridges/ethKc/steps/kcToEth/step04PerformTransfer_test.go (2)
50-50: Updated subtest description to Kc context
The subtest now refers to "ResolvingSetStatusOnKc" instead of the old MultiversX identifier, reflecting the renaming.
62-62: Renamed expected step identifier to ResolvingSetStatusOnKc
The expected step constant is nowResolvingSetStatusOnKc, aligning with the updated bridge logic.bridges/ethKc/steps/kcToEth/stepsFactory_test.go (2)
6-6: Updated import alias to ethKc
Import path and alias updated fromethmultiversxtoethKc, matching the refactored package structure.
18-18: Assert error against ethKc.ErrNilExecutor
The test now correctly compareserrtoethKc.ErrNilExecutorinstead of the oldethmultiversxconstant.clients/klever/errors.go (1)
20-20: Align error naming with KDA token.
The newerrInsufficientKDABalancewith message"insufficient KDA balance"correctly reflects the token rename. Ensure all previous references toerrInsufficientESDTBalancehave been removed or updated.Run:
rg "errInsufficientESDTBalance"to confirm no lingering usage.
bridges/ethKc/errors.go (1)
14-15: Rename error for Klever client context.
The updatedErrNilKcClientwith message"nil Klever Blockchain client"aligns with the rebranding. Verify that all instantiations or error checks for the oldErrNilMultiversXClienthave been updated.Run:
rg "ErrNilMultiversXClient"to ensure no residual references.
scCallsExecutor.Dockerfile (3)
4-4: Update builder working directory.
Changed the build-stageWORKDIRfrom/multiversxto/kcto reflect the new project path. This aligns the build context with the renamed directory structure.
24-24: Set runner working directory.
ChangedWORKDIRin the runner stage to/kc. Ensure the path aligns with where the binary is copied for the entrypoint to locate./scCallsExecutor.
9-9: Adjust build context path.
Updated the secondary buildWORKDIRto/kc/cmd/scCallsExecutor, matching the relocated source. Confirm the directory structure matches this path.Run:
rg -l "cmd/scCallsExecutor" -g "Dockerfile"to verify the correct directory layout.
clients/klever/proxy/baseProxy.go (1)
40-40: Update constructor comment to reflect Klever.
The comment now reads// newBaseProxy will create a base kc proxy with cache instance. This correctly aligns with rebranding and improves clarity.cmd/migration/config/config-mainnet-eth.toml (1)
21-25: Rename and clear Klever configuration section.
The[MultiversX]section has been renamed to[Klever]and contract addresses are now empty. Ensure the configuration parser has been updated to read the new section names and that empty addresses are correctly loaded or overridden via environment variables.executors/kc/module/scCallsModule_test.go (1)
14-15: Verify that the new Bech32 prefix is accepted by the decoder
ScProxyBech32Addressnow starts withklv.
Please double-check that every Bech32/HRP validator used by the production code is already updated to recognise theklvprefix; otherwise these tests (and the module itself) will fail at runtime.A quick grep over the repo for hard-coded HRP lists is advisable.
Also applies to: 26-33
integrationTests/broadcaster/broadcaster_test.go (1)
205-215: Field rename looks consistent
MultiversXRoleProvider→KcRoleProvideraligns with the new interface inp2p/interface.go. No further issues spotted here. 👍parsers/errors.go (1)
13-14: Renamed error keeps semantics intactThe new variable name and message are consistent with the re-branding. No functional impact.
clients/balanceValidator/errors.go (1)
8-10: Rename acknowledged
ErrNilKcClientcorrectly replaces the MultiversX variant and keeps wording uniform with neighbouring errors.bridges/ethKc/steps/ethToKc/constants.go (2)
19-21: Double-checkNumStepsafter the refactor
NumStepsremains hard-coded to 5. If additional steps were introduced or removed during the rename, the constant must be updated; otherwise, the executor may prematurely stop processing or over-iterate.
7-21: I’ll broaden the search to catch any leftover “MultiversX” references:#!/bin/bash # Search for any lingering MultiversX identifiers in the codebase rg --fixed-strings 'MultiversX'bridges/ethKc/steps/ethToKc/step05PerformActionID.go (1)
1-2: Package rename looks good – remember to fix anygo:generateor tooling scriptsChanging the package to
ethtokcis consistent with the re-branding, but any code-gen directives or build scripts referencing the old path must be updated to avoid broken generators.bridges/ethKc/steps/ethToKc/step04WaitForQuorum.go (1)
17-21: EnsureProcessMaxQuorumRetriesOnKcresets its internal counterThe surrounding comment says “resetting counter”, but the method’s name suggests it only checks a limit. Confirm that the reset really happens inside the call; otherwise the step may spin forever after the first overflow.
bridges/ethKc/steps/kcToEth/step03WaitForQuorumOnTransfer.go (2)
6-9: Import path updated – check for stray MultiversX logger replacementsThe
stepsimport was correctly repointed toethKc, but the logger is still coming from
github.com/multiversx/mx-chain-logger-go.
If the project intends to completely de-brand from MultiversX, confirm that:
- The MultiversX logger module is still a hard runtime dependency you want to keep.
- A KC-namespaced fork (or a more generic logger) does not exist.
No action needed if the dependency stays, otherwise plan a follow-up PR to swap it out.
17-26: Return-step constant renamed correctly
GettingPendingBatchFromMultiversX→GettingPendingBatchFromKckeeps the FSM coherent with the new constants file.
No functional concerns spotted here. 👍bridges/ethKc/steps/kcToEth/step02SignProposedTransfer_test.go (1)
12-14: Test updated to new step identifier – looks good
initialStepnow reflects the re-branded constant. Tests remain self-contained and deterministic.p2p/errors.go (1)
20-22: ```shell
#!/bin/bashDouble-check no stale references to the old error identifier across Go files
grep -R --include='*.go' -n 'ErrNilMultiversXRoleProvider' .
</details> <details> <summary>bridges/ethKc/steps/ethToKc/stepsFactory.go (1)</summary> `14-16`: **Error constants repointed correctly** `ethKc.ErrNilExecutor` is now used instead of the MultiversX variant – consistent with the package rename. No issues found. </details> <details> <summary>testsCommon/balanceValidatorStub.go (2)</summary> `13-13`: **Consistent renaming of token parameter in stub.** The `CheckTokenCalled` function field now uses `kdaToken`, matching the interface change from `mvxToken`. --- `17-19`: **Stub's `CheckToken` method updated accordingly.** The method signature and invocation use `kdaToken`, aligning with the interface rename. </details> <details> <summary>cmd/bridge/main.go (5)</summary> `49-49`: **Updated log file prefix to reflect Klever branding.** Renaming to `"kc-eth-bridge"` ensures log files are correctly prefixed for the Klever Bridge. --- `81-82`: **Updated CLI authorship to Klever Blockchain Team.** The author name and contact email now reflect the Klever Blockchain Team. --- `258-258`: **Renamed bridge components variable for Klever.** Changing to `ethToKcComponents` and using `NewEthKleverBridgeComponents` aligns with the Klever branding. --- `270-270`: **Start call updated for Klever bridge components.** Invoking `ethToKcComponents.Start()` matches the renamed variable. --- `283-283`: **Close call updated for Klever bridge components.** Calling `ethToKcComponents.Close()` is correctly updated. </details> <details> <summary>clients/klever/client_test.go (3)</summary> `1047-1048`: **Metric keys updated to Klever context in test setup.** The calls to `SetStringMetric` now use `MetricKcClientStatus` and `MetricLastKcClientError`, aligning with renamed constants. --- `1111-1112`: **Reset logic updated to clear Klever metric keys.** Clearing `MetricKcClientStatus` and `MetricLastKcClientError` ensures tests reset correctly. --- `1117-1118`: **Assertions updated to check Klever metrics.** Using `GetStringMetric` with `MetricKcClientStatus` and `MetricLastKcClientError` matches the renamed metrics. </details> <details> <summary>executors/ethereum/interface.go (1)</summary> `31-36`: **Interface renamed for Klever Blockchain data getter.** The `MvxDataGetter` was correctly renamed to `KlvDataGetter`, and its comment updated to reflect the Klever Blockchain context. </details> <details> <summary>bridges/ethKc/steps/ethToKc/step05PerformActionID_test.go (7)</summary> `1-1`: **Package name updated for Kc steps.** The test package is correctly renamed to `ethtokc` reflecting the new directory context. --- `17-17`: **Stub method renamed for Klever check.** `WasActionPerformedOnKcCalled` replaces the MultiversX counterpart, aligning with rebranding. --- `33-33`: **Stub method renamed for Klever check.** `WasActionPerformedOnKcCalled` updated in the second test case as well. --- `49-49`: **Stub method renamed for Klever check.** The third `WasActionPerformedOnKcCalled` stub update is consistent. --- `74-74`: **Stub method renamed for Klever action.** `PerformActionOnKcCalled` replaces the original `PerformActionOnMultiversXCalled`. --- `90-90`: **Stub method renamed for Klever check.** `WasActionPerformedOnKcCalled` updated in the final test setup. --- `96-96`: **Stub method renamed for Klever action.** `PerformActionOnKcCalled` configured for the success path as expected. </details> <details> <summary>cmd/migration/config/config.toml (1)</summary> `21-26`: **Empty critical addresses – fail fast or document requirement** `MultisigContractAddress` and `SafeContractAddress` are now empty. Runtime code that expects valid, non-zero addresses will likely panic or transact with the *zero* address. Make sure that: 1. Startup validation rejects empty config values, **or** 2. The defaults are populated with placeholder but *syntactically valid* KC addresses, and 3. The README / sample configs call this out. </details> <details> <summary>bridges/ethKc/steps/ethToKc/step02ProposeTransfer_test.go (1)</summary> `110-113`: **Good catch updating the expected step identifier** The test now asserts against `SigningProposedTransferOnKc`, matching the renamed constant – 👍 </details> <details> <summary>bridges/ethKc/steps/ethToKc/step01GetPending_test.go (1)</summary> `36-40`: **Rename assertions and stub hooks LGTM** The updated stub hooks (`…FromKc`) and constant (`ProposingTransferOnKc`) align with the new naming scheme and compile cleanly. No functional issues spotted in the modified test logic. Also applies to: 55-57, 72-74, 93-98, 117-120, 144-145, 157-158, 171-172 </details> <details> <summary>bridges/ethKc/steps/kcToEth/step10PerformSetStatus_test.go (1)</summary> `14-18`: **Consistent renaming, no behavioural change** All renamed stub methods (`…OnKc`) match the updated interface and the test expectations remain intact. Looks good. Also applies to: 29-37, 53-57, 68-70, 81-90, 105-107 </details> <details> <summary>clients/ethereum/client_test.go (1)</summary> `1200-1204`: **Metric key update is correct** The move from `MetricMultiversXClientStatus`/`MetricLastMultiversXClientError` to the Klever-specific counterparts keeps the tests aligned with the production code; additional helper functions already cover the new keys. Also applies to: 1315-1322 </details> <details> <summary>bridges/ethKc/steps/kcToEth/step09WaitForQuorumOnSetStatus_test.go (4)</summary> `1-1`: **Package rename looks correct** The package rename to `kctoeth` is consistent with the wider refactor and should keep the test colocated with its source. --- `15-21`: **Stub-field names – double-check the struct update** The test now sets `ProcessQuorumReachedOnKcCalled`. Make sure the `BridgeExecutorStub` definition was renamed accordingly; otherwise the field embedding will silently be wrong and the test will compile but never override the function. Also applies to: 18-19 --- `33-36`: **Same remark for `ProcessMaxQuorumRetriesOnKcCalled`** Confirm the stub really owns this new field name. --- `48-50`: **LGTM – functional intent preserved** Behaviour-driven sub-tests remain identical; only the stub hooks were renamed. Also applies to: 66-68 </details> <details> <summary>bridges/ethKc/steps/kcToEth/step06ResolveSetStatus_test.go (1)</summary> `37-40`: **Tests updated correctly – just verify stub signature alignment** All renamed callbacks (`GetBatchFromKcCalled`, `WaitAndReturnFinalBatchStatusesCalled`, etc.) mirror production code. Please confirm the stub struct exports these exact members; otherwise the lambdas will not compile after `go vet`. Also applies to: 53-71, 72-83, 84-99, 100-127 </details> <details> <summary>parsers/kcCodec_test.go (3)</summary> `30-38`: **Nil-receiver check kept accurate** The interface-nil test still reflects the idiomatic Go pattern; no further action needed. --- `166-174`: **Error constant rename – confirm implementation** The test now expects `errBufferTooShortForKlvAddress`. Make sure `kcCodec.go` defines and returns this renamed error; otherwise the test will fail at runtime. --- `248-256`: **Good edge-case coverage** Keeping the “invalid marker” path ensures backward compatibility with unknown markers. 👍 </details> <details> <summary>bridges/ethKc/steps/kcToEth/step10PerformSetStatus.go (1)</summary> `17-23`: **Control-flow remains intact – rename looks safe** All bridge invocations were changed to `…OnKc`, and fall-back returns were updated to `GettingPendingBatchFromKc`. Logic unchanged, readability preserved. Also applies to: 35-41 </details> <details> <summary>executors/kc/module/scCallsModule.go (2)</summary> `59-66`: **Double-check secret-key decoding assumptions** `hex.DecodeString(string(encodedSk))` assumes `encodedSk` contains a hex-encoded secret key. If the PEM helper ever returns raw bytes (or base-64 / DER), this will silently mis-decode and feed garbage into `PrivateKeyFromByteArray`. Consider validating/guarding the expected format, e.g.: ```diff - kcPrivateKeyBytes, err := hex.DecodeString(string(encodedSk)) + kcPrivateKeyBytes, err := hex.DecodeString(strings.TrimSpace(string(encodedSk))) + if err == nil && len(kcPrivateKeyBytes) != ed25519.PrivateKeySize { + err = fmt.Errorf("unexpected key length: got %d, want %d", len(kcPrivateKeyBytes), ed25519.PrivateKeySize) + }or switch to the helper’s native decode if it already returns the byte slice.
69-85: LGTM on executor argument renameThe switch to
kc.ArgsScCallExecutorandparsers.KcCodec{}correctly reflects the re-branding, no other changes required.clients/klever/mappers/mappers_test.go (1)
17-38: Tests updated coherently with new namingAll mapper constructor tests now use the
Kcterminology and still validate nil checks & success paths – looks good.integrationTests/relayers/slowTests/framework/bridgeComponents.go (1)
84-86: Ensure nil-safety for Bech32()
kdaSafeAddress/kdaMultisigAddressare dereferenced without a nil check. If any caller passes nil the test will panic.
Add a quick guard or document the non-nil contract.bridges/ethKc/steps/kcToEth/step08SignProposedSetStatus_test.go (1)
31-36:expectedErrormay be undefined in this package
expectedErroris referenced but not declared in this file.
If no other file in packagekctoethdefines it, the test will not compile.#!/bin/bash # Confirm that expectedError is declared somewhere in the kctoeth test package fd --type f --extension go --exclude '*_test.go' | xargs grep -n --color -e 'var\|const\|func .*expectedError'If the search returns nothing, add
var expectedError = errors.New("test-error")close to
actionIDor import it from a common test helper.integrationTests/relayers/slowTests/edgeCases_test.go (1)
45-53: Let's broaden the search for any lingering legacy prefixes and inspect the struct definitions for JSON/YAML tags:#!/bin/bash # 1. Search for any reference to 'mvx' or 'esdt' (case‐insensitive) rg -n -I --context 2 -e 'mvx' -e 'esdt' # 2. Inspect struct definitions around KDA/KLV fields for JSON/YAML tags rg -n --context 3 'KDASafeExtraBalance' rg -n --context 3 'ValueToTransferToKlv'bridges/ethKc/steps/kcToEth/step04PerformTransfer.go (1)
20-26: Constant rename – compile-time safety check
GettingPendingBatchFromKcandResolvingSetStatusOnKcmust exist in the same package wherePerformingTransfer&WaitingTransferConfirmationare declared. If you forgot to updateconstants.go, this will not compile.#!/bin/bash # Confirm that the new constants exist rg -n --fixed-strings -e 'GettingPendingBatchFromKc' -e 'ResolvingSetStatusOnKc' bridges/ethKc/steps | headconfig/config.go (1)
187-188: ```shell
#!/bin/bashInspect PendingOperationsFilterConfig definition and its struct tags
rg -n "type PendingOperationsFilterConfig" -A8 config/config.go
</details> <details> <summary>p2p/broadcaster_test.go (1)</summary> `34-43`: **LGTM – renamed dependency injected correctly** The new field `KcRoleProvider` is constructed with a stub and passed through every test case. No functional concerns spotted here. </details> <details> <summary>integrationTests/relayers/slowTests/startsFromEthereumFlow.go (1)</summary> `15-44`: **Naming update consistent; logic unchanged** Variable and log-message renames align with the Klever migration; control flow and early-return conditions remain intact. No issues found. </details> <details> <summary>testsCommon/kcCodecStub.go (1)</summary> `5-33`: **Codec stub renaming looks good** Only identifiers were updated; behaviour is untouched. The stub still fulfils the codec interface. </details> <details> <summary>clients/klever/client.go (2)</summary> `480-497`: **Validate new proxy call & error identifier compile correctly** `GetKDATokenData` and `errInsufficientKDABalance` are newly-introduced names. Please double-check that: 1. `proxy.Proxy` exposes `GetKDATokenData(ctx, addr, token)` with the same signature used here (ctx, `address.Address`, `string`) to avoid a compile-time failure. 2. `errInsufficientKDABalance` is declared in the `clients` package (or imported) – otherwise this file will not build. If either name still uses the old “ESDT” variant elsewhere, update the interface / variable or add the missing declaration. --- `541-543`: **LGTM – metric keys updated consistently** The status handler now writes to `MetricKcClientStatus` / `MetricLastKcClientError`, which matches the renamed constants in `core/constants.go`. No further action needed. </details> <details> <summary>bridges/ethKc/steps/kcToEth/step09WaitForQuorumOnSetStatus.go (1)</summary> `17-23`: **Rename looks consistent** All method & constant names were switched from *MultiversX* to *Kc* without touching the control flow. No issues spotted. </details> <details> <summary>core/constants.go (1)</summary> `62-71`: **Metrics renamed – revisit dashboards** New constants for KC metrics are fine and added to `PersistedMetrics`. Make sure any Prometheus/Grafana dashboards or alert rules are updated to consume `klever blockchain …` metric names; otherwise they will silently break after deployment. </details> <details> <summary>clients/balanceValidator/interface.go (1)</summary> `35-35`: **Parameter prefix drift (“kdaBatchID”)** Most renames use the `klv` prefix for Klever, while this method introduces `kdaBatchID`. Check for consistency across the codebase to avoid cognitive overhead. </details> <details> <summary>bridges/ethKc/interface.go (1)</summary> `83-85`: **Parameter name changed but semantics unchanged – verify downstream callers** `CheckToken(... kdaToken []byte …)` merely renames the parameter; the behaviour is untouched. Please grep for `CheckToken(` callers to be sure they were also updated, otherwise builds will break. </details> <details> <summary>clients/ethereum/client.go (1)</summary> `425-428`: **Metric keys updated – double-check constant propagation** `MetricKcClientStatus` / `MetricLastKcClientError` look fine here, but `MetricLastBlockNonce` kept its old name. If you’re standardising metric names, decide whether `LastBlockNonce` also deserves the `Kc` prefix. </details> <details> <summary>executors/kc/filters/pendingOperationFilter.go (2)</summary> `43-45`: **Guard clause overlooks Allowed*Tokens* only path** `errNoItemsAllowed` is triggered unless *at least one* of `AllowedKlvAddresses`, `AllowedEthAddresses`, **or** `AllowedTokens` is provided. If a user intends to rely solely on `AllowedTokens` but leaves both address lists empty, the check still passes – that’s fine – but please double-check this matches the intended policy after the rename (some teams previously required at least one address list). --- `183-191`: **Order of evaluation makes “deny” truly authoritative – good job** Nice touch: you keep the “deny first, allow later” model intact after the rename. This prevents an address present in *both* lists from slipping through because of an allow wildcard. </details> <details> <summary>integrationTests/relayers/slowTests/framework/ethereumHandler.go (1)</summary> `425-433`: **`Add` receiver style is correct – ignore returned value** Good catch leaving `allowanceValue.Add(...)` without re-assignment; the method mutates the receiver so this is fine. </details> <details> <summary>parsers/kcCodec.go (1)</summary> `14-18`: **Constant renamed but comment still mentions “address length” ambiguously** `lenKlvAddress` is set to 32. Confirm this matches `address.AddressBytesLen`; if Klever ever changes encoding you’ll drift silently. Exporting the constant from the address package would remove duplication. </details> <details> <summary>integrationTests/relayers/slowTests/startsFromKcFlow.go (1)</summary> `50-59`: **Refund verification relies on _only_ Ethereum status** `areTokensFullyRefunded` checks `IsTransferDoneFromEthereumWithRefund`, but does not re-confirm the KLV side balances. Ensure the helper covers both chains; if not, add an explicit Klever check here. </details> <details> <summary>bridges/ethKc/steps/kcToEth/step06ResolveSetStatus.go (1)</summary> `37-46`: **Possible length mismatch when resolving deposit statuses** `ResolveNewDepositsStatuses(uint64(len(batch.Statuses)))` uses the length of the *freshly fetched* batch, whereas `storedBatch.Statuses` was just overwritten with the final statuses. If a fork/re-org has changed the deposit count, the two batches may diverge. Confirm that `batch` and `storedBatch` always refer to the same object; otherwise use `len(storedBatch.Statuses)` to avoid off-by-one errors. </details> <details> <summary>core/batchProcessor/batchProcessor.go (2)</summary> `14-18`: **Renaming looks correct** `Direction` constants were updated consistently (`FromKc` / `ToKc`). No functional impact – good catch-all update. --- `24-25`: **Reminder – make sure downstream code uses `KdaTokenBytes`** Every former reference to `MvxTokenBytes` must now use the new field. Please search the codebase for stale usages to avoid nil-field panics at runtime. ```shell #!/bin/bash # Search for old field names that might still be referenced rg -n "MvxTokenBytes"bridges/ethKc/steps/kcToEth/step01GetPending.go (3)
18-22: Client-availability logging message updated – goodRenamed message helps future grep’ing.
57-59: VerifyCheckAvailableTokensparameter orderThe call signature switched to
(ctx, ethTokens, kdaTokenBytes, amounts, direction).
Double-check the underlying method was adapted the same way; otherwise the wrong
slice may reach the smart-contract check.
77-80: Method naming is consistent
resetCountersOnKcaligns with the rest of the rename. No issues spotted.integrationTests/relayers/kcToEth_test.go (2)
119-120: String constant in stack-trace detector updated – make sure origin matches
"getTotalTransferAmountInPendingKlvBatches"must be the exact function name.
If the implementation differs in capitalisation or suffix (...KcBatchesvs
...KlvBatches) the balance-validator shortcut will silently stop working.
252-254: Address helper rename acknowledgedSwapping
CreateRandomMultiversXAddressforCreateRandomKcAddresskeeps the
test aligned with the new chain. Good refactor.integrationTests/relayers/slowTests/ethToKcWithChainSimulator_test.go (2)
152-166: Flow factory renamed – nice cleanup
startsFromKlvFlowand the new call sites compile cleanly.
304-316: Expected-error string changed – double-check runtime matchThe tests depend on the relayer emitting
"invalid setup isNativeOnEthereum = true, isNativeOnKc = true".
Ensure the production code produces exactly this text after the rename;
otherwise the log-observer will never fire and the test will hang.executors/ethereum/migrationBatchCreator.go (2)
40-42: Nil-check updated correctlyConstructor now guards against
nil KlvDataGetter; good migration.
179-187: Method calls updated – ensure all interface implementations renamed
creator.kdaDataGetter.GetAllKnownTokenscompiles only if every concrete
implementation has already adopted theKlvDataGettername. Re-rungo vetto
confirm.factory/ethKcBridgeComponents.go (1)
354-366: Broadcaster args mix Ethereum and Klever role providers
SignatureProcessorreceivescomponents.ethereumRoleProviderwhile the same struct also passesKcRoleProvider.
If the broadcaster internally assumes the processor matches the role provider chain, cross-chain signatures may be rejected.Please double-check the broadcaster API – if two separate providers are indeed intended, rename the arg names for clarity and add tests; otherwise pass the matching Klever role provider.
bridges/ethKc/bridgeExecutor_test.go (1)
1821-1836:kdaTokensis a slice of byte slices – merge uniqueness like ETH tokensThe ETH side is de-duplicated before validation; KDA tokens are only appended as-is, losing the symmetry:
checkedKdaTokens = append(checkedKdaTokens, kdaToken) // duplicates preservedIf the business rule intends aggregated amounts per token, apply the same coalescing logic to KDA tokens to avoid double validation calls.
integrationTests/relayers/slowTests/framework/interface.go (1)
30-46: Return-type rename incomplete – callers may still refer toGetESDTBalanceThe method was renamed to
GetKDABalance, but downstream tests & helpers may still expect the old name.
Rungo vet ./...or a project-wide grep to ensure all invocations were updated.clients/klever/klvClientDataGetter_test.go (1)
167-1573: LGTM! Consistent test function and variable renaming.All test function names and variables have been systematically updated from MultiversX/MX references to Klever/Kc equivalents. The renaming is consistent throughout the file and maintains the original test logic.
integrationTests/relayers/slowTests/framework/chainSimulatorWrapper.go (1)
34-373: LGTM! Comprehensive rebranding to Klever Blockchain.The changes correctly update all MultiversX references to Klever Blockchain equivalents:
- Constants renamed (e.g.,
thousandEgld→thousandKlv)- Mock instantiation updated to
NewKcMock()- Address prefix changed to "klv"
- Type references updated (
MvxAddress→KlvAddress)- Method names updated (
GetESDTBalance→GetKDABalance)- JSON fields updated (
erd_block_timestamp→klv_block_timestamp)All changes are consistent with the rebranding objective.
bridges/ethKc/bridgeExecutor.go (1)
1-657: LGTM! Systematic renaming from MultiversX to Klever Blockchain.The bridge executor has been comprehensively updated with consistent naming changes:
- Package renamed to
ethKc- All struct fields and methods updated to use Kc/Klv naming
- Client references updated (
MultiversXClient→KcClient)- Token parameters renamed (
mvxTokens→kdaTokens)- Batch processor calls updated (
ExtractListMvxToEth→ExtractListKlvToEth)The renaming is thorough and maintains the original functionality.
bridges/ethKc/steps/interface.go (1)
18-63: LGTM! Interface methods consistently renamed.All interface methods have been systematically updated to replace MultiversX references with Kc/Klever equivalents. The parameter rename from
mvxTokenstokdaTokensinCheckAvailableTokensis also consistent with the new naming convention.integrationTests/relayers/slowTests/framework/kcHandler.go (2)
19-19: Address the TODO for kdaSystemSCAddress.The TODO comment indicates uncertainty about the availability of the
kdaSystemSCAddress. This should be resolved before merging to ensure the system contract address is properly configured for the Klever Blockchain.
16-18: LGTM! Comprehensive handler migration to Klever Blockchain.The KcHandler has been thoroughly updated with consistent naming changes:
- Struct and method receivers renamed from MultiversxHandler to KcHandler
- Constants updated (e.g., token costs in KLV, KDA roles)
- Contract paths updated to kda variants
- All address types changed to KlvAddress
- Token operations updated to use KDA terminology
- Method names and parameters consistently renamed
The migration is systematic and maintains the original functionality.
Also applies to: 20-1068
There was a problem hiding this comment.
Actionable comments posted: 1
🔭 Outside diff range comments (1)
integrationTests/mock/ethereumChainMock.go (1)
10-14: Wrong import – breaks compilation (undefined: ethereum).
FilterLogsusesethereum.FilterQuery, but the imported root modulegithub.com/ethereum/go-ethereumexposes package namegeth, notethereum.
Import the correct sub-package instead:- "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/ethereum"(or alias it:
ethereum "github.com/ethereum/go-ethereum/ethereum").Without this change the file fails
go vet/go testwithundefined: ethereum.
🧹 Nitpick comments (1)
integrationTests/relayers/slowTests/framework/kcHandler.go (1)
37-44: Stale file paths still contain “multiversx”.
aggregatorContractPath-testdata/contracts/kda/multiversx-price-aggregator-sc.wasmand friends retain the old brand in their filenames.
Purely cosmetic, but if you plan full re-branding, consider renaming the artifacts to avoid confusion.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (20)
bridges/ethKc/bridgeExecutor.go(22 hunks)bridges/ethKc/bridgeExecutor_test.go(53 hunks)bridges/ethKc/interface.go(4 hunks)bridges/ethKc/steps/ethToKc/step03SignProposedTransfer_test.go(8 hunks)bridges/ethKc/steps/kcToEth/step08SignProposedSetStatus.go(2 hunks)clients/balanceValidator/balanceValidator.go(11 hunks)clients/balanceValidator/balanceValidator_test.go(25 hunks)clients/balanceValidator/interface.go(2 hunks)clients/klever/klvClientDataGetter.go(2 hunks)clients/klever/klvClientDataGetter_test.go(29 hunks)config/tomlConfigs_test.go(13 hunks)docker/scCallsExecutor-docker-compose.yml(1 hunks)factory/ethKcBridgeComponents.go(17 hunks)integrationTests/mock/KleverContractStateMock.go(3 hunks)integrationTests/mock/ethereumChainMock.go(2 hunks)integrationTests/relayers/kcToEth_test.go(10 hunks)integrationTests/relayers/slowTests/framework/kcHandler.go(35 hunks)integrationTests/relayers/slowTests/framework/testSetup.go(15 hunks)integrationTests/relayers/slowTests/refundWithChainSimulator_test.go(13 hunks)testsCommon/bridge/kcClientStub.go(22 hunks)
🚧 Files skipped from review as they are similar to previous changes (17)
- docker/scCallsExecutor-docker-compose.yml
- clients/klever/klvClientDataGetter.go
- testsCommon/bridge/kcClientStub.go
- bridges/ethKc/interface.go
- bridges/ethKc/steps/kcToEth/step08SignProposedSetStatus.go
- clients/balanceValidator/interface.go
- bridges/ethKc/steps/ethToKc/step03SignProposedTransfer_test.go
- integrationTests/relayers/slowTests/refundWithChainSimulator_test.go
- config/tomlConfigs_test.go
- integrationTests/relayers/kcToEth_test.go
- factory/ethKcBridgeComponents.go
- integrationTests/relayers/slowTests/framework/testSetup.go
- clients/balanceValidator/balanceValidator.go
- clients/balanceValidator/balanceValidator_test.go
- bridges/ethKc/bridgeExecutor_test.go
- clients/klever/klvClientDataGetter_test.go
- bridges/ethKc/bridgeExecutor.go
🧰 Additional context used
🪛 golangci-lint (1.64.8)
integrationTests/mock/ethereumChainMock.go
48-48: undefined: ethereum
(typecheck)
🔇 Additional comments (1)
integrationTests/mock/KleverContractStateMock.go (1)
69-70: Rename looks consistent – nothing else to do.The new callback
ProposeMultiTransferKdaBatchCalledis added and correctly triggered.Also applies to: 128-130
Summary
Since the klv-bridge-eth-go is a fork from multiversx, the naming of variables/structs and logs, are from multiversx clients, with the change to klever node, it is required to update these names accordingly to reflect the node change.
The naming changes done follow a standard where:
In code comments, it was modified to Klever Blockchain
Summary by CodeRabbit