Skip to content

Commit ef80fd5

Browse files
authored
Merge pull request #2760 from ledgerwatch/stable-2021-10-01
Stable 2021 10 01
2 parents 4f20cf9 + e19dcd8 commit ef80fd5

File tree

6 files changed

+19
-9
lines changed

6 files changed

+19
-9
lines changed

cmd/rpcdaemon/cli/config.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ func RootCommand() (*cobra.Command, *Flags) {
9696
rootCmd.PersistentFlags().UintVar(&cfg.RpcBatchConcurrency, "rpc.batch.concurrency", 50, "Does limit amount of goroutines to process 1 batch request. Means 1 bach request can't overload server. 1 batch still can have unlimited amount of request")
9797
rootCmd.PersistentFlags().BoolVar(&cfg.TraceCompatibility, "trace.compat", false, "Bug for bug compatibility with OE for trace_ routines")
9898
rootCmd.PersistentFlags().BoolVar(&cfg.TxPoolV2, "txpool.v2", false, "experimental external txpool")
99-
rootCmd.PersistentFlags().StringVar(&cfg.TxPoolApiAddr, "txpool.api.addr", "127.0.0.1:9090", "txpool api network address, for example: 127.0.0.1:9090")
99+
rootCmd.PersistentFlags().StringVar(&cfg.TxPoolApiAddr, "txpool.api.addr", "127.0.0.1:9094", "txpool api network address, for example: 127.0.0.1:9094")
100100

101101
if err := rootCmd.MarkPersistentFlagFilename("rpc.accessList", "json"); err != nil {
102102
panic(err)
@@ -239,9 +239,9 @@ func RemoteServices(ctx context.Context, cfg Flags, logger log.Logger, rootCance
239239
}
240240
db = rwKv
241241
stateCache = kvcache.NewDummy()
242-
return db, eth, txPool, mining, stateCache, nil
242+
} else {
243+
log.Info("if you run RPCDaemon on same machine with Erigon add --datadir option")
243244
}
244-
log.Info("if you run RPCDaemon on same machine with Erigon add --datadir option")
245245

246246
if cfg.PrivateApiAddr == "" {
247247
return db, eth, txPool, mining, stateCache, nil

cmd/rpcdaemon/commands/eth_filters.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ func (api *APIImpl) GetFilterChanges(_ context.Context, index hexutil.Uint64) ([
3939

4040
// NewHeads send a notification each time a new (header) block is appended to the chain.
4141
func (api *APIImpl) NewHeads(ctx context.Context) (*rpc.Subscription, error) {
42+
if api.filters == nil {
43+
return &rpc.Subscription{}, rpc.ErrNotificationsUnsupported
44+
}
4245
notifier, supported := rpc.NotifierFromContext(ctx)
4346
if !supported {
4447
return &rpc.Subscription{}, rpc.ErrNotificationsUnsupported
@@ -71,6 +74,9 @@ func (api *APIImpl) NewHeads(ctx context.Context) (*rpc.Subscription, error) {
7174

7275
// NewPendingTransactions send a notification each time a new (header) block is appended to the chain.
7376
func (api *APIImpl) NewPendingTransactions(ctx context.Context) (*rpc.Subscription, error) {
77+
if api.filters == nil {
78+
return &rpc.Subscription{}, rpc.ErrNotificationsUnsupported
79+
}
7480
notifier, supported := rpc.NotifierFromContext(ctx)
7581
if !supported {
7682
return &rpc.Subscription{}, rpc.ErrNotificationsUnsupported

cmd/txpool/readme.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ Has 2 modes: internal and external
66

77
## Internal mode
88

9-
Works inside Erigon: add `--txpool.v2` flags to Erigon, and `--txpool.v2` flag to RPCDaemon
9+
Works inside Erigon: add `--txpool.v2` flags to Erigon, and `--txpool.v2 --txpool.api.addr localhost:9090` flags to
10+
RPCDaemon
1011

1112
## External mode
1213

core/vm/evm.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ func (evm *EVM) create(caller ContractRef, codeAndHash *codeAndHash, gas uint64,
553553
createDataGas := uint64(len(ret)) * params.CreateDataGas
554554
if contract.UseGas(createDataGas) {
555555
evm.IntraBlockState.SetCode(address, ret)
556-
} else {
556+
} else if evm.ChainRules.IsHomestead {
557557
err = ErrCodeStoreOutOfGas
558558
}
559559
}

eth/stagedsync/stage_finish.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,21 +129,24 @@ func NotifyNewHeaders(ctx context.Context, finishStageBeforeSync uint64, unwindT
129129
if err != nil {
130130
return err
131131
}
132-
notifyFrom := finishStageBeforeSync + 1
132+
notifyFrom := finishStageBeforeSync
133133
if unwindTo != nil && *unwindTo != 0 && (*unwindTo) < finishStageBeforeSync {
134134
notifyFrom = *unwindTo + 1
135135
}
136136
if notifier == nil {
137137
log.Warn("rpc notifier is not set, rpc daemon won't be updated about headers")
138138
return nil
139139
}
140-
log.Info("Update current block for the RPC API", "from", notifyFrom, "to", notifyTo)
140+
141141
for i := notifyFrom; i <= notifyTo; i++ {
142142
header := rawdb.ReadHeaderByNumber(tx, i)
143143
if header == nil {
144144
return fmt.Errorf("could not find canonical header for number: %d", i)
145145
}
146146
notifier.OnNewHeader(header)
147147
}
148+
149+
log.Info("Updated current block for the RPC API", "from", notifyFrom, "to", notifyTo)
150+
148151
return nil
149152
}

params/version.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ var (
3232
// see https://calver.org
3333
const (
3434
VersionMajor = 2021 // Major version component of the current release
35-
VersionMinor = 9 // Minor version component of the current release
36-
VersionMicro = 5 // Patch version component of the current release
35+
VersionMinor = 10 // Minor version component of the current release
36+
VersionMicro = 1 // Patch version component of the current release
3737
VersionModifier = "alpha" // Patch version component of the current release
3838
VersionKeyCreated = "ErigonVersionCreated"
3939
VersionKeyFinished = "ErigonVersionFinished"

0 commit comments

Comments
 (0)