Fix: add origin pending message field #677
Merged
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.
This PR should solve P2P issue, over the network
Related Clickup or Jira tickets : ALEPH-XXX
Self proofreading checklist
Changes
This pull request introduces the
origin
field to thepending_messages
table and updates relevant parts of the codebase to handle this new field. The changes ensure that the origin of each pending message is tracked and processed appropriately.Database Migration:
origin
to thepending_messages
table with a default value of "p2p".Model Updates:
MessageOrigin
insrc/aleph/db/models/pending_messages.py
and added theorigin
field to thePendingMessageDb
class. [1] [2]from_obj
method inPendingMessageDb
to include theorigin
parameter. [1] [2]Handler and Job Updates:
message_handler.py
to handle theorigin
field in various methods, including_publish_pending_message
,add_pending_message
, andprocess
. [1] [2] [3] [4] [5]process_pending_messages.py
andprocess_pending_txs.py
to handle theorigin
field when publishing messages to the message queue. [1] [2] [3] [4]Type and Status Updates:
origin
to theMessageProcessingResult
protocol and updated theProcessedMessage
class to handle theorigin
field. [1] [2]MessageOrigin
class inmessage_status.py
to define possible origins of messages.