Skip to content

Commit f4a383b

Browse files
cyberhorseylwedge99
authored andcommitted
chore(cmd): remove --taiko.preconfirmationForwardingUrl flag (taikoxyz#362)
* remove forwading tx's, as will be fetched from mempool * addtl config
1 parent 4bf47bd commit f4a383b

File tree

11 files changed

+5
-147
lines changed

11 files changed

+5
-147
lines changed

cmd/geth/config.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -192,11 +192,6 @@ func makeFullNode(ctx *cli.Context) *node.Node {
192192
cfg.Eth.OverrideVerkle = &v
193193
}
194194

195-
// CHANGE(taiko): set preconfirmation forwarding URL.
196-
if ctx.IsSet(utils.PreconfirmationForwardingURLFlag.Name) {
197-
cfg.Eth.PreconfirmationForwardingURL = ctx.String(utils.PreconfirmationForwardingURLFlag.Name)
198-
}
199-
200195
backend, eth := utils.RegisterEthService(stack, &cfg.Eth)
201196

202197
// CHANGE(TAIKO): register Taiko RPC APIs.

cmd/geth/main.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,6 @@ func init() {
261261
debug.Flags,
262262
metricsFlags,
263263
)
264-
// CHANGE(taiko): append Taiko flags into the original GETH flags
265-
app.Flags = append(app.Flags, utils.TaikoFlag, utils.PreconfirmationForwardingURLFlag)
266264

267265
flags.AutoEnvVars(app.Flags, "GETH")
268266

cmd/utils/taiko_flags.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@ var (
1818
Usage: "Taiko network",
1919
Category: flags.TaikoCategory,
2020
}
21-
PreconfirmationForwardingURLFlag = &cli.StringFlag{
22-
Name: "taiko.preconfirmationForwardingUrl",
23-
Usage: "URL to forward RPC requests before confirmation",
24-
Category: flags.TaikoCategory,
25-
}
2621
)
2722

2823
// RegisterTaikoAPIs initializes and registers the Taiko RPC APIs.

eth/api_backend.go

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,10 @@ import (
4444

4545
// EthAPIBackend implements ethapi.Backend and tracers.Backend for full nodes
4646
type EthAPIBackend struct {
47-
extRPCEnabled bool
48-
allowUnprotectedTxs bool
49-
eth *Ethereum
50-
gpo *gasprice.Oracle
51-
preconfirmationForwardingURL string // CHANGE(taiko): add preconfirmation forwarding URL
47+
extRPCEnabled bool
48+
allowUnprotectedTxs bool
49+
eth *Ethereum
50+
gpo *gasprice.Oracle
5251
}
5352

5453
// ChainConfig returns the active chain configuration.
@@ -432,8 +431,3 @@ func (b *EthAPIBackend) StateAtBlock(ctx context.Context, block *types.Block, re
432431
func (b *EthAPIBackend) StateAtTransaction(ctx context.Context, block *types.Block, txIndex int, reexec uint64) (*types.Transaction, vm.BlockContext, *state.StateDB, tracers.StateReleaseFunc, error) {
433432
return b.eth.stateAtTransaction(ctx, block, txIndex, reexec)
434433
}
435-
436-
// GetPreconfirmationForwardingURL returns the URL to forward RPC requests before confirmation.
437-
func (b *EthAPIBackend) GetPreconfirmationForwardingURL() string {
438-
return b.preconfirmationForwardingURL
439-
}

eth/backend.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,6 @@ type Ethereum struct {
9696
lock sync.RWMutex // Protects the variadic fields (e.g. gas price and etherbase)
9797

9898
shutdownTracker *shutdowncheck.ShutdownTracker // Tracks if and when the node has shutdown ungracefully
99-
100-
PreconfirmationForwardingURL string // CHANGE(taiko): add preconfirmation forwarding URL
10199
}
102100

103101
// New creates a new Ethereum object (including the initialisation of the common Ethereum object),
@@ -257,7 +255,7 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) {
257255
eth.miner.SetExtra(makeExtraData(config.Miner.ExtraData))
258256

259257
// CHANGE(taiko): set up the pre-confirmation forwarding URL
260-
eth.APIBackend = &EthAPIBackend{stack.Config().ExtRPCEnabled(), stack.Config().AllowUnprotectedTxs, eth, nil, config.PreconfirmationForwardingURL}
258+
eth.APIBackend = &EthAPIBackend{stack.Config().ExtRPCEnabled(), stack.Config().AllowUnprotectedTxs, eth, nil}
261259
if eth.APIBackend.allowUnprotectedTxs {
262260
log.Info("Unprotected transactions allowed")
263261
}

eth/ethconfig/config.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,6 @@ type Config struct {
157157

158158
// OverrideVerkle (TODO: remove after the fork)
159159
OverrideVerkle *uint64 `toml:",omitempty"`
160-
161-
// CHANGE(taiko): add preconfirmation forwarding URL
162-
PreconfirmationForwardingURL string
163160
}
164161

165162
// CreateConsensusEngine creates a consensus engine for the given chain config.

internal/ethapi/api.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1974,18 +1974,6 @@ func (api *TransactionAPI) FillTransaction(ctx context.Context, args Transaction
19741974
// SendRawTransaction will add the signed transaction to the transaction pool.
19751975
// The sender is responsible for signing the transaction and using the correct nonce.
19761976
func (api *TransactionAPI) SendRawTransaction(ctx context.Context, input hexutil.Bytes) (common.Hash, error) {
1977-
// CHANGE(taiko): Forward the request to the preconf node if specified.
1978-
if forwardURL := api.b.GetPreconfirmationForwardingURL(); forwardURL != "" {
1979-
log.Info("Forwarding SendRawTransaction request", "forwardURL", forwardURL)
1980-
// Forward the raw transaction to the specified URL
1981-
h, err := forward[string](forwardURL, "eth_sendRawTransaction", []interface{}{input.String()})
1982-
if err == nil && h != nil {
1983-
return common.HexToHash(*h), nil
1984-
} else {
1985-
return common.Hash{}, err
1986-
}
1987-
}
1988-
19891977
tx := new(types.Transaction)
19901978
if err := tx.UnmarshalBinary(input); err != nil {
19911979
return common.Hash{}, err

internal/ethapi/api_test.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3400,8 +3400,3 @@ func testRPCResponseWithFile(t *testing.T, testid int, result interface{}, rpc s
34003400
func addressToHash(a common.Address) common.Hash {
34013401
return common.BytesToHash(a.Bytes())
34023402
}
3403-
3404-
// CHANGE(taiko): add preconfirmation forwarding URL
3405-
func (b testBackend) GetPreconfirmationForwardingURL() string {
3406-
return ""
3407-
}

internal/ethapi/backend.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,6 @@ type Backend interface {
9696
SubscribeLogsEvent(ch chan<- []*types.Log) event.Subscription
9797
BloomStatus() (uint64, uint64)
9898
ServiceFilter(ctx context.Context, session *bloombits.MatcherSession)
99-
100-
// CHANGE(taiko): add preconfirmation forwarding URL
101-
GetPreconfirmationForwardingURL() string
10299
}
103100

104101
func GetAPIs(apiBackend Backend) []rpc.API {

internal/ethapi/taiko_preconf.go

Lines changed: 0 additions & 94 deletions
This file was deleted.

internal/ethapi/transaction_args_test.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -405,8 +405,3 @@ func (b *backendMock) SubscribeRemovedLogsEvent(ch chan<- core.RemovedLogsEvent)
405405
}
406406

407407
func (b *backendMock) Engine() consensus.Engine { return nil }
408-
409-
// CHANGE(taiko): add preconfirmation forwarding URL
410-
func (b *backendMock) GetPreconfirmationForwardingURL() string {
411-
return ""
412-
}

0 commit comments

Comments
 (0)