Skip to content

Conversation

@coffeeavax
Copy link
Contributor

@coffeeavax coffeeavax commented Apr 18, 2023

Why this should be merged

  • Deprecates statusDB. For accepted tx, remove all consumed UTXOs in utxoDB. For other tx, remove them from txDB.
  • Remove all functions writing status and using txStatus (including uniqueTxs).

How this works

How this was tested

return txIDs, nil
}

func (s *state) RemoveRejectedTxs() error {
Copy link
Contributor

Choose a reason for hiding this comment

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

What we need to do in this PR:

  • All statuses should be removed from the database. This includes Accepted, Rejected, and Processing statuses.
  • All transactions with statuses Rejected or Processing must be removed from the database.
  • All transactions with status Accepted must have all the UTXOs consumed removed from the database.
  • Depending on the performance - we may need to batch these operations and perform them in the background.


func (s *state) rejectedTxs() ([]ids.ID, error) {
var txIDs []ids.ID
iter := s.statusDB.NewIterator()
Copy link
Contributor

Choose a reason for hiding this comment

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

creating an iterator pins a database version on disk all iterators must be Released.

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

return err
}
// find UTXOID produced by the tx
utxos := tx.UTXOs()
Copy link
Contributor

Choose a reason for hiding this comment

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

We should not be touching produced UTXOs.

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

@coffeeavax coffeeavax force-pushed the txStatus branch 2 times, most recently from 41824d2 to fa296bd Compare April 24, 2023 23:24
@coffeeavax coffeeavax marked this pull request as ready for review April 24, 2023 23:29
joshua-kim pushed a commit to joshua-kim/avalanchego that referenced this pull request Apr 28, 2023
@StephenButtolph StephenButtolph deleted the txStatus branch July 24, 2024 20:46
maru-ava pushed a commit to maru-ava/avalanchego that referenced this pull request Nov 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants