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

[Peristence] Fix TxIndexer to index sender and recipient transactions with height and index suffixes #677

Merged
merged 3 commits into from
Apr 14, 2023

Conversation

h5law
Copy link
Contributor

@h5law h5law commented Apr 14, 2023

Description

This PR fixes the TxIndexer so that it can index multiple transactions by sender and recipient instead of simply overwriting the previous transaction.

By adding the height and index of the index as a suffix to the key when storing the transaction bytes in the TxIndexer KVStore, we can now query all transactions sent or received by a specific address, through the TxIndexer.

Issue

Fixes N/A

Type of change

Please mark the relevant option(s):

  • New feature, functionality or library
  • Bug fix
  • Code health or cleanup
  • Major breaking change
  • Documentation
  • Other

List of changes

  • Index by Sender and Recipient with height and index suffixes

Testing

  • make develop_test; if any code changes were made
  • Docker Compose LocalNet; if any major functionality was changed or introduced
  • k8s LocalNet; if any infrastructure or configuration changes were made

Required Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added, or updated, godoc format comments on touched members (see: tip.golang.org/doc/comment)
  • I have tested my changes using the available tooling
  • I have updated the corresponding CHANGELOG

If Applicable Checklist

  • I have updated the corresponding README(s); local and/or global
  • I have added tests that prove my fix is effective or that my feature works
  • I have added, or updated, mermaid.js diagrams in the corresponding README(s)
  • I have added, or updated, documentation and mermaid.js diagrams in shared/docs/* if I updated shared/*README(s)

@h5law h5law added bug Something isn't working - expected behaviour is incorrect persistence Persistence specific changes small labels Apr 14, 2023
@h5law h5law requested a review from Olshansk April 14, 2023 03:31
@h5law h5law self-assigned this Apr 14, 2023
github-actions[bot]

This comment was marked as duplicate.

Copy link
Member

@Olshansk Olshansk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a naming change.

Good job on the smaller PRs btw. There's a time and place for small iterative once and a time and place for small once, and I think you've found the balance.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changelog validation failed with the following output:
Missing changelog in module: persistence/

Changelog verification failed. See error messages for more detail.

Please update the relevant CHANGELOG.md files and ensure they follow the correct format.

@h5law h5law requested a review from Olshansk April 14, 2023 21:30
@github-actions github-actions bot dismissed stale reviews from themself April 14, 2023 22:44

The check succeeded, dismissing the review comment.

@h5law h5law merged commit fa106f5 into main Apr 14, 2023
@h5law h5law deleted the txindexer_index_with_suffixes branch April 14, 2023 22:51
bryanchriswhite added a commit that referenced this pull request Apr 17, 2023
…p-modules

* pokt/main:
  [Peristence] Fix `TxIndexer` to index sender and recipient transactions with height and index suffixes (#677)
  Update e2e/docs/CHANGELOG.md (#681)
  Update devlog5.md (#672)
  [Infra] validator helm chart for LocalNet (#658)
  Update issue.md
bryanchriswhite added a commit that referenced this pull request Apr 17, 2023
* refactor/consolidate-p2p-modules:
  chore: update changelog
  switch to new dns introduced with helm charts
  [Consensus] Log warnings if server module is not enabled (#679)
  chore: update changelog
  add generated helm docs
  chore: update validator chart P2P hostname config
  chore: remove `use_libp2p` from validator chart
  [Peristence] Fix `TxIndexer` to index sender and recipient transactions with height and index suffixes (#677)
  Update e2e/docs/CHANGELOG.md (#681)
  Update devlog5.md (#672)
  [Infra] validator helm chart for LocalNet (#658)
  Update issue.md
bryanchriswhite added a commit that referenced this pull request Apr 17, 2023
* refactor/consolidate-p2p-modules:
  chore: update changelog
  switch to new dns introduced with helm charts
  [Consensus] Log warnings if server module is not enabled (#679)
  chore: update changelog
  add generated helm docs
  chore: update validator chart P2P hostname config
  chore: remove `use_libp2p` from validator chart
  [Peristence] Fix `TxIndexer` to index sender and recipient transactions with height and index suffixes (#677)
  Update e2e/docs/CHANGELOG.md (#681)
  Update devlog5.md (#672)
  [Infra] validator helm chart for LocalNet (#658)
  Update issue.md
h5law added a commit that referenced this pull request May 4, 2023
## Description

This PR aims to build out the RPC specification to have parity (not
backwards compatability) with the V0 RPC specification.

The OpenAPI YAML spec can be viewed
[here](https://editor.swagger.io/?url=https://raw.githubusercontent.com/pokt-network/pocket/rpc-spec-parity/rpc/v1/openapi.yaml).
This compares to the V0 spec which can be viewed
[here](https://editor.swagger.io/?url=https://raw.githubusercontent.com/pokt-network/pocket-core/staging/doc/specs/rpc-spec.yaml)

The CLI endpoints for the `v1/query` endpoints have also been
implemented


![image](https://user-images.githubusercontent.com/53987565/232327322-953d2f0a-e65f-4a60-bc63-2a88b88b4f75.png)

Not only does this PR build out the specification but it also implements
some new functionalities, laid out in the changes section below. Some
have already been covered in the PRs #676 and #677

## Issue

Fixes #628 

## Type of change

Please mark the relevant option(s):

- [x] New feature, functionality or library
- [ ] Bug fix
- [x] Code health or cleanup
- [ ] Major breaking change
- [x] Documentation
- [ ] Other

## List of changes

- Add `networkId` and `timestamp` fields to the block
- Ability to query the mempool for transactions yet to be commited to a
block
- Move the `utility/types/errors.go` file to
`shared/core/types/errors.go` to be used throughout the codebase
- Expose NO-OP functions for future implementation
- Add Protobuf files for Sessions, Relays and Challenges for future
implementations
- Build out a functional RPC server and specification with CLI endpoints

## Testing

- [x] `make develop_test`; if any code changes were made
- [x] [Docker Compose
LocalNet](https://github.com/pokt-network/pocket/blob/main/docs/development/README.md);
if any major functionality was changed or introduced
- [ ] [k8s
LocalNet](https://github.com/pokt-network/pocket/blob/main/build/localnet/README.md);
if any infrastructure or configuration changes were made


## Required Checklist

- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have added, or updated, [`godoc` format
comments](https://go.dev/blog/godoc) on touched members (see:
[tip.golang.org/doc/comment](https://tip.golang.org/doc/comment))
- [x] I have tested my changes using the available tooling
- [x] I have updated the corresponding CHANGELOG

### If Applicable Checklist

- [ ] I have updated the corresponding README(s); local and/or global
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] I have added, or updated,
[mermaid.js](https://mermaid-js.github.io) diagrams in the corresponding
README(s)
- [ ] I have added, or updated, documentation and
[mermaid.js](https://mermaid-js.github.io) diagrams in `shared/docs/*`
if I updated `shared/*`README(s)

---------

Co-authored-by: Daniel Olshansky <[email protected]>
Co-authored-by: Daniel Olshansky <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working - expected behaviour is incorrect persistence Persistence specific changes waiting-for-review
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants