feat: return tx block height info #383
Closed
+213
−56
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
addresses #380.
Includes the block where a transaction was included and the account it was executed against in the state sync response. In this PR, we include that information within the existing
AccountSummary
. A few issues arise from this though:AccountSummary
protobuf message as it's reused in other places. Hence I made a wrapper namedAccountUpdate
(similar to theNullifierUpdate
name).AccountUpdate
contains anAccountSummary
and a list ofTransactionInfo
(which in turn contains the transaction ID and block number)select_transactions_by_accounts_and_block_range
. Now it returns a mappingaccount_id => TransactionInfo
TransactionInfo
s with the fetched account summaries. This poses a new issue as some transactions might not have a matching account summary if a client with old state does a sync request (@bobbinth mentioned situation where this happens in the issue).AccountSummary
struct, one problem is that the account_id forAccountUpdate
is within the optionalAccountSummary
. So that will require to either modifyAccountSummary
, to define a new message that stores almost the same info asAccountSummary
or to embed the fields withinAccountUpdate
Note: This is a POC implementation, made so we can compare this vs. a decoupled approach.
TODO: