Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(op-node): alchemy as rpc node for opbnb #229

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion op-service/sources/l1_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ func NewL1Client(client client.RPC, log log.Logger, metrics caching.Metrics, con
// Notice, we cannot cache a block reference by label because labels are not guaranteed to be unique.
func (s *L1Client) L1BlockRefByLabel(ctx context.Context, label eth.BlockLabel) (eth.L1BlockRef, error) {
info, err := s.BSCInfoByLabel(ctx, label)
if label == eth.Finalized && err != nil && strings.Contains(err.Error(), "eth_getFinalizedHeader does not exist") {
if label == eth.Finalized && err != nil &&
(strings.Contains(err.Error(), "eth_getFinalizedHeader does not exist") ||
strings.Contains(err.Error(), "method not found")) {
// op-e2e not support bsc as L1 currently, so fallback to not use bsc specific method eth_getFinalizedBlock
info, err = s.InfoByLabel(ctx, label)
}
Expand Down
2 changes: 1 addition & 1 deletion op-service/sources/receipts_rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ const (
func AvailableReceiptsFetchingMethods(kind RPCProviderKind) ReceiptsFetchingMethod {
switch kind {
case RPCKindAlchemy:
return AlchemyGetTransactionReceipts | EthGetBlockReceipts | EthGetTransactionReceiptBatch
return EthGetTransactionReceiptBatch
case RPCKindQuickNode:
return DebugGetRawReceipts | EthGetBlockReceipts | EthGetTransactionReceiptBatch
case RPCKindInfura:
Expand Down
16 changes: 0 additions & 16 deletions op-service/sources/receipts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,22 +239,6 @@ func TestEthClient_FetchReceipts(t *testing.T) {
}

testCases := []ReceiptsTestCase{
{
name: "alchemy",
providerKind: RPCKindAlchemy,
setup: fallbackCase(30, AlchemyGetTransactionReceipts),
},
{
name: "alchemy sticky",
providerKind: RPCKindAlchemy,
staticMethod: true,
setup: fallbackCase(30, AlchemyGetTransactionReceipts, AlchemyGetTransactionReceipts),
},
{
name: "alchemy fallback 1",
providerKind: RPCKindAlchemy,
setup: fallbackCase(40, AlchemyGetTransactionReceipts, EthGetBlockReceipts),
},
{
name: "alchemy low tx count cost saving",
providerKind: RPCKindAlchemy,
Expand Down
Loading