-
Notifications
You must be signed in to change notification settings - Fork 199
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
Link inner txs to results #6529
base: rc/v1.7.next1
Are you sure you want to change the base?
Conversation
@@ -1412,19 +1412,19 @@ func (sc *scProcessor) isCrossShardESDTTransfer(sender []byte, receiver []byte, | |||
func (sc *scProcessor) getOriginalTxHashIfIntraShardRelayedSCR( | |||
tx data.TransactionHandler, | |||
txHash []byte, |
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.
which txHash is this, is it the hash of the tx given as argument?
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 the hash of the initial SCR, which is the tx param
@@ -4083,21 +4083,24 @@ func TestProcessGetOriginalTxHashForRelayedIntraShard(t *testing.T) { | |||
scr := &smartContractResult.SmartContractResult{Value: big.NewInt(1), SndAddr: bytes.Repeat([]byte{1}, 32)} | |||
scrHash := []byte("hash") |
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.
is this a bad naming for the relay tx hash? or this really represents the scr hash?
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.
it is the hash of the provided scr
assert.Equal(t, scrHash, logHash) | ||
assert.Equal(t, scrHash, originalTxHash) |
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.
I think this check is not correct if the scrHash is indeed the hash of the scr.
Is this just a bad naming?
The originalTxHash should be the relay tx hash, or a transaction hash, not a scr hash.
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.
the check is correct, the naming of the returned value is not perfect.. renamed
📊 MultiversX Automated Test Report: View Report 🔄 Build Details:
🚀 Environment Variables:
|
Run Tests: |
@@ -15,9 +15,9 @@ require ( | |||
github.com/klauspost/cpuid/v2 v2.2.5 | |||
github.com/mitchellh/mapstructure v1.5.0 | |||
github.com/multiversx/mx-chain-communication-go v1.1.0 | |||
github.com/multiversx/mx-chain-core-go v1.2.22 | |||
github.com/multiversx/mx-chain-core-go v1.2.23-0.20241010094929-2bbea4371d73 |
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.
do not forget the proper release
@@ -4083,21 +4083,25 @@ func TestProcessGetOriginalTxHashForRelayedIntraShard(t *testing.T) { | |||
scr := &smartContractResult.SmartContractResult{Value: big.NewInt(1), SndAddr: bytes.Repeat([]byte{1}, 32)} | |||
scrHash := []byte("hash") | |||
|
|||
logHash, isRelayed := sc.getOriginalTxHashIfIntraShardRelayedSCR(scr, scrHash) | |||
logHash, originalTxHash, isRelayed := sc.getOriginalTxHashIfIntraShardRelayedSCR(scr, scrHash) |
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 actually a scrHash, not a logHash, right?
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.
might be either a scr hash or the relayed tx hash, renamed to hashForLogSave
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.
ok
// even for intra-shard sc calls | ||
if !bytes.Equal(relayedSCR.PrevTxHash, relayedSCR.OriginalTxHash) { | ||
return txHash, relayedSCR.OriginalTxHash, isRelayed | ||
|
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.
empty line can be removed
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.
deleted
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.
ok
|
||
for _, innerTx := range tx.InnerTransactions { | ||
innerTx.Epoch = tx.Epoch | ||
innerTx.Round = tx.Round |
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.
no need for the miniblockHash here?
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.
added, forgot from the last review
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.
ok
@@ -789,6 +789,20 @@ func (txProc *txProcessor) processInnerTx( | |||
|
|||
txFee := txProc.computeInnerTxFee(innerTx) | |||
|
|||
prevTxHash, err := txProc.getPrevTxHashForInnerTxOfRelayedV3(originalTxHash, innerTx) |
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 added without any flags and it might not be backwards compatible if an error occurs. Previously no error was returned here.
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.
the flag is inside getPrevTxHashForInnerTxOfRelayedV3
.. if the flag is not active yet, it will simply return originalTxHash and nil, as it is currently on devnet.. thus it should work as intended
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.
ok
@@ -1412,16 +1412,17 @@ func (sc *scProcessor) isCrossShardESDTTransfer(sender []byte, receiver []byte, | |||
func (sc *scProcessor) getOriginalTxHashIfIntraShardRelayedSCR( | |||
tx data.TransactionHandler, | |||
txHash []byte, | |||
) ([]byte, []byte, bool) { |
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.
todo: use a struct for the return values
📊 MultiversX Automated Test Report: View Report 🔄 Build Details:
🚀 Environment Variables:
|
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
?