@@ -365,8 +365,9 @@ type App struct {
365
365
optimisticProcessingInfo * OptimisticProcessingInfo
366
366
367
367
// batchVerifier *ante.SR25519BatchVerifier
368
- txDecoder sdk.TxDecoder
369
- AnteHandler sdk.AnteHandler
368
+ txDecoder sdk.TxDecoder
369
+ AnteHandler sdk.AnteHandler
370
+ TracerAnteHandler sdk.AnteHandler
370
371
371
372
versionInfo version.Info
372
373
@@ -387,6 +388,11 @@ type App struct {
387
388
receiptStore seidb.StateStore
388
389
389
390
forkInitializer func (sdk.Context )
391
+
392
+ httpServerStartSignal chan struct {}
393
+ wsServerStartSignal chan struct {}
394
+ httpServerStartSignalSent bool
395
+ wsServerStartSignalSent bool
390
396
}
391
397
392
398
type AppOption func (* App )
@@ -437,19 +443,21 @@ func New(
437
443
memKeys := sdk .NewMemoryStoreKeys (capabilitytypes .MemStoreKey , banktypes .DeferredCacheStoreKey , oracletypes .MemStoreKey )
438
444
439
445
app := & App {
440
- BaseApp : bApp ,
441
- cdc : cdc ,
442
- appCodec : appCodec ,
443
- interfaceRegistry : interfaceRegistry ,
444
- invCheckPeriod : invCheckPeriod ,
445
- keys : keys ,
446
- tkeys : tkeys ,
447
- memKeys : memKeys ,
448
- txDecoder : encodingConfig .TxConfig .TxDecoder (),
449
- versionInfo : version .NewInfo (),
450
- metricCounter : & map [string ]float32 {},
451
- encodingConfig : encodingConfig ,
452
- stateStore : stateStore ,
446
+ BaseApp : bApp ,
447
+ cdc : cdc ,
448
+ appCodec : appCodec ,
449
+ interfaceRegistry : interfaceRegistry ,
450
+ invCheckPeriod : invCheckPeriod ,
451
+ keys : keys ,
452
+ tkeys : tkeys ,
453
+ memKeys : memKeys ,
454
+ txDecoder : encodingConfig .TxConfig .TxDecoder (),
455
+ versionInfo : version .NewInfo (),
456
+ metricCounter : & map [string ]float32 {},
457
+ encodingConfig : encodingConfig ,
458
+ stateStore : stateStore ,
459
+ httpServerStartSignal : make (chan struct {}, 1 ),
460
+ wsServerStartSignal : make (chan struct {}, 1 ),
453
461
}
454
462
455
463
for _ , option := range appOptions {
@@ -924,7 +932,7 @@ func New(
924
932
signModeHandler := encodingConfig .TxConfig .SignModeHandler ()
925
933
// app.batchVerifier = ante.NewSR25519BatchVerifier(app.AccountKeeper, signModeHandler)
926
934
927
- anteHandler , anteDepGenerator , err := NewAnteHandlerAndDepGenerator (
935
+ anteHandler , tracerAnteHandler , anteDepGenerator , err := NewAnteHandlerAndDepGenerator (
928
936
HandlerOptions {
929
937
HandlerOptions : ante.HandlerOptions {
930
938
AccountKeeper : app .AccountKeeper ,
@@ -952,6 +960,7 @@ func New(
952
960
panic (err )
953
961
}
954
962
app .AnteHandler = anteHandler
963
+ app .TracerAnteHandler = tracerAnteHandler
955
964
956
965
app .SetAnteHandler (anteHandler )
957
966
app .SetAnteDepGenerator (anteDepGenerator )
@@ -1580,6 +1589,16 @@ func (app *App) BuildDependenciesAndRunTxs(ctx sdk.Context, txs [][]byte, typedT
1580
1589
}
1581
1590
1582
1591
func (app * App ) ProcessBlock (ctx sdk.Context , txs [][]byte , req BlockProcessRequest , lastCommit abci.CommitInfo , simulate bool ) ([]abci.Event , []* abci.ExecTxResult , abci.ResponseEndBlock , error ) {
1592
+ defer func () {
1593
+ if ! app .httpServerStartSignalSent {
1594
+ app .httpServerStartSignalSent = true
1595
+ app .httpServerStartSignal <- struct {}{}
1596
+ }
1597
+ if ! app .wsServerStartSignalSent {
1598
+ app .wsServerStartSignalSent = true
1599
+ app .wsServerStartSignal <- struct {}{}
1600
+ }
1601
+ }()
1583
1602
ctx = ctx .WithIsOCCEnabled (app .OccEnabled ())
1584
1603
1585
1604
events := []abci.Event {}
@@ -1875,23 +1894,29 @@ func (app *App) RegisterTendermintService(clientCtx client.Context) {
1875
1894
tmservice .RegisterTendermintService (app .BaseApp .GRPCQueryRouter (), clientCtx , app .interfaceRegistry )
1876
1895
1877
1896
if app .evmRPCConfig .HTTPEnabled {
1878
- evmHTTPServer , err := evmrpc .NewEVMHTTPServer (app .Logger (), app .evmRPCConfig , clientCtx .Client , & app .EvmKeeper , app .BaseApp , app .AnteHandler , app .RPCContextProvider , app .encodingConfig .TxConfig , DefaultNodeHome , nil )
1897
+ evmHTTPServer , err := evmrpc .NewEVMHTTPServer (app .Logger (), app .evmRPCConfig , clientCtx .Client , & app .EvmKeeper , app .BaseApp , app .TracerAnteHandler , app .RPCContextProvider , app .encodingConfig .TxConfig , DefaultNodeHome , nil )
1879
1898
if err != nil {
1880
1899
panic (err )
1881
1900
}
1882
- if err := evmHTTPServer .Start (); err != nil {
1883
- panic (err )
1884
- }
1901
+ go func () {
1902
+ <- app .httpServerStartSignal
1903
+ if err := evmHTTPServer .Start (); err != nil {
1904
+ panic (err )
1905
+ }
1906
+ }()
1885
1907
}
1886
1908
1887
1909
if app .evmRPCConfig .WSEnabled {
1888
- evmWSServer , err := evmrpc .NewEVMWebSocketServer (app .Logger (), app .evmRPCConfig , clientCtx .Client , & app .EvmKeeper , app .BaseApp , app .AnteHandler , app .RPCContextProvider , app .encodingConfig .TxConfig , DefaultNodeHome )
1910
+ evmWSServer , err := evmrpc .NewEVMWebSocketServer (app .Logger (), app .evmRPCConfig , clientCtx .Client , & app .EvmKeeper , app .BaseApp , app .TracerAnteHandler , app .RPCContextProvider , app .encodingConfig .TxConfig , DefaultNodeHome )
1889
1911
if err != nil {
1890
1912
panic (err )
1891
1913
}
1892
- if err := evmWSServer .Start (); err != nil {
1893
- panic (err )
1894
- }
1914
+ go func () {
1915
+ <- app .wsServerStartSignal
1916
+ if err := evmWSServer .Start (); err != nil {
1917
+ panic (err )
1918
+ }
1919
+ }()
1895
1920
}
1896
1921
}
1897
1922
0 commit comments