-
Notifications
You must be signed in to change notification settings - Fork 100
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
ApplicationLog
- New Storage implementation
#865
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shargon here |
I need more time to review it |
It's hard to review, because there are a lot of things mixed here. Storage scheme refactoring and extensions better be separated. I'm mostly worried about API (JSON-RPC) backwards compatibility here. Do I understand correctly that in the current form there are no new APIs added, only |
@roman-khimov That is correct. Only the way things are stored, with some in additions to the command-line |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why it's reverted?
nvm i see let me change that |
This reverts commit e39c866.
@roman-khimov @shargon @superboyiii @vncoelho |
@cschuchardt88 I see that we create some Guid for storage enteies, that means that two nodes with the same data won't be able to compare the stored data (as raw), and that's a problem |
Ok, it can be changed. But can you explain more in details on what you are or need to do or the reason and what you are trying to compare. |
@shargon |
@superboyiii usually did to ensure that the storage didn't change with the changes. |
@shargon but this plugin data doesn't really matter? I thought blockchain data like |
@superboyiii you only check certains prefixes? |
I think @superboyiii only checks You know how big the database would be if i copy the data to each of these "tables"? Each one is an lookup index for the most part, each bring a different way to look up something. Because if you remember I had a private static readonly int Prefix_Id = 0x414c4f47; // Magic Code: (ALOG);
private static readonly byte Prefix_Engine = 0x18; // Engine_GUID -> ScriptHash, Message
private static readonly byte Prefix_Engine_Transaction = 0x19; // TxHash -> Engine_GUID_List
private static readonly byte Prefix_Block = 0x20; // BlockHash, Trigger -> NotifyLog_GUID_List
private static readonly byte Prefix_Notify = 0x21; // NotifyLog_GUID -> ScriptHash, EventName, StackItem_GUID_List
private static readonly byte Prefix_Contract = 0x22; // ScriptHash, TimeStamp, EventIterIndex -> txHash, Trigger, NotifyLog_GUID
private static readonly byte Prefix_Execution = 0x23; // Execution_GUID -> Data, StackItem_GUID_List
private static readonly byte Prefix_Execution_Block = 0x24; // BlockHash, Trigger -> Execution_GUID
private static readonly byte Prefix_Execution_Transaction = 0x25; // TxHash -> Execution_GUID
private static readonly byte Prefix_Transaction = 0x26; // TxHash -> NotifyLog_GUID_List
private static readonly byte Prefix_StackItem = 0xed; // StackItem_GUID -> Data |
@shargon @Jim8y This has been tested already by @superboyiii. I deleted branch by mistake cause it was on my master. So i reopened it here. |
I will review it likely the next week (working of bug fixes now). |
It's good. Let's move on. @shargon |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also tested and have been running on neocompiler for some time now.
@shargon Could you have a review on this? |
public virtual void Deserialize(ref MemoryReader reader) | ||
{ | ||
// It should be safe because it filled from a transaction's notifications. | ||
uint aLen = reader.ReadUInt32(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ReadVarInt
and WriteVarInt
in all of them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do it this way so; there is no extra byte for type of Integer
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have been running this branch for sometime without problems.
However, we need @superboyiii to re-ensure that there is not state problems and I think it is ok.
😄 My 1st PR merged! |
See PR #807
I close it by accident. Because I had it on my
master
branch 🌿With this new implementation of "ApplicationLog" you will be easier to expand the "ApplicationLog" for use in neo-node-cli and RPC. Tested with my xunit tests locally.
Note that you need to resync the whole blockchain for this new version of "ApplicationLog"
Change Log
Storage Size comparison to blockchain
Now you can use ApplicationLog in neo-cli here are the commands
Output of Command Console for ApplicationLog