-
Notifications
You must be signed in to change notification settings - Fork 201
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
State changes collector #5585
State changes collector #5585
Changes from all commits
00b54ef
75dff98
ed0f9d6
a05808d
db454f1
01d832b
49a8c8a
676a23c
39eaa54
7e6aa45
820264b
33b6daf
93c0e5b
edcbe7b
858ae75
5331072
9836fde
5bf6ee7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -209,6 +209,9 @@ func (txProc *txProcessor) ProcessTransaction(tx *transaction.Transaction) (vmco | |
txProc.pubkeyConv, | ||
) | ||
|
||
// TODO refactor to set the tx hash for the following state changes before the processing occurs | ||
defer txProc.accounts.SetTxHashForLatestStateChanges(txHash) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the defer would call this method after return, and I see processing happens before, shouldn't the set happen before the processing? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The idea was to link all the changes triggered by a tx to the txHash after the tx was executed. It can be refactored as you say, but I would do that in the next PR to avoid generating more conflicts with @ssd04's PR There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added TODO |
||
|
||
txType, dstShardTxType := txProc.txTypeHandler.ComputeTransactionType(tx) | ||
err = txProc.checkTxValues(tx, acntSnd, acntDst, false) | ||
if err != nil { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -167,6 +167,16 @@ func (r *simulationAccountsDB) GetStackDebugFirstEntry() []byte { | |
return nil | ||
} | ||
|
||
// SetTxHashForLatestStateChanges - | ||
func (r *simulationAccountsDB) SetTxHashForLatestStateChanges(txHash []byte) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this will not affect also the collected changes during processing right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, it will not affect |
||
r.originalAccounts.SetTxHashForLatestStateChanges(txHash) | ||
} | ||
|
||
// ResetStateChangesCollector - | ||
func (r *simulationAccountsDB) ResetStateChangesCollector() []state.StateChangesForTx { | ||
return nil | ||
} | ||
|
||
// Close will handle the closing of the underlying components | ||
func (r *simulationAccountsDB) Close() error { | ||
return nil | ||
|
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.
maybe we should have the state changes collected since the genesis if we only use these to export the data and index it.
Then use a flag for when we add the changes to the block.
There can also be a config flag (not enable epoch), if we want it to be exported from the node (through the outport driver) or not.
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 was refactored in the PR from Darius