Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Append log events for all inner transactions failure #6176

Draft
wants to merge 7 commits into
base: multiple_inner_transactions
Choose a base branch
from

Conversation

sstanculeanu
Copy link
Contributor

Reasoning behind the pull request

  • only the last failed transaction was seen in the log events of a relayed v3 with multiple failed inner txs, because the original tx has was used

Proposed changes

  • now logs processor appends new logs to the old ones

Testing procedure

  • will be tested with feat branch

Pre-requisites

Based on the Contributing Guidelines the PR author and the reviewers must check the following requirements are met:

  • was the PR targeted to the correct branch?
  • if this is a larger feature that probably needs more than one PR, is there a feat branch created?
  • if this is a feat branch merging, do all satellite projects have a proper tag inside go.mod?

@@ -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))
Copy link
Contributor

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?

@@ -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
Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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...)
Copy link
Contributor

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.

Copy link
Contributor Author

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants