-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Append log events for all inner transactions failure #6176
base: multiple_inner_transactions
Are you sure you want to change the base?
Conversation
…ompletedTxEventIdentifier for completed inner move balance of v3
process/transaction/shardProcess.go
Outdated
@@ -662,7 +662,12 @@ func (txProc *txProcessor) processRelayedTxV3( | |||
if check.IfNil(relayerAcnt) { | |||
return vmcommon.UserError, txProc.executingFailedTransaction(tx, relayerAcnt, process.ErrNilRelayerAccount) | |||
} | |||
err := txProc.relayedTxV3Processor.CheckRelayedTx(tx) | |||
funcName, _, err := txProc.argsParser.ParseCallData(string(tx.Data)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can't you add this check inside the relayedTxV3Process.CheckRelayedTX function?
process/transaction/shardProcess.go
Outdated
@@ -970,6 +982,10 @@ func (txProc *txProcessor) processUserTx( | |||
switch txType { | |||
case process.MoveBalance: | |||
err = txProc.processMoveBalance(userTx, acntSnd, acntDst, dstShardTxType, originalTxHash, true) | |||
isUserTxOfRelayedV3 := len(originalTx.InnerTransactions) > 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this if can be deleted and add a complete event log for each such processing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But actually the completeEventLog should be done only if destination shard is the current shard.
otherwise you may have execution on the destination shard and create another log event.
so add log event is this is intra shard only. otherwise, completeLogEvent is added by scProcessor. plus add an integration test and verify how many completeLogEvents are generated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated as suggested, only for intra shard inner tx of type move balance
if oldLogs.Address == nil { | ||
oldLogs.Address = newLog.Address | ||
} | ||
oldLogs.Events = append(oldLogs.Events, newLog.Events...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is super inefficient. until now for a hash we added the logEvent only once when all the execution was completed. Please do that here as well.
In the current format this PR is not ok.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pushed
updated the flow a bit so this only happens for failed inner intra shard transactions. The append functionality is still needed, as for failed intra shard inner transactions we don't have scrs, but only events on the big relayed tx(key = relayed tx hash).
update tx unmarshaller to support relayed v3 as well
Reasoning behind the pull request
Proposed changes
Testing procedure
Pre-requisites
Based on the Contributing Guidelines the PR author and the reviewers must check the following requirements are met:
feat
branch created?feat
branch merging, do all satellite projects have a proper tag insidego.mod
?