Giter Site home page Giter Site logo

hyperledger / besu Goto Github PK

View Code? Open in Web Editor NEW
1.4K 56.0 729.0 80.59 MB

An enterprise-grade Java-based, Apache 2.0 licensed Ethereum client https://wiki.hyperledger.org/display/besu

Home Page: https://www.hyperledger.org/projects/besu

License: Apache License 2.0

JavaScript 0.05% Java 99.53% Shell 0.26% Dockerfile 0.02% Solidity 0.13% Smarty 0.01% Batchfile 0.01%
besu blockchain ethereum java p2p

besu's Introduction

Besu Ethereum Client

CircleCI Documentation Status CII Best Practices License Discord Twitter Follow

Download

Besu is an Apache 2.0 licensed, MainNet compatible, Ethereum client written in Java.

Useful Links

Issues

Besu issues are tracked in the github issues tab. See our guidelines for more details on searching and creating issues.

If you have any questions, queries or comments, Besu channel on Hyperledger Discord is the place to find us.

Besu Users

To install the Besu binary, follow these instructions.

Besu Developers

Development

Instructions for how to get started with developing on the Besu codebase. Please also read the wiki for more details on how to submit a pull request (PR).

Release Notes

Release Notes

Special thanks

YourKit for providing us with a free profiler open source license.

YourKit supports open source projects with innovative and intelligent tools for monitoring and profiling Java and .NET applications. YourKit is the creator of YourKit Java Profiler, YourKit .NET Profiler, and YourKit YouMonitor.

YourKit Logo

besu's People

Contributors

abdelstark avatar ahamlat avatar ajsutton avatar atoulme avatar cjhare avatar daniellehrner avatar diega avatar errorific avatar fab-10 avatar gabriel-trintinalia avatar garyschulte avatar gfukushima avatar iikirilov avatar jflo avatar jframe avatar joshuafernandes avatar lucassaldanha avatar macfarla avatar madelinemurray avatar mark-terry avatar matkt avatar matthew1001 avatar mbaxter avatar nicolasmassart avatar pinges avatar rain-on avatar ratanrsur avatar shemnon avatar siladu avatar usmansaleem avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

besu's Issues

eth_estimateGas values are too low when calling other contracts

As demonstrated [here|https://github.com/shemnon/PAN3027] when we do a call to eth_estimageGas for a transaction that will call a second contract we do not provide enough gas to handle the 63/64ths rule (where at most 63/64ths of the gas is available for the CALLed contract). Instead we simply do a diff of the charged gas and the gas limit.

We should provide some counter for such "overhead" situations, in addition to the 63/64ths rule we need to also consider SSTORE refunds. Perhaps we could track a "gasOverhead" that is calculated when a call returns and when the sstore refund is applied. This may result in too much gas estimated, but it is better than not enough gas estimated.

There may be some discussion about whether the estimate should be of actual charge gas or gas available via gasLimit, but the "in the wild" usage patterns that have been observed set the gasLimit off of the results of eth_estimateGas.

Add support and framework for "Fork+EIP" mainnet testing

There has been a lot of discussion in the ethereum testing community of testing EIPs earlier than a fully defined hard fork. The main model would be a "Fork+EIP" designation where a fork is set and one or more EIPs are applied, possibly in order.

We need to figure out a way to support this within pantheon, in full runtime mode, local reference testing, and RPC/Retesteth reference testing.

  • Identify in the genesis json what fork and what addition EIPs are activated

  • Provide some framework inside Pantheon to support these "feature flags"

  • have some way in spec creation to add new and/or revised precompiles and opcodes

  • have some ProtocolSpec level access to identify what EIPs are activated, so that "deeper" integrations and possibly existing opcodes and precompiles can check feature flags.

Improve LoadLocalDataStep performance

The current bottleneck for world state download is the LoadLocalDataStep which attempts to load the existing data for a hash from our world state. If we can improve the performance of this step our fast sync times should decrease, be less likely to need to pick a new pivot block and be faster once a new pivot block is selected.

Two possible approaches:

  1. Use the RocksDB keyMayExist method. May be able to use this just to skip nodes that definitely aren't in the database but that likely makes it slower when picking a new pivot block (as most nodes will exist and will now take two calls into the DB). If we changed the RocksDB JNI wrapper so that it could return the bytes of any value it finds in the index instead of a String version (which corrupts the value), keyMayExist may provide a significantly faster way of loading existing nodes from the database as well.

  2. Add a bloom filter to track nodes we've downloaded so we only actually request data from the world state if it's likely to exist there. Downside: adds the extra overhead of maintaining a bloom filter.

Acceptance Criteria

  • Implement a PoC for both of the approaches above and measure the improvement.

  • Fully implement approaches which significantly improve performance

Have more detailed logs while Besu sync

Some user feedback on sync process not being verbose enough tends to say that we may need some progress indicators. However, it's not easy as we can't really display the time it will take and even the real size of the chain can't be known for sure, it depends on peers. But we can display the progress compared to the best block we know, display what step Besu is executing, how fast it's processing (blocks/s)...

Remove `removed` field from LogWithMetadata

With this class moving into core, I think we should make a few additional changes:

  • Cut the removed field because this data is really context-specific and not inherent to the log itself

  • This would mean that BlockAddedEvent would need to have separate lists for added and removed logs

  • I'd also probably add some methods to Blockchain for retrieving logs with metadata since the core Blockchain can now generate these objects


Relevant comments

This would change the hash of plugin-api. Please confirm this is an acceptable change.

This could have been better worded. The LogWithMetadata that gets emitted to listeners etc. would not change. This changes where we add that field in in the generation process. From a conversation with Meredith, it seemed like a bit of an abstraction leak to do it in DefaultBlockchain where we do now

Crashing NAT detectors in k8s on GKE

Description

I have a network running on k8s with 1.4.0.
I upgraded the containers to 1.4.1 and the node crashes

2020-03-17 15:03:20.022+00:00 | main | INFO  | Besu | Starting Besu version: besu/v1.4.1/linux-x86_64/oracle_openjdk-java-11                                                                                        
2020-03-17 15:03:20.767+00:00 | main | WARN  | Besu | Permissions are disabled. Cannot enable PERM APIs when not using Permissions.                                                                                 
2020-03-17 15:03:20.851+00:00 | main | INFO  | Besu | Connecting to 1 static nodes.                                                                                                                                 
2020-03-17 15:03:22.835+00:00 | main | INFO  | KeyPairUtil | Loaded key 0xde87a32dfad460814aa616add8bc0fe73f13e19f60c4cf8c30e52fa440d39390bdd6bc5a1af24e7a1ac372599b28fadef173be5bd08b4214a4c6c9c54d3796ce from /sec
2020-03-17 15:03:22.857+00:00 | main | WARN  | Besu | Privacy is disabled. Cannot use EEA/PRIV API methods when not using Privacy.                                                                                  
2020-03-17 15:03:22.891+00:00 | main | INFO  | DatabaseMetadata | Lookup database metadata file in data directory: /data                                                                                            
2020-03-17 15:03:23.009+00:00 | main | INFO  | RocksDBKeyValueStorageFactory | Existing database detected at /data. Version 1                                                                                       
2020-03-17 15:03:29.757+00:00 | main | INFO  | ProtocolScheduleBuilder | Protocol schedule created with milestones: [ConstantinopleFix: 0]                                                                          
2020-03-17 15:03:30.275+00:00 | main | INFO  | RunnerBuilder | Detecting NAT service.                                                                                                                               
    at org.hyperledger.besu.nat.kubernetes.KubernetesNatManager.doStart(KubernetesNatManager.java:64) [besu-nat-1.4.1.jar:1.4.1]                                                                                    
    at org.hyperledger.besu.nat.core.AbstractNatManager.start(AbstractNatManager.java:89) [besu-nat-1.4.1.jar:1.4.1]                                                                                                
    at org.hyperledger.besu.nat.NatService.start(NatService.java:88) [besu-nat-1.4.1.jar:1.4.1]                                                                                                                     
    at org.hyperledger.besu.Runner.start(Runner.java:98) [besu-1.4.1.jar:1.4.1]                                                                                                                                     
    at org.hyperledger.besu.cli.BesuCommand.synchronize(BesuCommand.java:1752) [besu-1.4.1.jar:1.4.1]                                                                                                               
    at org.hyperledger.besu.cli.BesuCommand.startSynchronization(BesuCommand.java:1040) [besu-1.4.1.jar:1.4.1]                                                                                                      
    at org.hyperledger.besu.cli.BesuCommand.run(BesuCommand.java:926) [besu-1.4.1.jar:1.4.1]                                                                                                                        
    at picocli.CommandLine.executeUserObject(CommandLine.java:1769) [picocli-4.1.4.jar:4.1.4]                                                                                                                       
    at picocli.CommandLine.access$900(CommandLine.java:145) [picocli-4.1.4.jar:4.1.4]                                                                                                                               
    at picocli.CommandLine$RunLast.handle(CommandLine.java:2141) [picocli-4.1.4.jar:4.1.4]                                                                                                                          
    at picocli.CommandLine$RunLast.handle(CommandLine.java:2108) [picocli-4.1.4.jar:4.1.4]                                                                                                                          
    at picocli.CommandLine$AbstractParseResultHandler.handleParseResult(CommandLine.java:1968) [picocli-4.1.4.jar:4.1.4]                                                                                            
    at picocli.CommandLine.parseWithHandlers(CommandLine.java:2322) [picocli-4.1.4.jar:4.1.4]                                                                                                                       
    at org.hyperledger.besu.cli.util.ConfigOptionSearchAndRunHandler.handle(ConfigOptionSearchAndRunHandler.java:61) [besu-1.4.1.jar:1.4.1]                                                                         
    at org.hyperledger.besu.cli.util.ConfigOptionSearchAndRunHandler.handle(ConfigOptionSearchAndRunHandler.java:31) [besu-1.4.1.jar:1.4.1]                                                                         
    at picocli.CommandLine$AbstractParseResultHandler.handleParseResult(CommandLine.java:1968) [picocli-4.1.4.jar:4.1.4]                                                                                            
    at picocli.CommandLine.parseWithHandlers(CommandLine.java:2322) [picocli-4.1.4.jar:4.1.4]                                                                                                                       
    at org.hyperledger.besu.cli.BesuCommand.parse(BesuCommand.java:1036) [besu-1.4.1.jar:1.4.1]                                                                                                                     
    at org.hyperledger.besu.cli.BesuCommand.parse(BesuCommand.java:911) [besu-1.4.1.jar:1.4.1]                                                                                                                      
    at org.hyperledger.besu.Besu.main(Besu.java:49) [besu-1.4.1.jar:1.4.1]                                                                                                                                          
2020-03-17 15:03:31.528+00:00 | main | INFO  | NetworkRunner | Starting Network.                                                                                                                                    
2020-03-17 15:03:31.704+00:00 | nioEventLoopGroup-2-1 | INFO  | RlpxAgent | P2P RLPx agent started and listening on /0.0.0.0:30303.                                                                                 
2020-03-17 15:03:31.712+00:00 | main | INFO  | PeerDiscoveryAgent | Starting peer discovery agent on host=0.0.0.0, port=30303                                                                                       
2020-03-17 15:03:31.712+00:00 | main | INFO  | NatService | Waiting for up to 60 seconds to detect external IP address...                                                                                           
2020-03-17 15:03:31.712+00:00 | main | WARN  | NatService | Caught exception while trying to query NAT external IP address (ignoring): {}                                                                           
java.lang.NullPointerException: null                                                                                                                                                                                
    at java.util.Objects.requireNonNull(Objects.java:221) ~[?:?]                                                                                                                                                    
    at java.util.Optional.<init>(Optional.java:107) ~[?:?]                                                                                                                                                          
    at java.util.Optional.of(Optional.java:120) ~[?:?]                                                                                                                                                              
    at org.hyperledger.besu.nat.NatService.queryExternalIPAddress(NatService.java:123) [besu-nat-1.4.1.jar:1.4.1]                                                                                                   
    at org.hyperledger.besu.ethereum.p2p.discovery.PeerDiscoveryAgent.start(PeerDiscoveryAgent.java:128) [besu-p2p-1.4.1.jar:1.4.1]                                                                                 
    at org.hyperledger.besu.ethereum.p2p.network.DefaultP2PNetwork.start(DefaultP2PNetwork.java:200) [besu-p2p-1.4.1.jar:1.4.1]                                                                                     
    at org.hyperledger.besu.ethereum.p2p.network.NetworkRunner.start(NetworkRunner.java:80) [besu-p2p-1.4.1.jar:1.4.1]                                                                                              
    at org.hyperledger.besu.Runner.start(Runner.java:99) [besu-1.4.1.jar:1.4.1]                                                                                                                                     
    at org.hyperledger.besu.cli.BesuCommand.synchronize(BesuCommand.java:1752) [besu-1.4.1.jar:1.4.1]                                                                                                               
    at org.hyperledger.besu.cli.BesuCommand.startSynchronization(BesuCommand.java:1040) [besu-1.4.1.jar:1.4.1]                                                                                                      
    at org.hyperledger.besu.cli.BesuCommand.run(BesuCommand.java:926) [besu-1.4.1.jar:1.4.1]                                                                                                                        
    at picocli.CommandLine.executeUserObject(CommandLine.java:1769) [picocli-4.1.4.jar:4.1.4]                                                                                                                       
    at picocli.CommandLine.access$900(CommandLine.java:145) [picocli-4.1.4.jar:4.1.4]                                                                                                                               
    at picocli.CommandLine$RunLast.handle(CommandLine.java:2141) [picocli-4.1.4.jar:4.1.4]                                                                                                                          
    at picocli.CommandLine$RunLast.handle(CommandLine.java:2108) [picocli-4.1.4.jar:4.1.4]                                                                                                                          
    at picocli.CommandLine$AbstractParseResultHandler.handleParseResult(CommandLine.java:1968) [picocli-4.1.4.jar:4.1.4]                                                                                            
    at picocli.CommandLine.parseWithHandlers(CommandLine.java:2322) [picocli-4.1.4.jar:4.1.4]                                                                                                                       
    at org.hyperledger.besu.cli.util.ConfigOptionSearchAndRunHandler.handle(ConfigOptionSearchAndRunHandler.java:61) [besu-1.4.1.jar:1.4.1]                                                                         
    at org.hyperledger.besu.cli.util.ConfigOptionSearchAndRunHandler.handle(ConfigOptionSearchAndRunHandler.java:31) [besu-1.4.1.jar:1.4.1]                                                                         
    at picocli.CommandLine$AbstractParseResultHandler.handleParseResult(CommandLine.java:1968) [picocli-4.1.4.jar:4.1.4]                                                                                            
    at picocli.CommandLine.parseWithHandlers(CommandLine.java:2322) [picocli-4.1.4.jar:4.1.4]                                                                                                                       
    at org.hyperledger.besu.cli.BesuCommand.parse(BesuCommand.java:1036) [besu-1.4.1.jar:1.4.1]                                                                                                                     
    at org.hyperledger.besu.cli.BesuCommand.parse(BesuCommand.java:911) [besu-1.4.1.jar:1.4.1]                                                                                                                      
    at org.hyperledger.besu.Besu.main(Besu.java:49) [besu-1.4.1.jar:1.4.1]                                                                                                                                          
2020-03-17 15:03:32.012+00:00 | vert.x-eventloop-thread-1 | INFO  | VertxPeerDiscoveryAgent | Started peer discovery agent successfully, on effective host=0.0.0.0 and port=30303                                   
2020-03-17 15:03:32.019+00:00 | main | INFO  | PeerDiscoveryAgent | P2P peer discovery agent started and listening on /0.0.0.0:30303                                                                                
2020-03-17 15:03:32.182+00:00 | main | INFO  | NatService | Waiting for up to 60 seconds to detect external IP address...                                                                                           
2020-03-17 15:03:32.190+00:00 | main | WARN  | NatService | Caught exception while trying to query NAT external IP address (ignoring): {}     
java.lang.NullPointerException: null                                                                                                                                                                                
    at java.util.Objects.requireNonNull(Objects.java:221) ~[?:?]                                                                                                                                                    
    at java.util.Optional.<init>(Optional.java:107) ~[?:?]                                                                                                                                                          
    at java.util.Optional.of(Optional.java:120) ~[?:?]                                                                                                                                                              
    at org.hyperledger.besu.nat.NatService.queryExternalIPAddress(NatService.java:123) [besu-nat-1.4.1.jar:1.4.1]                                                                                                   
    at org.hyperledger.besu.ethereum.p2p.network.DefaultP2PNetwork.setLocalNode(DefaultP2PNetwork.java:371) [besu-p2p-1.4.1.jar:1.4.1]                                                                              
    at org.hyperledger.besu.ethereum.p2p.network.DefaultP2PNetwork.start(DefaultP2PNetwork.java:216) [besu-p2p-1.4.1.jar:1.4.1]                                                                                     
    at org.hyperledger.besu.ethereum.p2p.network.NetworkRunner.start(NetworkRunner.java:80) [besu-p2p-1.4.1.jar:1.4.1]                                                                                              
    at org.hyperledger.besu.Runner.start(Runner.java:99) [besu-1.4.1.jar:1.4.1]                                                                                                                                     
    at org.hyperledger.besu.cli.BesuCommand.synchronize(BesuCommand.java:1752) [besu-1.4.1.jar:1.4.1]                                                                                                               
    at org.hyperledger.besu.cli.BesuCommand.startSynchronization(BesuCommand.java:1040) [besu-1.4.1.jar:1.4.1]                                                                                                      
    at org.hyperledger.besu.cli.BesuCommand.run(BesuCommand.java:926) [besu-1.4.1.jar:1.4.1]                                                                                                                        
    at picocli.CommandLine.executeUserObject(CommandLine.java:1769) [picocli-4.1.4.jar:4.1.4]                                                                                                                       
    at picocli.CommandLine.access$900(CommandLine.java:145) [picocli-4.1.4.jar:4.1.4]                                                                                                                               
    at picocli.CommandLine$RunLast.handle(CommandLine.java:2141) [picocli-4.1.4.jar:4.1.4]                                                                                                                          
    at picocli.CommandLine$RunLast.handle(CommandLine.java:2108) [picocli-4.1.4.jar:4.1.4]                                                                                                                          
    at picocli.CommandLine$AbstractParseResultHandler.handleParseResult(CommandLine.java:1968) [picocli-4.1.4.jar:4.1.4]                                                                                            
    at picocli.CommandLine.parseWithHandlers(CommandLine.java:2322) [picocli-4.1.4.jar:4.1.4]                                                                                                                       
    at org.hyperledger.besu.cli.util.ConfigOptionSearchAndRunHandler.handle(ConfigOptionSearchAndRunHandler.java:61) [besu-1.4.1.jar:1.4.1]                                                                         
    at org.hyperledger.besu.cli.util.ConfigOptionSearchAndRunHandler.handle(ConfigOptionSearchAndRunHandler.java:31) [besu-1.4.1.jar:1.4.1]                                                                         
    at picocli.CommandLine$AbstractParseResultHandler.handleParseResult(CommandLine.java:1968) [picocli-4.1.4.jar:4.1.4]                                                                                            
    at picocli.CommandLine.parseWithHandlers(CommandLine.java:2322) [picocli-4.1.4.jar:4.1.4]                                                                                                                       
    at org.hyperledger.besu.cli.BesuCommand.parse(BesuCommand.java:1036) [besu-1.4.1.jar:1.4.1]                                                                                                                     
    at org.hyperledger.besu.cli.BesuCommand.parse(BesuCommand.java:911) [besu-1.4.1.jar:1.4.1]                                                                                                                      
    at org.hyperledger.besu.Besu.main(Besu.java:49) [besu-1.4.1.jar:1.4.1]                                                                                                                                          
2020-03-17 15:03:32.192+00:00 | main | INFO  | DefaultP2PNetwork | Enode URL enode://de87a32dfad460814aa616add8bc0fe73f13e19f60c4cf8c30e52fa440d39390bdd6bc5a1af24e7a1ac372599b28fadef173be5bd08b4214a4c6c9c54d3796c
2020-03-17 15:03:32.210+00:00 | main | INFO  | DefaultSynchronizer | Starting synchronizer.                                                                                                                         
2020-03-17 15:03:32.217+00:00 | main | INFO  | FullSyncDownloader | Start full sync.                                                                                                                                
2020-03-17 15:03:32.229+00:00 | main | INFO  | FullSyncTargetManager | No sync target, wait for peers.                                                                                                              
2020-03-17 15:03:37.314+00:00 | EthScheduler-Timer-0 | INFO  | FullSyncTargetManager | No sync target, wait for peers.                                                                                              
2020-03-17 15:03:41.787+00:00 | pool-10-thread-1 | INFO  | IbftProcessor | Shutting down IBFT event processor                                                                                                       
2020-03-17 15:03:41.797+00:00 | Thread-1 | INFO  | DefaultSynchronizer | Stopping synchronizer                                                                                                                      
2020-03-17 15:03:41.807+00:00 | Thread-1 | INFO  | NetworkRunner | Stopping Network.                                                                                                                                
2020-03-17 15:03:41.792+00:00 | main | INFO  | JsonRpcHttpService | Starting JsonRPC service on 0.0.0.0:8545                                                                                                        
2020-03-17 15:03:41.886+00:00 | Thread-1 | INFO  | EthProtocolManager | Stopping eth Subprotocol.                                                                                                                   
2020-03-17 15:03:41.904+00:00 | Thread-1 | INFO  | EthProtocolManager | eth Subprotocol stopped.                                                                                                                    
2020-03-17 15:03:41.905+00:00 | Thread-1 | INFO  | NetworkRunner | Network stopped.                                                                                                                                 
2020-03-17 15:03:41.908+00:00 | Thread-1 | INFO  | AutoTransactionLogBloomCachingService | Shutting down Auto transaction logs caching service.                                                                     
2020-03-17 15:03:41.923+00:00 | Thread-1 | INFO  | KubernetesNatManager | Stopping kubernetes NAT manager.                                                                                                          
2020-03-17 15:03:42.074+00:00 | vert.x-eventloop-thread-0 | INFO  | JsonRpcHttpService | JsonRPC service started and listening on 0.0.0.0:8545                                                                      
2020-03-17 15:03:42.078+00:00 | main | INFO  | GraphQLHttpService | Starting GraphQL HTTP service on 0.0.0.0:8547                                                                                                   
    at org.hyperledger.besu.Runner.lambda$writeBesuNetworksToFile$14(Runner.java:247) ~[besu-1.4.1.jar:1.4.1]                                                                                                       
    at java.util.Optional.ifPresent(Optional.java:183) [?:?]                                                                                                                                                        
    at org.hyperledger.besu.Runner.writeBesuNetworksToFile(Runner.java:244) [besu-1.4.1.jar:1.4.1]                                                                                                                  
    at org.hyperledger.besu.Runner.start(Runner.java:115) [besu-1.4.1.jar:1.4.1]                                                                                                                                    
    at org.hyperledger.besu.cli.BesuCommand.synchronize(BesuCommand.java:1752) [besu-1.4.1.jar:1.4.1]                                                                                                               
    at org.hyperledger.besu.cli.BesuCommand.startSynchronization(BesuCommand.java:1040) [besu-1.4.1.jar:1.4.1]                                                                                                      
    at org.hyperledger.besu.cli.BesuCommand.run(BesuCommand.java:926) [besu-1.4.1.jar:1.4.1]                                                                                                                        
    at picocli.CommandLine.executeUserObject(CommandLine.java:1769) [picocli-4.1.4.jar:4.1.4]                                                                                                                       
    at picocli.CommandLine.access$900(CommandLine.java:145) [picocli-4.1.4.jar:4.1.4]                                                                                                                               
    at picocli.CommandLine$RunLast.handle(CommandLine.java:2141) [picocli-4.1.4.jar:4.1.4]                                                                                                                          
    at picocli.CommandLine$RunLast.handle(CommandLine.java:2108) [picocli-4.1.4.jar:4.1.4]                                                                                                                          
    at picocli.CommandLine$AbstractParseResultHandler.handleParseResult(CommandLine.java:1968) [picocli-4.1.4.jar:4.1.4]                                                                                            
    at picocli.CommandLine.parseWithHandlers(CommandLine.java:2322) [picocli-4.1.4.jar:4.1.4]                                                                                                                       
    at org.hyperledger.besu.cli.util.ConfigOptionSearchAndRunHandler.handle(ConfigOptionSearchAndRunHandler.java:61) [besu-1.4.1.jar:1.4.1]                                                                         
    at org.hyperledger.besu.cli.util.ConfigOptionSearchAndRunHandler.handle(ConfigOptionSearchAndRunHandler.java:31) [besu-1.4.1.jar:1.4.1]                                                                         
    at picocli.CommandLine$AbstractParseResultHandler.handleParseResult(CommandLine.java:1968) [picocli-4.1.4.jar:4.1.4]                                                                                            
    at picocli.CommandLine.parseWithHandlers(CommandLine.java:2322) [picocli-4.1.4.jar:4.1.4]                                                                                                                       
    at org.hyperledger.besu.cli.BesuCommand.parse(BesuCommand.java:1036) [besu-1.4.1.jar:1.4.1]                                                                                                                     
    at org.hyperledger.besu.cli.BesuCommand.parse(BesuCommand.java:911) [besu-1.4.1.jar:1.4.1]                                                                                                                      
    at org.hyperledger.besu.Besu.main(Besu.java:49) [besu-1.4.1.jar:1.4.1]                                                                                                                                          
2020-03-17 15:03:42.222+00:00 | main | INFO  | NatService | Waiting for up to 60 seconds to detect external IP address...                                                                                           
2020-03-17 15:03:42.254+00:00 | main | INFO  | AutoTransactionLogBloomCachingService | Starting auto transaction log bloom caching service.                                                                         
2020-03-17 15:03:42.257+00:00 | main | ERROR | Runner | Startup failed                                                          
java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask@60807fd9[Not completed, task = java.util.concurrent.Executors$RunnableAdapter@34d9df9f[Wr
    at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2055) ~[?:?]                                                                                                   
    at org.hyperledger.besu.ethereum.eth.manager.MonitoredExecutors$CountingAbortPolicy.rejectedExecution(MonitoredExecutors.java:165) ~[besu-eth-1.4.1.jar:1.4.1]                                                  
    at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:825) ~[?:?]                                                                                                                           
    at java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute(ScheduledThreadPoolExecutor.java:340) ~[?:?]                                                                                                 
    at java.util.concurrent.ScheduledThreadPoolExecutor.schedule(ScheduledThreadPoolExecutor.java:562) ~[?:?]                                                                                                       
    at org.hyperledger.besu.ethereum.eth.manager.EthScheduler.scheduleFutureTask(EthScheduler.java:149) ~[besu-eth-1.4.1.jar:1.4.1]                                                                                 
    at org.hyperledger.besu.ethereum.api.query.AutoTransactionLogBloomCachingService.start(AutoTransactionLogBloomCachingService.java:67) ~[besu-api-1.4.1.jar:1.4.1]                                               
    at java.util.Optional.ifPresent(Optional.java:183) ~[?:?]                                                                                                                                                       
    at org.hyperledger.besu.Runner.start(Runner.java:116) [besu-1.4.1.jar:1.4.1]                                                                                                                                    
    at org.hyperledger.besu.cli.BesuCommand.synchronize(BesuCommand.java:1752) [besu-1.4.1.jar:1.4.1]                                                                                                               
    at org.hyperledger.besu.cli.BesuCommand.startSynchronization(BesuCommand.java:1040) [besu-1.4.1.jar:1.4.1]                                                                                                      
    at org.hyperledger.besu.cli.BesuCommand.run(BesuCommand.java:926) [besu-1.4.1.jar:1.4.1]                                                                                                                        
    at picocli.CommandLine.executeUserObject(CommandLine.java:1769) [picocli-4.1.4.jar:4.1.4]                                                                                                                       
    at picocli.CommandLine.access$900(CommandLine.java:145) [picocli-4.1.4.jar:4.1.4]                                                                                                                               
    at picocli.CommandLine$RunLast.handle(CommandLine.java:2141) [picocli-4.1.4.jar:4.1.4]                                                                                                                          
    at picocli.CommandLine$RunLast.handle(CommandLine.java:2108) [picocli-4.1.4.jar:4.1.4]                                                                                                                          
    at picocli.CommandLine$AbstractParseResultHandler.handleParseResult(CommandLine.java:1968) [picocli-4.1.4.jar:4.1.4]                                                                                            
    at picocli.CommandLine.parseWithHandlers(CommandLine.java:2322) [picocli-4.1.4.jar:4.1.4]                                                                                                                       
    at org.hyperledger.besu.cli.util.ConfigOptionSearchAndRunHandler.handle(ConfigOptionSearchAndRunHandler.java:61) [besu-1.4.1.jar:1.4.1]                                                                         
    at org.hyperledger.besu.cli.util.ConfigOptionSearchAndRunHandler.handle(ConfigOptionSearchAndRunHandler.java:31) [besu-1.4.1.jar:1.4.1]                                                                         
    at picocli.CommandLine$AbstractParseResultHandler.handleParseResult(CommandLine.java:1968) [picocli-4.1.4.jar:4.1.4]                                                                                            
    at picocli.CommandLine.parseWithHandlers(CommandLine.java:2322) [picocli-4.1.4.jar:4.1.4]                                                                                                                       
    at org.hyperledger.besu.cli.BesuCommand.parse(BesuCommand.java:1036) [besu-1.4.1.jar:1.4.1]                                                                                                                     
    at org.hyperledger.besu.cli.BesuCommand.parse(BesuCommand.java:911) [besu-1.4.1.jar:1.4.1]                                                                                                                      
    at org.hyperledger.besu.Besu.main(Besu.java:49) [besu-1.4.1.jar:1.4.1]                                                                                                                                          
java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask@60807fd9[Not completed, task = java.util.concurrent.Executors$RunnableAdapter@34d9df9f[Wr
<STREAM> closed

Versions (Add all that apply)

  • Software version: 1.4.1
  • Java version: Official docker container
  • Docker Version: GKE

Stop displaying the CLI help each time there's an error on startup

Currently Besu displays the entire CLI help each time there's an error on startup. This means a lot of scrolling to find the actual error message and generally isn't required.

Suggest removing and adding a message to use the --help option if you want to see the CLI help.

Profile Validation Code

Our validation code should be profiled to find possible optimizations.

Aim is to be able to run a MainNet node on an i3.large for a week without the transactions message queue backing up or dropping messages (metric: pantheon_executors_ethscheduler_transactions_queue_length_current) once these improvements are implemented. So 2 quite slow cores and 15Gb of memory, with an NVME drive.

Acceptance Criteria:

  • Profile Validation code to identify the potential bottlenecks and optimizations
  • Document possible optimizations with a rough "ROI" estimate (i.e. how likely is this to generate what benefit?)
     

Discussion

  • Adrian's comment: hash and signature recovery functions are likely bottlenecks

Re-adding a member to a onchain privacy group doesn't work

Description

When adding a member to an onchain privacy a second time, the rehydration doesn't happen and the member ends up out of sync with the privacy group.

Acceptance Criteria

  • A member can be added and removed multiple times from an onchain privacy group
    • A member can always use priv_call at any block of the group and latest (we need a consistent PrivacyGHroupHeadBlock mapping)

Steps to Reproduce (Bug)

  1. Create an onchain privacy group with member A
  2. Send a private tx to the private group
  3. Add member B to the privacy group (rehydration happens, B is in sync with the group)
  4. Remove B from the privacy group
  5. Send another private tx to the group
  6. Add B to the privacy group again (rehydration DOES NOT happen, B is out of sync with the group)

Expected behavior: A member added to a privacy group is always on sync with the privacy group

Actual behavior: A member added to a privacy group a second time ends up out of sync with the privacy group

Frequency: Always

Versions (Add all that apply)

  • Besu 1.4.1
  • Orion 1.5.0

Improve debug-level Logging

In the past few weeks, we've had several issues with misconfigured nodes that have been difficult to debug. We should add additional logging to help with debugging.

Connection-Level Misconfiguration

The connection-level misconfiguration manifests as follows:

  • A user is configuring a private network using static nodes

  • The static nodes contain the correct endpoint, but the public keys are wrong

    • This can be due to file system issues where a node can’t access the correct key and so generates a new key. This means that any enode urls referencing this node will have the wrong public key.
  • When a connection is attempted to an enode with an inaccurate public key, the crypto handshake will fail.

We can catch this case in the [ECIESHandshaker here|https://github.com/PegaSysEng/pantheon/blob/a4bb4af0dfc8ca9e7b97720aa8ef47e330d7f903/ethereum/p2p/src/main/java/tech/pegasys/pantheon/ethereum/p2p/rlpx/handshake/ecies/ECIESHandshaker.java#L208]. If this error is thrown when a the handshaker is the initiator (initiator = true), we should log a debug error like: LOG.debug(“Outbound handshake to {} failed. Static nodes configured with the wrong public key are a possible cause of this error.”, theirPubKey.getEncodedBytes())

Discovery-Level Misconfiguration

The discovery-level misconfiguration manifests as follows:

  • The bootnode enode urls are inaccurate: they contain the correct endpoint information but the wrong public key.

  • As a result, our misconfigured node will send a discovery PING to its bootnode

  • The bootnode will respond with a PONG, but because the PONG comes from a peer with a non-matching node id, we’ll ignore it.

Suggested fix:

  • If a [PONG is received|https://github.com/PegaSysEng/pantheon/blob/80f293ae7cdf43b06317957c2d37221df7d0d57f/ethereum/p2p/src/main/java/tech/pegasys/pantheon/ethereum/p2p/discovery/internal/PeerDiscoveryController.java#L315] with no corresponding match, log a debug message (possibly including the list of inflight PING messages or the list of unbonded bootnodes).

 

Display Besu effective config on startup

There's multiple ways to configure besu: CLI, env vars, config files, default values. It's not always very clear what is taken into account. Displaying the whole effective configuration values at startup would help user understand what's done and debug their config. For support it would be also very valuable as we could require the user to send this log (anonymised of course).

[Meta] Performance

Meta Epic to capture performance work not scheduled for a specific release.

libsodium with recent version should be listed as a dependency

Description

I'm trying to build with the latest Zulu OpenJDK Java 13

java --version

openjdk 13.0.2 2020-01-14
OpenJDK Runtime Environment Zulu13.29+9-CA (build 13.0.2+6-MTS)
OpenJDK 64-Bit Server VM Zulu13.29+9-CA (build 13.0.2+6-MTS, mixed mode, sharing)

git clone --recursive https://github.com/hyperledger/besu
cd besu
./gradlew build

but I'm getting errors, build is failing.

Acceptance Criteria

build failure bug

Steps to Reproduce (Bug)

on Debian Linux, installed the latest OpenJDK from Azul . com. via

sudo dpkg -i zulu*linux_amd64.deb

then tried to follow the normal install instructions for Bezu

Expected behavior: [What you expect to happen]

build success, all tests should succeed

Actual behavior: [What actually happens]

I'm seeing these deprecation warnings:

> Task :enclave:compileJava
Note: /home/locutus/installs/GBAChain_Besu/enclave/src/main/java/org/hyperledger/besu/enclave/VertxRequestTransmitter.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

> Task :nat:compileJava
Note: /home/locutus/installs/GBAChain_Besu/nat/src/main/java/org/hyperledger/besu/nat/upnp/OkHttpStreamClient.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

and build fails

Task :besu:test

org.hyperledger.besu.PrivacyReorgTest > reorgToShorterChain FAILED
    java.lang.UnsatisfiedLinkError at PrivacyReorgTest.java:140

org.hyperledger.besu.PrivacyReorgTest > reorgToLongerChain FAILED
    java.lang.UnsatisfiedLinkError at PrivacyReorgTest.java:140

org.hyperledger.besu.PrivacyReorgTest > reorgToChainAtEqualHeight FAILED
    java.lang.UnsatisfiedLinkError at PrivacyReorgTest.java:140

org.hyperledger.besu.PrivacyReorgTest > privacyGroupHeadIsTracked FAILED
    java.lang.UnsatisfiedLinkError at PrivacyReorgTest.java:140

426 tests completed, 4 failed

> Task :besu:test FAILED

FAILURE: Build failed with an exception.

What went wrong:
Execution failed for task ':besu:test'.
> There were failing tests. See the report at: ./besu/build/reports/tests/test/index.html

investigating the indext.html reveals:

java.lang.UnsatisfiedLinkError: libsodium.so: cannot open shared object file: No such file or directory

attempting to fix this via
sudo apt-get install libsodium-dev

seems to have made no effect

let's try

./gradlew build --rerun-tasks

and it still fails those 4 tests.

the index error report now reveals:

java.lang.LinkageError: Unsupported libsodium version 1.0.8 (9:1)

finally I got it to compile by finding a libsodium-dev_1.0.16-2_amd64.deb for "trusty"

Versions (Add all that apply)

  • Software version: besu/v1.4.1-dev-ad5bfecd/linux-x86_64/zulu-java-13
  • Java version: openjdk 13.0.2 2020-01-14
  • OS Name & Version: linux mint 17 Qiana

Additional Information

so, libsodium version 1.0.16 seems to be a dependency, it should be listed in dependencies

Private transaction failing due to insufficient intrinsic gas

Private transaction failing due to insufficient intrinsic gas but privacy marker transaction succeeds.

The following succeeds (private txn and privacy marker transaction). But when sent with less gas (can't remember how much less exactly) the private transaction fails but the privacy marker transaction succeeds. Sending the same payload publicly with the same amount of gas returns a not enough gas for the intrinsic cost error

{"jsonrpc":"2.0","method":"eea_sendTransaction","params":[

{ "from": "0xfe3b557e8fb62b89f4916b721be55ceb828dbd73", "gas": "0xaaaaaaaa", "gasPrice": "0x0", "data": "0x608060405234801561001057600080fd5b5060dc8061001f6000396000f3006080604052600436106049576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680633fa4f24514604e57806355241077146076575b600080fd5b348015605957600080fd5b50606060a0565b6040518082815260200191505060405180910390f35b348015608157600080fd5b50609e6004803603810190808035906020019092919050505060a6565b005b60005481565b80600081905550505600a165627a7a723058202bdbba2e694dba8fff33d9d0976df580f57bff0a40e25a46c398f8063b4c00360029", "privateFrom": "negmDcN2P4ODpqn/6WkJ02zT/0w0bjhGpkZ8UP6vARk=", "privacyGroupId": "cD636RZlcqVSpoxT/ExbkWQfBO7kPAZO0QlWHErNSL8=", "restriction": "restricted" }
], "id":1}

Investigate Periodically Committing State

We should investigate the feasibility of saving the state periodically instead at each block.

Specifically, we should determine:

  • The performance improvements resulting from this

  • Whether it is compatible with all our current APIs, especially the tracing ones

  • What are the required tasks and estimated time required to implement this feature.

Lost transactions break the test harness

The current harness uses a small number of accounts and does not attempt to repost failed transactions. Since ethereum does not allow non-consecutive noces this results in a “one goes out they all go out” problem.

  • The test harness could be adjusted to use more accounts to lessen the effect of a lost transaction

  • The test harness could be re-written to re-post unsuccessful transactions.

Probability: Occasional

Severity: Moderate

Investigate UpnpManager StreamServer message

When running pantheon with --nat-method=UPNP, I'm seeing the following message printed: "2019-07-19 15:03:14.435-04:00 | main | INFO | Router | Configuration did not create a StreamServer for: /10.1.10.39
". This message originates from the PantheonUpnpServiceConfiguration.createStreamServer().

The stack trace (retrieved by adding the line new RuntimeException()).printStackTrace(); to this method) from this method invocation is:

{{}}

java.lang.RuntimeException at tech.pegasys.pantheon.nat.upnp.PantheonUpnpServiceConfiguration.createStreamServer(PantheonUpnpServiceConfiguration.java:142) at org.jupnp.transport.RouterImpl.startAddressBasedTransports(RouterImpl.java:416) at org.jupnp.transport.RouterImpl.enable(RouterImpl.java:125) at org.jupnp.UpnpServiceImpl.startup(UpnpServiceImpl.java:258) at tech.pegasys.pantheon.nat.upnp.UpnpNatManager.start(UpnpNatManager.java:118) at tech.pegasys.pantheon.Runner.start(Runner.java:80) at tech.pegasys.pantheon.cli.PantheonCommand.synchronize(PantheonCommand.java:1205) at tech.pegasys.pantheon.cli.PantheonCommand.startSynchronization(PantheonCommand.java:753) at tech.pegasys.pantheon.cli.PantheonCommand.run(PantheonCommand.java:667) at picocli.CommandLine.execute(CommandLine.java:1160) at picocli.CommandLine.access$800(CommandLine.java:141) at picocli.CommandLine$RunLast.handle(CommandLine.java:1367) at picocli.CommandLine$RunLast.handle(CommandLine.java:1335) at picocli.CommandLine$AbstractParseResultHandler.handleParseResult(CommandLine.java:1243) at picocli.CommandLine.parseWithHandlers(CommandLine.java:1526) at tech.pegasys.pantheon.cli.util.ConfigOptionSearchAndRunHandler.handle(ConfigOptionSearchAndRunHandler.java:59) at tech.pegasys.pantheon.cli.util.ConfigOptionSearchAndRunHandler.handle(ConfigOptionSearchAndRunHandler.java:29) at picocli.CommandLine$AbstractParseResultHandler.handleParseResult(CommandLine.java:1243) at picocli.CommandLine.parseWithHandlers(CommandLine.java:1526) at tech.pegasys.pantheon.cli.PantheonCommand.parse(PantheonCommand.java:748) at tech.pegasys.pantheon.cli.PantheonCommand.parse(PantheonCommand.java:659) at tech.pegasys.pantheon.Pantheon.main(Pantheon.java:45)

Unhandled caching exception: NoSuchFileException

In my attempts to reproduce a pruning bug, I was running a ropsten sync with: besu --pruning-enabled --Xpruning-block-confirmations 0 --Xpruning-blocks-retained 1 --network=ropsten

020-02-24 15:03:35.579-03:00 | StatePruning-0 | INFO  | MarkSweepPruner | Completed sweeping unused nodes2020-02-24 15:03:35.580-03:00 | EthScheduler-Services-6 (importBlock) | INFO  | Pruner | Begin marking used nodes for pruning. Block number: 99843 State root: 0x709e1291c2c2f0629b77bd3bcb0e327b427895a15896525b195e5f77f00d928f2020-02-24 15:03:37.216-03:00 | EthScheduler-Services-6 (importBlock) | INFO  | FullImportBlockStep | Import reached block 1000002020-02-24 15:03:37.222-03:00 | EthScheduler-Computation-2 | ERROR | TransactionLogBloomCacher | Unhandled caching exception.java.nio.file.NoSuchFileException: /home/ratan/wrk/besu/build/data/caches/logBloom-current.cache -> /home/ratan/wrk/besu/build/data/caches/logBloom-1.cacheat sun.nio.fs.UnixException.translateToIOException(UnixException.java:92) ~[?:?]at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111) ~[?:?]at sun.nio.fs.UnixCopyFile.move(UnixCopyFile.java:417) ~[?:?]at sun.nio.fs.UnixFileSystemProvider.move(UnixFileSystemProvider.java:267) ~[?:?]at java.nio.file.Files.move(Files.java:1421) ~[?:?]at org.hyperledger.besu.ethereum.api.query.TransactionLogBloomCacher.populateLatestSegment(TransactionLogBloomCacher.java:184) ~[classes/:?]at java.util.concurrent.CompletableFuture$AsyncSupply.run$$$capture(CompletableFuture.java:1700) [?:?]at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java) [?:?]at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]at java.lang.Thread.run(Thread.java:834) [?:?]2020-02-24 15:03:37.222-03:00 | EthScheduler-Computation-3 | ERROR | TransactionLogBloomCacher | Unhandled caching exception.java.nio.file.NoSuchFileException: /home/ratan/wrk/besu/build/data/caches/logBloom-current.cache -> /home/ratan/wrk/besu/build/data/caches/logBloom-1.cacheat sun.nio.fs.UnixException.translateToIOException(UnixException.java:92) ~[?:?]at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111) ~[?:?]at sun.nio.fs.UnixCopyFile.move(UnixCopyFile.java:417) ~[?:?]at sun.nio.fs.UnixFileSystemProvider.move(UnixFileSystemProvider.java:267) ~[?:?]at java.nio.file.Files.move(Files.java:1421) ~[?:?]at org.hyperledger.besu.ethereum.api.query.TransactionLogBloomCacher.populateLatestSegment(TransactionLogBloomCacher.java:184) ~[classes/:?]at java.util.concurrent.CompletableFuture$AsyncSupply.run$$$capture(CompletableFuture.java:1700) [?:?]at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java) [?:?]at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]at java.lang.Thread.run(Thread.java:834) [?:?]}}

Severity: Marginal
Probability: Probable

Evaluate Blockchain Fork Tracking

We currently track fork chainheads as a list of hashes in our key-value store: [https://github.com/hyperledger/besu/blob/4a3b693bb18fab6ad47b23099fc54a7244630ab4/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/storage/keyvalue/KeyValueStoragePrefixedKeyBlockchainStorage.java#L69-L73]

This collection was originally added so that we might go back and clean up old fork data, but we're not currently doing anything with it. Storing all of the fork heads in one collection is not very scalable for long-running nodes with a lot of chainhead contention.

We should determine whether or not we need to track fork heads:

  • If so:

    • We should evaluate whether we need a more scalable tracking solution, or at least start evicting this data so we can limit the size of the collection
  • If not:

    • We should safely remove this tracking

Note: This fork tracking may also be useful for selecting ommers to be included in mined blocks. I don't think Besu currently includes ommers during mining.

factor out the ommer reward logic

Description

We should factor out the ommer reward calculations into one set of methods in one class. Right now it is in AbstractBlockCreator, ClassicBlockProcessor, MainnetBlockProcessor, PrivateGroupRehydrationBlockProcessor, PrivateMigrationBlockProcessor, and soon RewardTraceGenerator.

The magic constants 8 and 32 can become static constants in this function, if they haven't been repriced yet I think they are safe forever.

Refactor privacynode.getTransactionSigningKey

This method should return the privacy signing key rather than pantheon keypair.

Currently, the pantheon keypair is the privacy signing key in all the acceptance tests but they could potentially be different.

Private migration failing from Pantheon 1.1 to Besu 1.4

From RC:

I believe i've identified an edge case related to private state migration, seems if the Besu node can't detect schema version i.e. version = 0. Besu still starts and private database migration won't run
Migration only runs if schema version is 1 and migration flag is set, otherwise node won't start... (PrivateStrorageMigrationService.java). The node I'm testing dates back to pantheon 1.1 and there's no DATABASE_METADATA.json in the database directory.

We need to check what is happening in this case.

Expected behaviour
• If no DATABASE_METADATA.json is present, the private database is assumed to be 1.0. If private transactions are present and the migration flag was set, the migration should happen.
• If no private transactions are present, migration shouldn't happen.

Low gas limit causes root mismatch with private transactions

When you perform a private transaction with the correctly specified gas limit of 23,176 wei the private nodes get a root mismatch.

Example:

A private network with 4 nodes.

Deploy a contract to Node 1 and Node 2 with the gas limit of 24k

Node 3 and Node 4 will process the transaction correctly (the are not party to the private transaction)

Node 1 and Node 2 will fail with the error InvalidBlockException: Failed to import block: Invalid blockand Invalid block: receipts root mismatch

I suspect this is because the private transaction requires more gas and is somehow causing the gas used to be wrong.

Make Fast Sync Default on Named Networks

The current default syncing mode for Besu is full sync with no pruning. On named networks (see [this list|https://besu.hyperledger.org/en/latest/Reference/CLI/CLI-Syntax/#network], excluding dev), the default should be changed to fast sync and pruning.

Acceptance Criteria:

  • Default syncing mode is fast sync on by default on the following networks:
    • mainnet
    • rinkeby
    • goerli
    • classic
    • mordor
    • kotti

Improve the error when failing to submit a Private Marker Transaction

When using privacy without defining the --privacy-marker-transaction-signing-key-file an auto-generated key (account) is used. 

On a network with a non-zero gas price, when a private transaction is submitted with the from account being well funded, the error Upfront cost exceeds account balance is encountered (because the account signing the PMT is not funded).

While the error is technically correct, it is fair to assume that a user (who submits the private transaction) will infer that the error relates to the transaction they have submitted, and the insufficient funds relate to the account they submitted in the from field.

Let's do something to improve this user experience, either something in the JSON-RPC response, or at a minimum additional logging to help people diagnose the problem (i.e. identify the PMT failed). 

Raised by @CjHare in Jira

VertxPeerDiscoveryAgent can stall shutdown

VertxPeerDiscoveryAgent relies on the io.vertx.core.datagram.DatagramSocket#close(Handler<AsyncResult>>) api. The code in the handler must be executed for proper shutdown. However if the underlying socket channel has already been closed then the handler is never called - https://github.com/eclipse-vertx/vert.x/blob/a490f9b20aacf8b09a98cb2db51084214be0138b/src/main/java/io/vertx/core/datagram/impl/DatagramSocketImpl.java#L307 . There is no known way to detect if the socket has already been closed and no feedback that the close call exited early. The handler is simply ignored.

This is causing long shutdown loops for full instances of Besu during unit and integration testing. The underlying issues causing the closure is that we are re-using and restarting multiple instances of the main Vertx object. Hence the impact is only in unit testing and not at typical client run.

To fix this we should consider re-writing vertx out of the peer discovery stack, altering how the VertxPeerDiscoveryAgent shuts down, or using a newer version of vertx where APIs exist to properly shutdown

Probability: Occasional

Severity: Marginal

Add priv_* filter methods

As a user, I want to be able to subscribe to logs for events from private transactions.

Acceptance criteria
Implement priv_* equivalents for:

eth_newFilter
eth_newBlockFilter
eth_newPendingTransactionFilter
eth_uninstallFilter
eth_getFilterChanges
eth_getLogs
Input for each call will the same as for the eth_* inputs + privacy group ID.

Result of each call will be the same as for the eth_* call for events the caller has access to.

Comments from original JI: https://jira.hyperledger.org/browse/BESU-79

Ivaylo Kirilov May 13, 2019
https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_newfilter - implementing these will allow dapps to efficiently poll for events emitted by private smart contracts.

This is not a focus right now.

Madeline Murray added a comment - 05/Dec/19 12:12 AM
Need to think about whether all of these make sense in the private context eg, newBlockFilter

Private transactions with IBFT logs nonce error

Sending a private transaction without a nonce using EthSigner + Besu + Orion logs a transaction nonce is lower than sender account nonce. The transaction looks to have been executed correctly though as I can retrieve the transaction receipt using priv_getTransactionReceipt.

2020-02-03 16:54:17.048+10:00 | pool-10-thread-1 | ERROR | PrivacyPrecompiledContract | Failed to process private transaction 0x158b55d5890664a4656274607951a648b80071ccf36c94e2636f30f3202c2184: Private Transaction nonce 2, is lower than sender account nonce 3.

To reproduce:

Setup EthSigner, Besu using privacy as a single IBFT node and Orion
Create privacy group using priv_createPrivacyGroup
Send transaction without a nonce through EthSigner with eea_sendTransaction
Can get the contents of the transaction receipt using the transaction hash, but there is a log error "Transaction nonce x, is lower than sender account nonce y.
 
Probability: Probable 
Severity: Moderate 

Originally raised by @jframe

`rpc-http-authentication-enabled` is buggy

Thank you to @magooster on https://chat.hyperledger.org/channel/besu for raising this:

Hi on upgrade to besu 1.4.0 i noticed that even with rpc auth disabled (rpc-http-authentication-enabled=false) if I include rpc-http-authentication-credentials-file=/path/to/file I get a 401 error when accessing the JSON RPC endpoint {"jsonrpc":"2.0","id":null,"error":{"code":-40100,"message":"Unauthorized"}} (This is different behaviour from Besu 1.3) shouldn't the flag take precedence? If i comment out the cerdential file setting in the config all works as expected...

Don't persist TransactionReceipt.bloomFilter in local DB

According to MattH's Eth64 talk at CoreDevsBerlin the bloom filter in the transaction receipts takes up about 50GB of storage (for an archival node). Since the Receipt already has the logs the field can be calculated on demand and need not be stored.

For this spike investigate what would be needed to not persist the receipt's bloom filter while keeping it available and calculable for wire and RPC uses. The total storage impact and wire and rpc impact should also be quantified.

Relevant Comment

 Most of the needed pluming work went in for PAN-3136, all that needs to change is optional deserialization and marshal on demand code for the log bits.
 

Improvement behaviour like other eth clients in `eth_call` (verifications too strict)

Problem: 

Using web3 with options on contract instantiation link for web3 doc options like gasPrice and gasLimit or gas, any eth_call that should be simulation mode is verifing the from address balance, giving the following error:

UnhandledPromiseRejectionWarning: Error: Returned error: Upfront cost exceeds account balance

Clients like geth, infura do not give this error.

For at least eth_call (i not tested eth_estimategas) contract methods with view do not pay the balance and gas parameters should be ignorated. 

Here the chat link: https://chat.hyperledger.org/channel/besu?msg=kuD2ysMRHExvRbWbz  

Raised by @helderjnpinto in Jira - https://jira.hyperledger.org/projects/BESU/issues/BESU-137

Issue with getBlockByNumber("pending")

Issue noticed by the Aleth team: 

The only client that supports getBlockByNumber(“pending”) seems to be besu. geth+retesteth does not support
aleth+retesteth could not import multiple transactions besu work with multiple transactions. 
here is what I got on importing one transaction through importRawTransaction but without mininglooks like besu return genesis when asked for “pending” block with unsettled transaction 
The “pending” is a valid argument. Geth and aleth support it.
Pending is a block with imported transactions but yet not sealed on top of the previous block

Probability: Occasional
Severity: Moderate

Reduce the number of times trie nodes are serialised

Profiling shows that implementations of tech.pegasys.pantheon.ethereum.trie.Node.getRlp are a hot spot for CPU usage when downloading world state for fast sync (as part of TrieNodeDataRequest.getChildRequests). This appears to be because methods like isReferencedByHash serialize to RLP to check the length.

For world state download particularly we have just parsed the node from RLP so should be able to store the information rather than having to serialise again.

Acceptance Criteria

  • Store RLP information from node after parsing it instead of re-serializing to RLP when performing checks such as isReferencedByHash

Allow configuration of TLS protocol and ciphersuites

Description

As an Enterprise, I want to be able to control TLS protocols and ciphersuites used by a system so that I can meet my enterprise requirements.

Acceptance Criteria

  • Operator can configure supported TLS protocols, default should be "TLSv1.2"
  • Operator can configure supported TLS ciphersuites, default should be empty. (Which means the default for TLSv1.2 from the SSLEngine (JDK))

Additional Information

Example implementation

Not specific message for invalid path on privacy-public-key-file option

When using the property privacy-public-key-file with an invalid path, Besu initialization fails without providing useful information about what is wrong. There are multiple properties that specify a path (e.g. genesis file, config file, etc). It is important to pinpoint to the user that path is invalid.

For example, when setting an invalid path for the genesis file, we get the following HELPFUL msg: "Unable to load genesis file /invalid/path/example/genesis.json"

However, when setting an invalid path for the orion public key, we get the following UNHELPFUL msg: "Invalid path"

How to reproduce

Start Besu specifying privacy-public-key-file with a path pointing to a non existing file
Expected behaviour

A message like "Unable to load Orion public key file /invalid/path/example/orion.pub"

Raised by @arash009

Investigate Decoder Exception found on Ropsten full sync node

2019-09-04 19:21:34.520+00:00 | nioEventLoopGroup-3-1 | ERROR | DeFramer | Exception while processing incoming messageio.netty.handler.codec.DecoderException: java.lang.IllegalArgumentException: Invalid node id.  Expected id of length: 64 bytes.at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:472) ~[netty-codec-4.1.34.Final.jar:4.1.34.Final]at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:278) ~[netty-codec-4.1.34.Final.jar:4.1.34.Final]at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:359) [netty-transport-4.1.34.Final.jar:4.1.34.Final]at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:345) [netty-transport-4.1.34.Final.jar:4.1.34.Final]at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:337) [netty-transport-4.1.34.Final.jar:4.1.34.Final]at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1408) [netty-transport-4.1.34.Final.jar:4.1.34.Final]at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:359) [netty-transport-4.1.34.Final.jar:4.1.34.Final]at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:345) [netty-transport-4.1.34.Final.jar:4.1.34.Final]at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:930) [netty-transport-4.1.34.Final.jar:4.1.34.Final]at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163) [netty-transport-4.1.34.Final.jar:4.1.34.Final]at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:677) [netty-transport-4.1.34.Final.jar:4.1.34.Final]at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:612) [netty-transport-4.1.34.Final.jar:4.1.34.Final]at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:529) [netty-transport-4.1.34.Final.jar:4.1.34.Final]at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:491) [netty-transport-4.1.34.Final.jar:4.1.34.Final]at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:905) [netty-common-4.1.34.Final.jar:4.1.34.Final]at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [netty-common-4.1.34.Final.jar:4.1.34.Final]at java.lang.Thread.run(Thread.java:834) [?:?]Caused by: java.lang.IllegalArgumentException: Invalid node id.  Expected id of length: 64 bytes.at com.google.common.base.Preconditions.checkArgument(Preconditions.java:142) ~[guava-28.0-jre.jar:?]at tech.pegasys.pantheon.ethereum.p2p.peers.EnodeURL.<init>(EnodeURL.java:49) ~[pantheon-p2p-1.2.2.jar:1.2.2]at tech.pegasys.pantheon.ethereum.p2p.peers.EnodeURL$Builder.build(EnodeURL.java:257) ~[pantheon-p2p-1.2.2.jar:1.2.2]at tech.pegasys.pantheon.ethereum.p2p.rlpx.connections.netty.DeFramer.createPeer(DeFramer.java:200) ~[pantheon-p2p-1.2.2.jar:1.2.2]at tech.pegasys.pantheon.ethereum.p2p.rlpx.connections.netty.DeFramer.decode(DeFramer.java:127) ~[pantheon-p2p-1.2.2.jar:1.2.2]at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:502) ~[netty-codec-4.1.34.Final.jar:4.1.34.Final]at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:441) ~[netty-codec-4.1.34.Final.jar:4.1.34.Final]... 16 more

Probability: Remote

Severity: Marginal

eth_getFilterChanges not working since 1.4.x and --auto-log-bloom-caching-enabled=true

Description

As an Besu user, i want to be able to get filter changes even if loog bloo filters are activated from cli

Acceptance Criteria

  • I create a filter via eth_newFilter, obtain historic logs til now via eth_getFilterLogs and with eth_get FilterChanges i sync up for new events

Steps to Reproduce (Bug)

  1. Startup besu node, with --auto-log-bloom-caching-enabled=false
  2. create after a whilt of transactions a newFIlter
  3. obtain past logs via eth_getFilterLogs
  4. I never get sunced with new events perhaps they are happening

Versions (Add all that apply)

  • Software version: 1.4.x

Additional Information

On Pegasys jira we opened the root base for the bloom filter inception at PAN-3245. Now this is not working.
Reviewing open issues we thought 1.4.1 fixed issue #438, could help but is not working.

Maybe this is related to this issue and we need to give it try. Please let us know
https://jira.hyperledger.org/projects/BESU/issues/BESU-169?filter=allopenissues

Impact

Any company using consensys/eventeum will not be able to get events. iobuilders has falled back to 1.3.9.

Kind regards

@abdelhamidbakhta
@shemnon

Make all stack trace visible only on debug log level and real messages displayed otherwise

Besu currently have some stacktraces displayed even on info mode in cas of a crash. We should be able to catch all these exceptions and only display a stacktrace in debug mode. For info mode for instance, a clear message with some important datas and a reminder of where to contact the support channels or find doc could be nice. Some CLI tools (like git) do that. They either give you the command to type to solve your issue or give you a link to a doc page where you can understand the issue.

Create non-fork block event listener and flesh out fork block events

We currently put empty collections in fork events because we don't want downstream consumers to react to the fork block. We also ignore fork block events with isCanonicalChainHead. We should flesh out the fork block to have relevant information and create a listener that will only give you non-fork events if you don't want them.

Leverage `couldMatch` in blockchain log listener

Adding an additional log listener overload in the blockchain that takes a logs query could let us filter out all the events in a block if none of the logs couldMatch on the logsBloomFilter in the event's block's header.

Refactor EeaSendawTransaction class

Make a clean separation for the three different kinds of private transactions that we do support: legacy, privacyGroup, onChainPrivacyGroup.

Possibly, apply a strategy pattern and decide the strategy based on the --privacy-onchain-groups-enabled flag.

Implement eth_submitHashrate JSON RPC API

Implement the EthSubmitHashrate API conforming to the EIP-1474 specification, copied below:

[EIP-1474|https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1474.md#methods]: eth_submitHashrate

Parameters
||#||Type||Description||
|1|{Data]|hash rate|
|2|{Data]|random ID identifying this node|

Returns

(boolean) - true if submitting went through successfully, false otherwise

Example

Request

curl -X POST --data '{
"id": 1337,
"jsonrpc": "2.0",
"method": "eth_submitHashrate",
"params": [
"0x0000000000000000000000000000000000000000000000000000000000500000",
"0x59daa26581d0acd1fce254fb7e85952f4c09d0915afd33d3886cd914bc7d283c"
]
}'

Response

{
"id": 1337,
"jsonrpc": "2.0",
"result": true
}

 

Deprecate privacy-precompiled-address CLI option

https://besu.hyperledger.org/en/latest/Reference/CLI/CLI-Syntax/#privacy-precompiled-address

This property isn't required. We should:

  • Change the PicoCLi option to hidden
  • Provide a warning in the logs if a node is started using this option.
  • Remove privacyAddress field from PrivacyParameters class
  • Ensure that priv_getPrecompiledAddress returns the offchain or onchain contract address based on the privacy mode that the node is running
  • Ensure that the node behaves as if the precompile doesn't exist when using a different privacy mode (e.g. when using onchain, tx sent to the offchain should behave as if the offchain precompile doesn't exist).

This option should be removed in v1.5.2. The first step will be hiding and warning the user (v1.5.1) and then removing it completely (v1.5.2).

Refactor gas calculator to move oparations and precompiled costs out

Gas Calculator currently has all gas calculations locked up in its interface. The majority of all calls are single use calls in operations and precompiled contracts. This makes it difficult to create a "mix&match" test fork including a base fork and select EIPs.

To fix this all operations and precompiled contracts will handle gas calculations themselves. Operations that refer to base tier costs or memory storage costing will still rely on GasCalculator for those parts. Intrinsic transaction cost will continue to be use the GasCalculator.

In the interim, all new operations and precompiled contracts, as well as updates to existing ones, should use the new pattern where gas is calculated in the Operation or PrecompiledContract class.

Support TOML grouping options for plugin configurations

And support TOML grouping based on [name] for plugin configurations.

For TOML based configuration of plugins we should support plugin groupings based on the plugin name.

For these example flags:

--p2p-port=42 
--plugin-rocksdb-foo-cache=250000
--plugin-kafka-queue-name=demo

A plain toml looks like

### TOML w/o sections
p2p-port=42
plugin-rocksdb-foo-cache=250000
plugin-kafka-queue-name="demo"

But because we have plugin name sections this bug would ask for support for both the above TOML and this sectioned TOML:

## TOML w/ sections
p2p-port=42

[plugin-rocksdb]
foo-cache=250000

[plugin-kafka]
queue-name="foo"
``

The name passed into PicoCLIOptions#addPicoCLIOptions becomes the part after `plugins-`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.