-
Notifications
You must be signed in to change notification settings - Fork 1k
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
refactoring #288
refactoring #288
Conversation
// if (engine.EvaluationStack.Count != 1 || !engine.EvaluationStack.Pop().GetBoolean()) return false; | ||
// } | ||
//} | ||
return true; |
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.
Remove commented code if no longer used.
neo/Network/P2P/Peer.cs
Outdated
private readonly Dictionary<IPAddress, int> ConnectedAddresses = new Dictionary<IPAddress, int>(); | ||
protected readonly Dictionary<IActorRef, IPEndPoint> ConnectedPeers = new Dictionary<IActorRef, IPEndPoint>(); | ||
protected readonly HashSet<IPEndPoint> UnconnectedPeers = new HashSet<IPEndPoint>(); | ||
//TODO: badPeers |
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.
TODO ?
neo/Network/P2P/Peer.cs
Outdated
catch { } | ||
} | ||
tcp.Tell(new Tcp.Bind(Self, new IPEndPoint(IPAddress.Any, ListenerPort), options: new[] { new Inet.SO.ReuseAddress(true) })); | ||
//TODO: Websocket |
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.
TODO?
neo/Network/RPC/RpcServer.cs
Outdated
// peerJson["address"] = peer.Address.ToString(); | ||
// peerJson["port"] = peer.Port; | ||
// unconnectedPeers.Add(peerJson); | ||
//} |
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.
Commented code / TODO
neo/Network/RPC/RpcServer.cs
Outdated
// peerJson["address"] = peer.Address.ToString(); | ||
// peerJson["port"] = peer.Port; | ||
// badPeers.Add(peerJson); | ||
//} |
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.
Commented Code / TODO
OMG, @erikzhang. |
neo/Consensus/ConsensusService.cs
Outdated
{ | ||
Log($"send perpare response"); | ||
Log($"send prepare response"); |
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 was waiting for this...aehuaheuaea
neo/Consensus/ConsensusService.cs
Outdated
} | ||
TimeSpan span = DateTime.Now - block_received_time; |
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.
Erik, let's consider a startup time here.
TimeSpan span = DateTime.Now + averageStartupTimeTimeOfKPreviousBlocks - block_received_time;
But, perhaps, not now, right? It would make harder to detect any different in this refactoring.
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.
DateTime.UtcNow please
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.
What is the difference, Sharrrgon brothers?
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.
The important thing here would be to have something unified in terms of clock and time syncing. The template has almost not so much effects.
Now we can test this PR with neo-gui and neo-cli. |
Testing are starting: NeoResearch/neo-tests@95e5e49 |
Great implementation, @erikzhang, congratulations for the concise modification. Apparently, basic functionalities are working pretty smooth. I noticed that 29 free transactions were broadcasted in a single block, perhaps, I should adjust the freemaxtransaction per block here. We gonna check it with time and verify the boundaries defined in Neo 3.0 Checking with additional features, I am getting the following errors:
|
- Microsoft.AspNetCore.ResponseCompression v2.1.1 - Microsoft.AspNetCore.Server.Kestrel v2.1.1 - Microsoft.AspNetCore.Server.Kestrel.Https v2.1.1 - Microsoft.EntityFrameworkCore.Sqlite v2.1.1 - Microsoft.Extensions.Configuration.Json v2.1.1
This is a caught exception, no problem. |
Perfect, @erikzhang, sorry for my lack of knowledge. aehuahuea Should the ports be changed to websocket? Are them necessary now? |
It's not stucked, just no print log. Now the print log function is placed inside the plugin. When you enable the plugin, you can see that the log is printed on the console. You can also modify the plugin to redirect the log to another location. |
Great work, @erikzhang. The last release can be found at https://github.com/NeoResearch/neo-tests/blob/master/releases/neo-release-2.9.0-preview-all-plugins.zip |
Yes, overall, it is cleaner code and there are some nice improvements. I have been having good results testing so far in PrivateNet. I'll be launching some nodes on TestNet and observing metrics and will report back some findings here within the next day or two. |
I'm experiencing an issue now where sometimes in my private net when I stop and start the server it starts syncing the chain from genesis block instead of continuing from the most recent persisted block in leveldb. Anyone else seen this? |
@jsolman, our node did not presented sync problems, if the "index" param is added in the config ( |
@vncoelho Erik pushed a fix to the sync issue I was mentioning two hours before your comment. |
Some transactions submitted successively via sendrawtransaction to a node running this code seem to be getting lost; the node accepts all the transactions, but after waiting multiple blocks not all of them get confirmed on the consensus nodes in my private net. I'm not sure what the problem is yet, but lets get some others testing this scenario also. In my case the consensus nodes are running 2.8.0 or less I verified the messages are being relayed from the node running this code; so this code may be fine; still not sure what is happening to the messages just yet. |
After further investigation, if I send the same 6 transactions using sendrawtransaction to the consensus node they all get confirmed without any issue. If I send them to the node running 2.9.0 and it relays them it relays them all, but only 3 or 4 out of 6 actually make it into a block. The last ones stay in the mem_pool on the 2.9.0 node getting re-verified after every block indefinitely and the consensus nodes never confirm them. I am digging deeper to figure out why they get confirmed if sent directly to the consensus node but when using sendrawtransaction to the 2.9.0 node some never will get confirmed. |
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.
Nice job
Sweet to see this merged! |
Fixing grammar. Also added a tip regarding the missing dll when trying to use neon.
Refactor the code using the actor model. (Akka.NET)
Close #282
Close neo-project/neo-node#116