forked from 0xPolygonHermez/zkevm-node
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
StateV2 baseline (0xPolygonHermez#823)
* WIP * WIP * add json rpc server v2 to integrate with state v2 * WIP * organize the integration between state and json rpc server * WIP * fix TestBlockNumber unit test * fix eth_Call unit tests * fix eth_GetBalance unit test * fix eth_GetBlockByHash unit test * fix eth_GetBlockByNumber unit test * fix eth_GetCode unit test * fix eth_GetStorageAt unit test * fix eth_Syncing unit test * fix eth_GetTransactionByBlockHashAndIndex unit test * fix eth_GetTransactionByBlockNumberAndIndex unit test * fix eth_GetTransactionByHash unit test * fix eth_GetBlockTransactionCountByHash unit test * fix eth_GetBlockTransactionCountByNumber unit test * fix eth_GetTransactionCount unit test * fix eth_GetTransactionReceipt unit test * fix TestGetNumericBlockNumber unit test * update jsonrpcv2 with jsonrpcv1 latest filter methods and tests * refactoring related to errors returned by JSON RPC endpoints to always be a rpcError * refactoring * Remove old mt proto, comment executor test * Fix comments * merge exercer and querier interfaces into execQuerier * add dbTx to all methods that access db in state Co-authored-by: tclemos <[email protected]>
- Loading branch information
1 parent
eb960dd
commit 7511164
Showing
49 changed files
with
3,875 additions
and
3,675 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package merkletree | ||
|
||
import ( | ||
"github.com/hermeznetwork/hermez-core/log" | ||
"github.com/hermeznetwork/hermez-core/merkletree/pb" | ||
"google.golang.org/grpc" | ||
"google.golang.org/grpc/credentials/insecure" | ||
) | ||
|
||
func NewStateDBServiceClient(c Config) (pb.StateDBServiceClient, *grpc.ClientConn) { | ||
opts := []grpc.DialOption{ | ||
grpc.WithTransportCredentials(insecure.NewCredentials()), | ||
} | ||
executorConn, err := grpc.Dial(c.URI, opts...) | ||
if err != nil { | ||
log.Fatalf("fail to dial: %v", err) | ||
} | ||
|
||
executorClient := pb.NewStateDBServiceClient(executorConn) | ||
return executorClient, executorConn | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package merkletree | ||
|
||
// ServerConfig represents the configuration of the merkletree server | ||
type Config struct { | ||
URI string `mapstructure:"URI"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.