FactomProject / factomd

Factom Daemon
https://www.factomprotocol.org/
Other
201 stars 92 forks source link

`pending-entries` ordering of entries #1003

Closed ilzheev closed 4 years ago

ilzheev commented 4 years ago

While polling pending-entries via Open Node, my app sometimes receives slightly different responses.

Response from 1st node:

[{entry1}, {entry2}, {entry3}, {entry4}]

Response from 2nd node:

[{entry3}, {entry4}, {entry1}, {entry2}]

I assume this happens because off using Open Node, but if it's possible to make the response the same on all nodes, it would be good for 2nd layer apps, that utilize this API call via Open Node.

WhoSoup commented 4 years ago

We debugged this together on discord and it stems from pending entries being in the processlist. The entries are not random, but rather a new entry will frequently appear in the middle of the list. This is due to pending-entries having a format of |Entries of VM1...|Entries of VM2...|Entries of VM3...|etc...|, where a new entry being assigned to VM1 will appear as if it's inserted in the middle of the slice.