Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
2770b4c
pass necessary args to backend
illia-malachyn Aug 12, 2025
029bd01
pass execution query arg to events backend
illia-malachyn Aug 14, 2025
ebe9216
fix tests. add query param to rest handlers
illia-malachyn Aug 19, 2025
433afc8
replace ID.Parse() with constructor
illia-malachyn Aug 19, 2025
183b712
fix todo
illia-malachyn Aug 22, 2025
3f781ad
add execution state query to events and accounts streaming endpoints
illia-malachyn Aug 21, 2025
fae65ab
fix some unit tests
illia-malachyn Aug 22, 2025
4257eb5
fix handler tests
illia-malachyn Aug 22, 2025
02484ae
fix websockets tests for events and account statuses streaming
illia-malachyn Aug 22, 2025
9f66569
Pass criteria instead of protobuf message to backends
illia-malachyn Aug 27, 2025
faadb0a
Return metadata in REST endpoins
illia-malachyn Aug 28, 2025
51d9ddc
introduce flow type for executor
illia-malachyn Aug 28, 2025
75cc4b5
return flow executor metadata
illia-malachyn Aug 28, 2025
0222f8e
set include metadata field in proxy handler
illia-malachyn Aug 28, 2025
4bef3f8
Merge branch 'illia-malachyn/7652-fork-aware-events-endpoint' into il…
illia-malachyn Sep 2, 2025
53bc0db
Align changes with events endpoints
illia-malachyn Sep 2, 2025
4db4500
fix regexp in legacy ws endpoint to support executor metadata
illia-malachyn Sep 2, 2025
5737ac6
add query params for exec state query
illia-malachyn Sep 3, 2025
dc71de8
Merge branch 'feature/optimistic-sync' into illia-malachyn/7652-fork-…
illia-malachyn Sep 3, 2025
911606c
run go mod
illia-malachyn Sep 3, 2025
1621773
fix http router tests
illia-malachyn Sep 3, 2025
95be3d6
remove setup exec node receipts func
illia-malachyn Sep 3, 2025
4642452
fix getEvents test returning metadata object when it is empty
illia-malachyn Sep 3, 2025
0404267
add access models
illia-malachyn Sep 4, 2025
30a1f08
fix error message for test
illia-malachyn Sep 4, 2025
24ce594
fix id test
illia-malachyn Sep 5, 2025
38a9753
Suggested improvements for rest optimistic sync inputs in rest api
peterargue Sep 9, 2025
cccbcbe
fix get events with empty exec metadata test
illia-malachyn Sep 9, 2025
38ef401
Merge branch 'feature/optimistic-sync' into illia-malachyn/7652-fork-…
peterargue Sep 10, 2025
4964724
rewrite buildexpectedResponse function
illia-malachyn Sep 9, 2025
39c16a5
rename exec result provider
illia-malachyn Sep 9, 2025
7667a00
rename ExecutionResult func
illia-malachyn Sep 9, 2025
18929d4
fix some comments
illia-malachyn Sep 9, 2025
a259a3e
fix comments
illia-malachyn Sep 11, 2025
82df323
fix metadata usages
illia-malachyn Sep 11, 2025
fab9f37
add mock for exec state cache that return explicit 'implement me' mes…
illia-malachyn Sep 11, 2025
1ec401b
init exec result provider in access test
illia-malachyn Sep 11, 2025
430f7c0
Merge branch 'illia-malachyn/7652-fork-aware-events-endpoint' into pe…
illia-malachyn Sep 11, 2025
8c5342b
Merge pull request #7855 from onflow/peter/7652-fork-aware-events-end…
illia-malachyn Sep 11, 2025
f2f8284
regen mocks
illia-malachyn Sep 11, 2025
d86e10b
init exec result info provider fields
illia-malachyn Sep 11, 2025
7e0cb3c
fix imports
illia-malachyn Sep 11, 2025
cdfcef5
refactor metadata tests. remove unneeded unit test setup
illia-malachyn Sep 12, 2025
9bf4bbb
use mock execution state cache
illia-malachyn Sep 12, 2025
d4efb01
use mocks in observer builder
illia-malachyn Sep 12, 2025
dec3e3f
init exec state cache fields where necessary
illia-malachyn Sep 12, 2025
8560e62
edited execution result files with goland format tool
illia-malachyn Sep 12, 2025
3e5cd78
remove endline
illia-malachyn Sep 12, 2025
d55fba0
return error if no block ids were passed
illia-malachyn Sep 15, 2025
1f1ef23
remove second var for newest view
illia-malachyn Sep 15, 2025
137fbd6
Merge branch 'illia-malachyn/7652-fork-aware-events-endpoint' into il…
illia-malachyn Sep 15, 2025
3f07db5
Merge branch 'feature/optimistic-sync' into illia-malachyn/7652-fork-…
peterargue Sep 15, 2025
f4a5759
apply suggestions from code review
illia-malachyn Sep 16, 2025
bd65046
apple suggestions from code review
illia-malachyn Sep 16, 2025
d38fc9b
fix lint errors
illia-malachyn Sep 16, 2025
2900daa
update deps
illia-malachyn Sep 16, 2025
437f7d8
update deps
illia-malachyn Sep 17, 2025
d217c4a
fix get at sealed test
illia-malachyn Sep 17, 2025
da48b9a
add more tests for empty state. revert observer format
illia-malachyn Sep 18, 2025
420a7f5
mock exec result provider where needed
illia-malachyn Sep 19, 2025
2fc5428
use execution result id instead of execution result
illia-malachyn Sep 19, 2025
4a72677
remove commented code
illia-malachyn Sep 19, 2025
7387bfd
fix info provider test
illia-malachyn Sep 19, 2025
73a3ce1
remove .maybe() where not needed
illia-malachyn Sep 22, 2025
caa906c
Merge branch 'illia-malachyn/7652-fork-aware-events-endpoint' into il…
illia-malachyn Sep 23, 2025
6a268c2
setup exec result info provider and state cache in node builders
illia-malachyn Sep 23, 2025
a1498f8
remove streaming data struct as it is useless
illia-malachyn Sep 24, 2025
aa730c0
rename subscription handler to subscription factory
illia-malachyn Sep 24, 2025
3d38688
Move rpc & rest packages to api package
illia-malachyn Sep 25, 2025
cf66d55
fix openapi command in makefile
illia-malachyn Sep 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
33 changes: 18 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ endif

.PHONY: generate-openapi
generate-openapi:
swagger-codegen generate -l go -i https://raw.githubusercontent.com/onflow/flow/master/openapi/access.yaml -D packageName=models,modelDocs=false,models -o engine/access/rest/http/models;
go fmt ./engine/access/rest/http/models
swagger-codegen generate -l go -i https://raw.githubusercontent.com/onflow/flow/master/openapi/access.yaml -D packageName=models,modelDocs=false,models -o engine/access/api/rest/http/models;
go fmt ./engine/access/api/rest/http/models

.PHONY: generate
generate: generate-proto generate-mocks generate-fvm-env-wrappers
Expand Down Expand Up @@ -199,21 +199,21 @@ generate-mocks: install-mock-generators
mockery --name 'API' --dir="./access" --case=underscore --output="./access/mock" --outpkg="mock"
mockery --name 'Blocks' --dir="./access/validator" --case=underscore --output="./access/validator/mock" --outpkg="mock"
mockery --name 'API' --dir="./engine/protocol" --case=underscore --output="./engine/protocol/mock" --outpkg="mock"
mockery --name '.*' --dir="./engine/access/state_stream" --case=underscore --output="./engine/access/state_stream/mock" --outpkg="mock"
mockery --name '.*' --dir="./engine/access/api/state_stream" --case=underscore --output="./engine/access/api/state_stream/mock" --outpkg="mock"
mockery --name 'BlockTracker' --dir="./engine/access/subscription/tracker" --case=underscore --output="./engine/access/subscription/tracker/mock" --outpkg="mock"
mockery --name 'ExecutionDataTracker' --dir="./engine/access/subscription/tracker" --case=underscore --output="./engine/access/subscription/tracker/mock" --outpkg="mock"
mockery --name 'DataProvider' --dir="./engine/access/rest/websockets/data_providers" --case=underscore --output="./engine/access/rest/websockets/data_providers/mock" --outpkg="mock"
mockery --name 'DataProviderFactory' --dir="./engine/access/rest/websockets/data_providers" --case=underscore --output="./engine/access/rest/websockets/data_providers/mock" --outpkg="mock"
mockery --name 'LinkGenerator' --dir="./engine/access/rest/common/models" --case=underscore --output="./engine/access/rest/common/models/mock" --outpkg="mock"
mockery --name 'WebsocketConnection' --dir="./engine/access/rest/websockets" --case=underscore --output="./engine/access/rest/websockets/mock" --outpkg="mock"
mockery --name 'ConnectionFactory' --dir="./engine/access/rpc/connection" --case=underscore --output="./engine/access/rpc/connection/mock" --outpkg="mock"
mockery --name 'Communicator' --dir="./engine/access/rpc/backend/node_communicator" --case=underscore --output="./engine/access/rpc/backend/node_communicator/mock" --outpkg="mock"
mockery --name 'AccountProvider' --dir="./engine/access/rpc/backend/accounts/provider" --case=underscore --output="./engine/access/rpc/backend/accounts/provider/mock" --outpkg="mock"
mockery --name 'EventProvider' --dir="./engine/access/rpc/backend/events/provider" --case=underscore --output="./engine/access/rpc/backend/events/provider/mock" --outpkg="mock"
mockery --name 'TransactionProvider' --dir="./engine/access/rpc/backend/transactions/provider" --case=underscore --output="./engine/access/rpc/backend/transactions/provider/mock" --outpkg="mock"
mockery --name 'Provider' --dir="./engine/access/rpc/backend/transactions/error_messages" --case=underscore --output="./engine/access/rpc/backend/transactions/error_messages/mock" --outpkg="mock"
mockery --name 'TransactionSender' --dir="./engine/access/rpc/backend/transactions/retrier" --case=underscore --output="./engine/access/rpc/backend/transactions/retrier/mock" --outpkg="mock"
mockery --name 'Retrier' --dir="./engine/access/rpc/backend/transactions/retrier" --case=underscore --output="./engine/access/rpc/backend/transactions/retrier/mock" --outpkg="mock"
mockery --name 'DataProvider' --dir="./engine/access/api/rest/websockets/data_providers" --case=underscore --output="./engine/access/api/rest/websockets/data_providers/mock" --outpkg="mock"
mockery --name 'DataProviderFactory' --dir="./engine/access/api/rest/websockets/data_providers" --case=underscore --output="./engine/access/api/rest/websockets/data_providers/mock" --outpkg="mock"
mockery --name 'LinkGenerator' --dir="./engine/access/api/rest/common/models" --case=underscore --output="./engine/access/api/rest/common/models/mock" --outpkg="mock"
mockery --name 'WebsocketConnection' --dir="./engine/access/api/rest/websockets" --case=underscore --output="./engine/access/api/rest/websockets/mock" --outpkg="mock"
mockery --name 'ConnectionFactory' --dir="./engine/access/api/rpc/connection" --case=underscore --output="./engine/access/api/rpc/connection/mock" --outpkg="mock"
mockery --name 'Communicator' --dir="./engine/access/api/rpc/backend/node_communicator" --case=underscore --output="./engine/access/api/rpc/backend/node_communicator/mock" --outpkg="mock"
mockery --name 'AccountProvider' --dir="./engine/access/api/rpc/backend/accounts/provider" --case=underscore --output="./engine/access/api/rpc/backend/accounts/provider/mock" --outpkg="mock"
mockery --name 'EventProvider' --dir="./engine/access/api/rpc/backend/events/provider" --case=underscore --output="./engine/access/api/rpc/backend/events/provider/mock" --outpkg="mock"
mockery --name 'TransactionProvider' --dir="./engine/access/api/rpc/backend/transactions/provider" --case=underscore --output="./engine/access/api/rpc/backend/transactions/provider/mock" --outpkg="mock"
mockery --name 'Provider' --dir="./engine/access/api/rpc/backend/transactions/error_messages" --case=underscore --output="./engine/access/api/rpc/backend/transactions/error_messages/mock" --outpkg="mock"
mockery --name 'TransactionSender' --dir="./engine/access/api/rpc/backend/transactions/retrier" --case=underscore --output="./engine/access/api/rpc/backend/transactions/retrier/mock" --outpkg="mock"
mockery --name 'Retrier' --dir="./engine/access/api/rpc/backend/transactions/retrier" --case=underscore --output="./engine/access/api/rpc/backend/transactions/retrier/mock" --outpkg="mock"
mockery --name '.*' --dir=model/fingerprint --case=underscore --output="./model/fingerprint/mock" --outpkg="mock"
mockery --name 'ExecForkActor' --structname 'ExecForkActorMock' --dir=module/mempool/consensus/mock/ --case=underscore --output="./module/mempool/consensus/mock/" --outpkg="mock"
mockery --name '.*' --dir=engine/verification/fetcher/ --case=underscore --output="./engine/verification/fetcher/mock" --outpkg="mockfetcher"
Expand All @@ -222,6 +222,9 @@ generate-mocks: install-mock-generators
mockery --name 'ScriptExecutor' --dir=module/execution --case=underscore --output="module/execution/mock" --outpkg="mock"
mockery --name 'StorageSnapshot' --dir=fvm/storage/snapshot --case=underscore --output="fvm/storage/snapshot/mock" --outpkg="mock"
mockery --name 'Core' --dir=module/executiondatasync/optimistic_sync --case=underscore --output="module/executiondatasync/optimistic_sync/mock" --outpkg="mock"
mockery --name 'ExecutionResultInfoProvider' --dir=module/executiondatasync/optimistic_sync --case=underscore --output="module/executiondatasync/optimistic_sync/mock" --outpkg="mock"
mockery --name 'ExecutionStateCache' --dir=module/executiondatasync/optimistic_sync --case=underscore --output="module/executiondatasync/optimistic_sync/mock" --outpkg="mock"
mockery --name 'Snapshot' --dir=module/executiondatasync/optimistic_sync --case=underscore --output="module/executiondatasync/optimistic_sync/mock" --outpkg="mock"
mockery --name 'Requester' --dir=engine/access/ingestion/tx_error_messages --case=underscore --output="engine/access/ingestion/tx_error_messages/mock" --outpkg="mock"
mockery --name 'ExecutionDataRequester' --dir=module/state_synchronization/requester --case=underscore --output="module/state_synchronization/requester/mock" --outpkg="mock"

Expand Down
16 changes: 10 additions & 6 deletions access/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/onflow/flow-go/engine/access/subscription"
accessmodel "github.com/onflow/flow-go/model/access"
"github.com/onflow/flow-go/model/flow"
"github.com/onflow/flow-go/module/executiondatasync/optimistic_sync"
)

type AccountsAPI interface {
Expand All @@ -28,17 +29,19 @@ type EventsAPI interface {
GetEventsForHeightRange(
ctx context.Context,
eventType string,
startHeight,
startHeight uint64,
endHeight uint64,
requiredEventEncodingVersion entities.EventEncodingVersion,
) ([]flow.BlockEvents, error)
requiredEventEncodingVersion entities.EventEncodingVersion, // TODO: we should depend on access models instead of rpc models
criteria optimistic_sync.Criteria,
) ([]flow.BlockEvents, accessmodel.ExecutorMetadata, error)

GetEventsForBlockIDs(
ctx context.Context,
eventType string,
blockIDs []flow.Identifier,
requiredEventEncodingVersion entities.EventEncodingVersion,
) ([]flow.BlockEvents, error)
requiredEventEncodingVersion entities.EventEncodingVersion, // TODO: we should depend on access models instead of rpc models
criteria optimistic_sync.Criteria,
) ([]flow.BlockEvents, accessmodel.ExecutorMetadata, error)
}

type ScriptsAPI interface {
Expand All @@ -53,6 +56,7 @@ type TransactionsAPI interface {
GetTransaction(ctx context.Context, id flow.Identifier) (*flow.TransactionBody, error)
GetTransactionsByBlockID(ctx context.Context, blockID flow.Identifier) ([]*flow.TransactionBody, error)

// TODO: we should depend on access models instead of rpc models
GetTransactionResult(ctx context.Context, txID flow.Identifier, blockID flow.Identifier, collectionID flow.Identifier, encodingVersion entities.EventEncodingVersion) (*accessmodel.TransactionResult, error)
GetTransactionResultByIndex(ctx context.Context, blockID flow.Identifier, index uint32, encodingVersion entities.EventEncodingVersion) (*accessmodel.TransactionResult, error)
GetTransactionResultsByBlockID(ctx context.Context, blockID flow.Identifier, encodingVersion entities.EventEncodingVersion) ([]*accessmodel.TransactionResult, error)
Expand All @@ -72,7 +76,7 @@ type TransactionStreamAPI interface {
SubscribeTransactionStatuses(
ctx context.Context,
txID flow.Identifier,
requiredEventEncodingVersion entities.EventEncodingVersion,
requiredEventEncodingVersion entities.EventEncodingVersion, // TODO: we should depend on access models instead of rpc models
) subscription.Subscription

// SendAndSubscribeTransactionStatuses sends a transaction to the execution node and subscribes to its status updates.
Expand Down
5 changes: 3 additions & 2 deletions access/legacy/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/onflow/flow-go/access"
"github.com/onflow/flow-go/access/legacy/convert"
"github.com/onflow/flow-go/model/flow"
"github.com/onflow/flow-go/module/executiondatasync/optimistic_sync"
)

type Handler struct {
Expand Down Expand Up @@ -320,7 +321,7 @@ func (h *Handler) GetEventsForHeightRange(
startHeight := req.GetStartHeight()
endHeight := req.GetEndHeight()

results, err := h.api.GetEventsForHeightRange(ctx, eventType, startHeight, endHeight, entities.EventEncodingVersion_JSON_CDC_V0)
results, _, err := h.api.GetEventsForHeightRange(ctx, eventType, startHeight, endHeight, entities.EventEncodingVersion_JSON_CDC_V0, optimistic_sync.Criteria{})
if err != nil {
return nil, err
}
Expand All @@ -338,7 +339,7 @@ func (h *Handler) GetEventsForBlockIDs(
eventType := req.GetType()
blockIDs := convert.MessagesToIdentifiers(req.GetBlockIds())

results, err := h.api.GetEventsForBlockIDs(ctx, eventType, blockIDs, entities.EventEncodingVersion_JSON_CDC_V0)
results, _, err := h.api.GetEventsForBlockIDs(ctx, eventType, blockIDs, entities.EventEncodingVersion_JSON_CDC_V0, optimistic_sync.Criteria{})
if err != nil {
return nil, err
}
Expand Down
64 changes: 40 additions & 24 deletions access/mock/api.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions admin/commands/storage/backfill_tx_error_messages_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ import (

"github.com/onflow/flow-go/admin"
"github.com/onflow/flow-go/admin/commands"
"github.com/onflow/flow-go/engine/access/api/rpc/backend"
"github.com/onflow/flow-go/engine/access/api/rpc/backend/node_communicator"
"github.com/onflow/flow-go/engine/access/api/rpc/backend/transactions/error_messages"
connectionmock "github.com/onflow/flow-go/engine/access/api/rpc/connection/mock"
"github.com/onflow/flow-go/engine/access/index"
"github.com/onflow/flow-go/engine/access/ingestion/tx_error_messages"
accessmock "github.com/onflow/flow-go/engine/access/mock"
"github.com/onflow/flow-go/engine/access/rpc/backend"
"github.com/onflow/flow-go/engine/access/rpc/backend/node_communicator"
"github.com/onflow/flow-go/engine/access/rpc/backend/transactions/error_messages"
connectionmock "github.com/onflow/flow-go/engine/access/rpc/connection/mock"
commonrpc "github.com/onflow/flow-go/engine/common/rpc"
"github.com/onflow/flow-go/model/flow"
syncmock "github.com/onflow/flow-go/module/state_synchronization/mock"
Expand Down
2 changes: 1 addition & 1 deletion cmd/access/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ As the collections arrive, it persists the collections and the transactions with

The `requester` engine requests collections from the collection nodes on behalf of the `ingestion` engine.

### [RPC](../../engine/access/rpc)
### [RPC](../../engine/access/api/rpc)

The `rpc` engine is the GRPC server which responds to the [Access API](https://docs.onflow.org/access-api/) requests from clients.
It also supports GRPCWebproxy requests.
Expand Down
Loading
Loading