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

update feature/evm with latest updates on master #4981

Merged
merged 696 commits into from
Nov 11, 2023
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
696 commits
Select commit Hold shift + click to select a range
01bc52e
add emulator code
ramtinms Nov 2, 2023
c5ec8b2
go mod tidy
ramtinms Nov 2, 2023
ae2d089
lint fix
ramtinms Nov 2, 2023
9a05d7e
add evm emulator implementation
ramtinms Oct 20, 2023
2039a65
remove term flex
ramtinms Oct 20, 2023
1091dc1
more renames
ramtinms Oct 20, 2023
efef038
add comment
ramtinms Oct 20, 2023
551c285
don't use hex encoding for storage
ramtinms Oct 20, 2023
6d5961c
clean up
ramtinms Oct 20, 2023
ac4a5fa
database clean up
ramtinms Oct 20, 2023
344ecae
add test for coinbase fee collection
ramtinms Oct 20, 2023
86088e5
update docker test suite version
ramtinms Oct 20, 2023
4b07c64
.
ramtinms Oct 20, 2023
d736270
update env for event emission, meter checks
ramtinms Oct 22, 2023
5ad7ddb
add evm error code for graceful handling
ramtinms Oct 23, 2023
19015f8
add test for event emission
ramtinms Oct 23, 2023
59df777
go mod tidy
ramtinms Oct 23, 2023
ddc2332
update mocks
ramtinms Oct 23, 2023
3267fd3
add test for flow event emission
ramtinms Oct 23, 2023
9d1f844
add test for metering
ramtinms Oct 23, 2023
1228d4b
rename to ComputationAvailable
ramtinms Oct 23, 2023
815fc33
remove unwanted commited files
ramtinms Oct 23, 2023
db9afd3
fix fee collection for transactions
ramtinms Oct 23, 2023
47bf99d
apply comment feedback
ramtinms Oct 24, 2023
3fdccaf
minor changes
ramtinms Oct 24, 2023
ba65670
add as a todo
ramtinms Oct 24, 2023
e89f221
update mocks
ramtinms Oct 24, 2023
c3ea961
remove unused const
ramtinms Oct 24, 2023
7d467e8
Merge branch 'ramtin/evm-update-fvm-environment' of github.com:onflow…
ramtinms Nov 2, 2023
ec5e31d
remove unrelated files
ramtinms Nov 2, 2023
43781a2
lint
ramtinms Nov 2, 2023
fce6d02
mod tidy
ramtinms Nov 2, 2023
0306c55
.
ramtinms Nov 2, 2023
14f56a1
fix test
ramtinms Nov 2, 2023
983e488
network/test tests unquarantined, increased runners
gomisha Nov 2, 2023
164da3d
apply PRs feedback
ramtinms Nov 2, 2023
0cdbeb8
make rootID storage transactional
ramtinms Nov 2, 2023
0b422d5
Merge branch 'master' into misha/6894-buildjet-ci-test
gomisha Nov 2, 2023
6048198
increased to 16 vCPUs
gomisha Nov 2, 2023
3ea815d
Merge branch 'ramtin/evm-adding-emulator-database' into ramtin/evm-ad…
ramtinms Nov 2, 2023
a21ecbe
update commit
ramtinms Nov 2, 2023
041a46d
get the correct block from emulator
peterargue Nov 2, 2023
eb81e79
increased engine tests to 16 vCPUs
gomisha Nov 3, 2023
76686d3
minor improvements
ramtinms Nov 3, 2023
7395887
simplify direct calls
ramtinms Nov 3, 2023
aaf53b9
undo outdated test changes
peterargue Nov 3, 2023
22a39fe
Merge branch 'master' into petera/fix-qcvoter-an-failover
peterargue Nov 3, 2023
d496e7f
insecure module uses buildjet 4 vcpu runner
gomisha Nov 3, 2023
b0483e7
adds test for config resource manager flags
yhassanzadeh13 Nov 3, 2023
d2addd3
adds loading flag functionality for resource manager
yhassanzadeh13 Nov 3, 2023
722503c
moves resource manager scope names
yhassanzadeh13 Nov 3, 2023
1c174c5
cleans up redundant flags
yhassanzadeh13 Nov 3, 2023
8389bf5
Merge branch 'master' into yahya/6895-fix-peer-blocking-issue
yhassanzadeh13 Nov 3, 2023
e205b2a
add EVM validation error type
ramtinms Nov 3, 2023
6e37206
wrap db errors
ramtinms Nov 3, 2023
5ee4bc4
Merge branch 'ramtin/evm-adding-emulator-database' into ramtin/evm-ad…
ramtinms Nov 3, 2023
d0328c4
typo
ramtinms Nov 3, 2023
6a9fee2
fix error handling
ramtinms Nov 3, 2023
f3d9a25
.
ramtinms Nov 3, 2023
57d342b
.
ramtinms Nov 3, 2023
d2d53b6
[Access] Validate addresses match network in rest api
peterargue Nov 3, 2023
b98e919
add more tests on tx validation
ramtinms Nov 3, 2023
c0c6844
doc
ramtinms Nov 3, 2023
d320b6b
bft framework integration test using buildjet
gomisha Nov 3, 2023
620d6a1
engine tests split up to 6 jobs with default runners
gomisha Nov 3, 2023
daeac5f
added back all integration tests
gomisha Nov 3, 2023
98c5197
upgraded runners for some integration tests, engine/execution
gomisha Nov 3, 2023
948fd28
update docs
ramtinms Nov 3, 2023
1259067
dummy commit to kick off CI
gomisha Nov 3, 2023
1a8e3dd
doc update
ramtinms Nov 3, 2023
3ed4ea2
improve error handling
ramtinms Nov 3, 2023
0711eb6
Remove script execution changes
peterargue Nov 3, 2023
959bf17
split up TestScriptExecutionAndGetAccounts into 3 tests
gomisha Nov 3, 2023
ea3717b
lint
yhassanzadeh13 Nov 3, 2023
697510a
lint
yhassanzadeh13 Nov 3, 2023
74d9e4e
[Access] Improve script exec compare logging
peterargue Nov 3, 2023
4304a0a
adds test for building resource manager limits
yhassanzadeh13 Nov 3, 2023
c466902
documents the test
yhassanzadeh13 Nov 3, 2023
02402d8
nit
yhassanzadeh13 Nov 3, 2023
94d5666
Merge pull request #4924 from onflow/petera/fix-qcvoter-an-failover
peterargue Nov 3, 2023
b80c52a
Merge branch 'master' into yahya/6895-fix-peer-blocking-issue
yhassanzadeh13 Nov 4, 2023
027513c
updated runners for Epoch Cohort2, Access Integration Tests
gomisha Nov 6, 2023
e6a5ef3
AN integration tests split up into 3 cohorts (skip unit, other integr…
gomisha Nov 6, 2023
a20acfc
Apply suggestions from code review
zhangchiqing Nov 6, 2023
10c9edd
docker build using GitHub cache
gomisha Nov 6, 2023
c589487
remove saving Docker image locally
gomisha Nov 6, 2023
5998a0d
cache v3, saving local tar before caching, 8vcpu
gomisha Nov 6, 2023
9f86a31
add 11 docker images to docker-images.tar, 16 vcpu
gomisha Nov 6, 2023
30cd7e5
update comments
zhangchiqing Nov 6, 2023
ba1b00f
docker save multiline fix; skip localnet-test
gomisha Nov 6, 2023
6a5c2f8
update mock
zhangchiqing Nov 6, 2023
544b877
docker build increase to 32 vcpu
gomisha Nov 6, 2023
99a9b9e
buildjet cache instead of GitHub cache
gomisha Nov 6, 2023
39cf8b7
fixes the issue with the configs
yhassanzadeh13 Nov 6, 2023
6d3ff26
Merge remote-tracking branch 'origin/yahya/6895-fix-peer-blocking-iss…
yhassanzadeh13 Nov 6, 2023
98a6aa6
Merge pull request #4835 from onflow/leo/storehouse-interfaces
zhangchiqing Nov 6, 2023
0e4d303
lint fix
gomisha Nov 6, 2023
94192f6
activate more integration tests with default runners, using cached Do…
gomisha Nov 6, 2023
c1f10f1
docker-build downsized to 16 vcpu
gomisha Nov 6, 2023
5ebfaa0
integration test without relic build
gomisha Nov 6, 2023
5b91e97
Merge pull request #4925 from onflow/ramtin/evm-adding-emulator-database
ramtinms Nov 6, 2023
eb152e1
apply PR comments
ramtinms Nov 6, 2023
26480ec
apply PR comments
ramtinms Nov 6, 2023
6ca0231
put back relic build for integration tests
gomisha Nov 6, 2023
8766f2a
put back all remaining integration tests using BuildJet runners
gomisha Nov 6, 2023
d637a60
Merge branch 'master' into misha/6894-buildjet-ci-test
gomisha Nov 6, 2023
deab1b1
Merge branch 'misha/6894-buildjet-ci-test' of https://github.com/onfl…
gomisha Nov 6, 2023
ae39807
Merge branch 'master' into ramtin/evm-adding-emulator
ramtinms Nov 6, 2023
8bb2def
Merge branch 'master' into ramtin/evm-update-fvm-environment
ramtinms Nov 6, 2023
3594345
fix err override issue
ramtinms Nov 6, 2023
edc6064
small fix
ramtinms Nov 6, 2023
7c272fe
Merge branch 'master' into tarak/improve-shuffle-test
tarakby Nov 7, 2023
0f64ff2
[Ledger] Add special handling for global register keys
peterargue Nov 7, 2023
3c22480
fix lint
peterargue Nov 7, 2023
6591e54
Merge pull request #4861 from onflow/ramtin/evm-update-fvm-environment
ramtinms Nov 7, 2023
4c0681a
update ledger test
peterargue Nov 7, 2023
03a064e
Merge branch 'master' into ramtin/evm-adding-emulator
ramtinms Nov 7, 2023
81e7c4d
Merge branch 'master' into ramtin/evm-adding-emulator
ramtinms Nov 7, 2023
a9b3441
integration tests reverted to ubuntu-latest runners
gomisha Nov 7, 2023
034942d
re-activated unit-test, unit-test-modules jobs
gomisha Nov 7, 2023
3037af2
added (failing) test for sub-sub packages
gomisha Nov 7, 2023
c848b92
apply PR feedback
ramtinms Nov 7, 2023
48be317
remove WithBaseFee config
ramtinms Nov 7, 2023
d13d4be
Merge pull request #4930 from onflow/petera/4928-rest-address-validation
peterargue Nov 7, 2023
9ce23e0
Merge branch 'master' into tarak/improve-shuffle-test
tarakby Nov 7, 2023
cda7ba4
Merge branch 'master' into ramtin/evm-adding-emulator
ramtinms Nov 7, 2023
a2d2ce5
Apply suggestions from code review
peterargue Nov 7, 2023
902f3a8
rename test variables
peterargue Nov 7, 2023
417ec4a
Merge pull request #4927 from onflow/ramtin/evm-adding-emulator
ramtinms Nov 7, 2023
f2de35c
Merge branch 'master' into ramtin/evm-add-handler
ramtinms Nov 7, 2023
2ee6e8f
update handler to use direct calls
ramtinms Nov 7, 2023
10db185
comment
ramtinms Nov 7, 2023
35f4706
sub-sub packages support
gomisha Nov 7, 2023
6f73ce9
add comments to NewRegisterID
peterargue Nov 7, 2023
1520df6
sub-sub package test enhanced
gomisha Nov 7, 2023
357d9c5
updated other tests to support new sub-sub packages
gomisha Nov 7, 2023
1591a60
split up engine/execution unit tests into 3 jobs
gomisha Nov 7, 2023
645fc0b
engine/execution/ingestion upgraded to 4 vcpu
gomisha Nov 7, 2023
a33bab1
Merge remote-tracking branch 'origin/master' into yahya/6895-fix-peer…
yhassanzadeh13 Nov 7, 2023
2f5988c
update handler to have newBlockDraft
ramtinms Nov 7, 2023
b51ae27
fixes merge conflic
yhassanzadeh13 Nov 7, 2023
20a25fc
.
ramtinms Nov 7, 2023
ead9a55
separate address allocator out
ramtinms Nov 7, 2023
7f9b58f
[Access] Allow all origins by default on websockets connections
peterargue Nov 8, 2023
dd74b1e
fix lint
peterargue Nov 8, 2023
a121ef4
lint
ramtinms Nov 8, 2023
26030c2
add test for address allocation
ramtinms Nov 8, 2023
2d85064
clean up
ramtinms Nov 8, 2023
317fb11
bug fix
ramtinms Nov 8, 2023
7041f0e
test fix
ramtinms Nov 8, 2023
fe6714e
Merge pull request #4844 from onflow/tarak/improve-shuffle-test
tarakby Nov 8, 2023
43c1131
fix test
ramtinms Nov 8, 2023
bff4473
test fix
ramtinms Nov 8, 2023
946d3a4
remove bool return from run
ramtinms Nov 8, 2023
8698a87
[Access] Cleanup script execution comparisons
peterargue Nov 8, 2023
b4c4a22
improve docs
ramtinms Nov 8, 2023
c5b0a38
.
ramtinms Nov 8, 2023
b5bb19b
Merge branch 'master' into ramtin/evm-add-handler
ramtinms Nov 8, 2023
37ecc81
engine/execution/ingestion:buildjet-8vcpu
gomisha Nov 8, 2023
f52d044
network/test, network/p2p increased to 8 vcpu; added remaining networ…
gomisha Nov 8, 2023
a4bfe9c
BFT Framework, Epoch Cohort 2 - increased to 4 vcpu
gomisha Nov 8, 2023
abc6048
upgraded runners for Access Cohort 1, Epoch Cohort 1, 2
gomisha Nov 8, 2023
91a5adf
epoch cohort2 upgraded to 16 vcpu
gomisha Nov 8, 2023
d0b29ce
BFT Framework upgrade to 8 vcpu, epoch cohort2 removed flaky test, do…
gomisha Nov 8, 2023
655cf1c
quarantined flaky test - TestEpochJoinAndLeaveVN
gomisha Nov 8, 2023
14e0019
quarantined flaky test - TestSealingAndVerificationPassThrough
gomisha Nov 8, 2023
b98a39d
Merge branch 'master' into misha/6894-buildjet-ci-test
gomisha Nov 8, 2023
e2b0cdc
lint fix
gomisha Nov 8, 2023
457ae50
network/test split up into network/test/cohort1, network/test/cohort2
gomisha Nov 8, 2023
1554902
network/p2p split up into 4 subpackages
gomisha Nov 8, 2023
7944c28
extracted network/alsp into separate job
gomisha Nov 8, 2023
6e03881
extracted module/dkg into separate job
gomisha Nov 8, 2023
52bd044
engine/execution/ingestion dowgraded to stock runner
gomisha Nov 8, 2023
32afbca
added engine parent package as separate job
gomisha Nov 8, 2023
d8df732
added storage parent package as separate job
gomisha Nov 8, 2023
ec2d6c5
added state package as separate job
gomisha Nov 8, 2023
43c862e
removed localnet-test job
gomisha Nov 8, 2023
c2cc301
fix lint
peterargue Nov 8, 2023
d7c598d
engine/execution/ingestion upgraded to 2 vcpu
gomisha Nov 8, 2023
56a4a17
network/p2p/p2pnode upgraded to 2 vcpu
gomisha Nov 8, 2023
60c281e
module, engine upgraded to 2 vcpu
gomisha Nov 8, 2023
fefe30b
Merge branch 'master' into yahya/6895-fix-peer-blocking-issue
yhassanzadeh13 Nov 8, 2023
1990e2f
Merge pull request #4936 from onflow/petera/4798-improve-compare-logging
peterargue Nov 8, 2023
1423ee2
network/p2p/p2pnode upgraded to 4 vcpu
gomisha Nov 8, 2023
de74efb
network/test/cohort2 upgraded to 4 vcpu
gomisha Nov 8, 2023
4884166
engine upgraded to 4 vcpu
gomisha Nov 8, 2023
3677c74
move block proposal logic to blockstore
ramtinms Nov 8, 2023
fb11a77
missing handle error calls
ramtinms Nov 8, 2023
7b87add
Merge branch 'master' into petera/4798-cleanup-compare-logic
peterargue Nov 8, 2023
64da15c
code deduplication
ramtinms Nov 8, 2023
880a47b
Merge branch 'master' into ramtin/evm-add-handler
ramtinms Nov 8, 2023
1053341
lint issue
ramtinms Nov 8, 2023
3be7ed0
Merge branch 'ramtin/evm-add-handler' of github.com:onflow/flow-go in…
ramtinms Nov 8, 2023
63b099f
add todos
ramtinms Nov 8, 2023
4ad3fa4
engine/execution/ingestion upgraded to 4 vcpu, network/test/cohort1 u…
gomisha Nov 8, 2023
acdb459
network/test/cohort1 upgraded to 4 vcpu
gomisha Nov 8, 2023
3ed7c01
engine/execution/ingestion upgraded to 8 vcpu
gomisha Nov 8, 2023
b540d8f
network/test/cohort1 upgraded to 8 vcpu
gomisha Nov 8, 2023
14b8c6c
BFT (Protocol) upgraded to 4 vcpu
gomisha Nov 8, 2023
425b7ae
Update cadence to v0.42.4
SupunS Nov 8, 2023
ab7cd72
network/test/cohort1 upgraded to 16 vcpu
gomisha Nov 8, 2023
aa60cab
BFT (Protocol), Epoch Cohort1 upgraded to 8 vcpu
gomisha Nov 8, 2023
c1826f9
noop push to kick off CI
gomisha Nov 9, 2023
7c96928
Module (integration) upgraded to 4 vcpu
gomisha Nov 9, 2023
ac62aa6
test2.3
jordanschalm Nov 9, 2023
ac432e2
TestUnicastRateLimit_Messages flaky test quarantined
gomisha Nov 9, 2023
b22d993
test 2.3
jordanschalm Nov 9, 2023
54bdfc2
test 2.4 - slow block rate
jordanschalm Nov 9, 2023
0c0fdab
Merge pull request #4864 from onflow/ramtin/evm-add-handler
ramtinms Nov 9, 2023
7c922cb
noop push to kick off CI
gomisha Nov 9, 2023
58099aa
Merge pull request #4954 from onflow/petera/4952-fix-websockets-cors
peterargue Nov 9, 2023
ced2ce9
buildjet/cache@v3 => actions/cache@v3
gomisha Nov 9, 2023
82405e8
Merge pull request #4942 from onflow/petera/4938-ledger-register-glob…
peterargue Nov 9, 2023
6f601e4
Merge pull request #4956 from onflow/petera/4798-cleanup-compare-logic
peterargue Nov 9, 2023
61862ce
add PayloadToRegister
zhangchiqing Nov 8, 2023
0e26a3e
Update ledger/common/convert/convert_test.go
zhangchiqing Nov 8, 2023
1f9db22
update test case
zhangchiqing Nov 9, 2023
76e2f53
test retries increased to 5, timeout increased to 35 mins
gomisha Nov 9, 2023
47e71f9
module job increased to 4 vcpu
gomisha Nov 9, 2023
d747165
Merge branch 'master' into yahya/6895-fix-peer-blocking-issue
yhassanzadeh13 Nov 9, 2023
c8f0ef2
Merge pull request #4955 from onflow/leo/convert-payload-to-register
zhangchiqing Nov 9, 2023
9f889cc
Merge branch 'master' into misha/6894-buildjet-ci-test
gomisha Nov 9, 2023
9f00fa6
Merge pull request #4975 from onflow/jordan/vn-test-block-rate-fix
jordanschalm Nov 9, 2023
e579201
Merge pull request #4929 from onflow/yahya/6895-fix-peer-blocking-issue
yhassanzadeh13 Nov 9, 2023
cafb1a6
Merge pull request #4974 from onflow/supun/update-cadence-v0.42.4
turbolent Nov 9, 2023
b60901b
unquarantined epoch flaky test after it was fixed
gomisha Nov 9, 2023
6761410
unlink flaky test monitor workflow from running when ci changes
gomisha Nov 9, 2023
131490c
Merge branch 'misha/6894-buildjet-ci-test' of https://github.com/onfl…
gomisha Nov 9, 2023
8d6dfe4
clean up
gomisha Nov 9, 2023
d9d1b42
lint fix
gomisha Nov 9, 2023
3d1bded
Update cadence to v0.42.5
SupunS Nov 10, 2023
72e9efd
Merge pull request #4906 from onflow/misha/6894-buildjet-ci-test
gomisha Nov 10, 2023
b657d93
add in memory register store
zhangchiqing Oct 18, 2023
a979a3a
update comments
zhangchiqing Oct 18, 2023
b456944
add comment and update GetUpdatedRegister
zhangchiqing Oct 20, 2023
4196b01
refactor IsErrPruned
zhangchiqing Nov 1, 2023
0fc6db9
update tests
zhangchiqing Nov 1, 2023
4967fdd
prefix with tests InMemoryRegister
zhangchiqing Nov 1, 2023
2ee3128
use t.Run
zhangchiqing Nov 1, 2023
dc118a0
Apply suggestions from code review
zhangchiqing Nov 1, 2023
3e6d6ac
Apply suggestions from code review
zhangchiqing Nov 1, 2023
bbfdd07
address review comments
zhangchiqing Nov 2, 2023
434dc0e
Apply suggestions from code review
zhangchiqing Nov 6, 2023
6c7c6d1
fix linter
zhangchiqing Nov 6, 2023
99bae7c
fix linter
zhangchiqing Nov 6, 2023
2baa78d
Merge branch 'master' into supun/update-cadence-v0.42.5
turbolent Nov 10, 2023
c472af0
use RegisterEntries
zhangchiqing Nov 10, 2023
e4011e4
Merge pull request #4990 from onflow/supun/update-cadence-v0.42.5
turbolent Nov 10, 2023
87b7c0a
update mocks
zhangchiqing Nov 10, 2023
23c304d
Merge pull request #4836 from onflow/leo/storehouse-in-memory-regsite…
zhangchiqing Nov 10, 2023
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
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ generate-mocks: install-mock-generators
mockery --name 'ComputationManager' --dir=engine/execution/computation --case=underscore --output="engine/execution/computation/mock" --outpkg="mock"
mockery --name '.*' --dir=engine/execution/computation/query --case=underscore --output="engine/execution/computation/query/mock" --outpkg="mock"
mockery --name 'EpochComponentsFactory' --dir=engine/collection/epochmgr --case=underscore --output="engine/collection/epochmgr/mock" --outpkg="mock"
mockery --name '.*' --dir=engine/execution/ --case=underscore --output="engine/execution/mock" --outpkg="mock"
mockery --name 'Backend' --dir=engine/collection/rpc --case=underscore --output="engine/collection/rpc/mock" --outpkg="mock"
mockery --name 'ProviderEngine' --dir=engine/execution/provider --case=underscore --output="engine/execution/provider/mock" --outpkg="mock"
(cd ./crypto && mockery --name 'PublicKey' --case=underscore --output="../module/mock" --outpkg="mock")
Expand Down Expand Up @@ -212,6 +213,7 @@ generate-mocks: install-mock-generators
mockery --name '.*' --dir=engine/verification/fetcher/ --case=underscore --output="./engine/verification/fetcher/mock" --outpkg="mockfetcher"
mockery --name '.*' --dir=./cmd/util/ledger/reporters --case=underscore --output="./cmd/util/ledger/reporters/mock" --outpkg="mock"
mockery --name 'Storage' --dir=module/executiondatasync/tracker --case=underscore --output="module/executiondatasync/tracker/mock" --outpkg="mocktracker"
mockery --name 'ScriptExecutor' --dir=module/execution --case=underscore --output="module/execution/mock" --outpkg="mock"

#temporarily make insecure/ a non-module to allow mockery to create mocks
mv insecure/go.mod insecure/go2.mod
Expand Down
10 changes: 5 additions & 5 deletions access/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ type API interface {
SendTransaction(ctx context.Context, tx *flow.TransactionBody) error
GetTransaction(ctx context.Context, id flow.Identifier) (*flow.TransactionBody, error)
GetTransactionsByBlockID(ctx context.Context, blockID flow.Identifier) ([]*flow.TransactionBody, error)
GetTransactionResult(ctx context.Context, id flow.Identifier, blockID flow.Identifier, collectionID flow.Identifier) (*TransactionResult, error)
GetTransactionResultByIndex(ctx context.Context, blockID flow.Identifier, index uint32) (*TransactionResult, error)
GetTransactionResultsByBlockID(ctx context.Context, blockID flow.Identifier) ([]*TransactionResult, error)
GetTransactionResult(ctx context.Context, id flow.Identifier, blockID flow.Identifier, collectionID flow.Identifier, requiredEventEncodingVersion entities.EventEncodingVersion) (*TransactionResult, error)
GetTransactionResultByIndex(ctx context.Context, blockID flow.Identifier, index uint32, requiredEventEncodingVersion entities.EventEncodingVersion) (*TransactionResult, error)
GetTransactionResultsByBlockID(ctx context.Context, blockID flow.Identifier, requiredEventEncodingVersion entities.EventEncodingVersion) ([]*TransactionResult, error)

GetAccount(ctx context.Context, address flow.Address) (*flow.Account, error)
GetAccountAtLatestBlock(ctx context.Context, address flow.Address) (*flow.Account, error)
Expand All @@ -41,8 +41,8 @@ type API interface {
ExecuteScriptAtBlockHeight(ctx context.Context, blockHeight uint64, script []byte, arguments [][]byte) ([]byte, error)
ExecuteScriptAtBlockID(ctx context.Context, blockID flow.Identifier, script []byte, arguments [][]byte) ([]byte, error)

GetEventsForHeightRange(ctx context.Context, eventType string, startHeight, endHeight uint64) ([]flow.BlockEvents, error)
GetEventsForBlockIDs(ctx context.Context, eventType string, blockIDs []flow.Identifier) ([]flow.BlockEvents, error)
GetEventsForHeightRange(ctx context.Context, eventType string, startHeight, endHeight uint64, requiredEventEncodingVersion entities.EventEncodingVersion) ([]flow.BlockEvents, error)
GetEventsForBlockIDs(ctx context.Context, eventType string, blockIDs []flow.Identifier, requiredEventEncodingVersion entities.EventEncodingVersion) ([]flow.BlockEvents, error)

GetLatestProtocolStateSnapshot(ctx context.Context) ([]byte, error)

Expand Down
48 changes: 30 additions & 18 deletions access/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func (h *Handler) GetBlockHeaderByID(
) (*access.BlockHeaderResponse, error) {
id, err := convert.BlockID(req.GetId())
if err != nil {
return nil, err
return nil, status.Errorf(codes.InvalidArgument, "invalid block id: %v", err)
}
header, status, err := h.api.GetBlockHeaderByID(ctx, id)
if err != nil {
Expand Down Expand Up @@ -157,7 +157,7 @@ func (h *Handler) GetBlockByID(
) (*access.BlockResponse, error) {
id, err := convert.BlockID(req.GetId())
if err != nil {
return nil, err
return nil, status.Errorf(codes.InvalidArgument, "invalid block id: %v", err)
}
block, status, err := h.api.GetBlockByID(ctx, id)
if err != nil {
Expand All @@ -175,7 +175,7 @@ func (h *Handler) GetCollectionByID(

id, err := convert.CollectionID(req.GetId())
if err != nil {
return nil, err
return nil, status.Errorf(codes.InvalidArgument, "invalid collection id: %v", err)
}

col, err := h.api.GetCollectionByID(ctx, id)
Expand Down Expand Up @@ -230,7 +230,7 @@ func (h *Handler) GetTransaction(

id, err := convert.TransactionID(req.GetId())
if err != nil {
return nil, err
return nil, status.Errorf(codes.InvalidArgument, "invalid transaction id: %v", err)
}

tx, err := h.api.GetTransaction(ctx, id)
Expand All @@ -253,15 +253,15 @@ func (h *Handler) GetTransactionResult(

transactionID, err := convert.TransactionID(req.GetId())
if err != nil {
return nil, err
return nil, status.Errorf(codes.InvalidArgument, "invalid transaction id: %v", err)
}

blockId := flow.ZeroID
requestBlockId := req.GetBlockId()
if requestBlockId != nil {
blockId, err = convert.BlockID(requestBlockId)
if err != nil {
return nil, err
return nil, status.Errorf(codes.InvalidArgument, "invalid block id: %v", err)
}
}

Expand All @@ -270,11 +270,12 @@ func (h *Handler) GetTransactionResult(
if requestCollectionId != nil {
collectionId, err = convert.CollectionID(requestCollectionId)
if err != nil {
return nil, err
return nil, status.Errorf(codes.InvalidArgument, "invalid collection id: %v", err)
}
}

result, err := h.api.GetTransactionResult(ctx, transactionID, blockId, collectionId)
eventEncodingVersion := req.GetEventEncodingVersion()
result, err := h.api.GetTransactionResult(ctx, transactionID, blockId, collectionId, eventEncodingVersion)
if err != nil {
return nil, err
}
Expand All @@ -293,10 +294,12 @@ func (h *Handler) GetTransactionResultsByBlockID(

id, err := convert.BlockID(req.GetBlockId())
if err != nil {
return nil, err
return nil, status.Errorf(codes.InvalidArgument, "invalid block id: %v", err)
}

results, err := h.api.GetTransactionResultsByBlockID(ctx, id)
eventEncodingVersion := req.GetEventEncodingVersion()

results, err := h.api.GetTransactionResultsByBlockID(ctx, id, eventEncodingVersion)
if err != nil {
return nil, err
}
Expand All @@ -315,7 +318,7 @@ func (h *Handler) GetTransactionsByBlockID(

id, err := convert.BlockID(req.GetBlockId())
if err != nil {
return nil, err
return nil, status.Errorf(codes.InvalidArgument, "invalid block id: %v", err)
}

transactions, err := h.api.GetTransactionsByBlockID(ctx, id)
Expand All @@ -339,10 +342,12 @@ func (h *Handler) GetTransactionResultByIndex(

blockID, err := convert.BlockID(req.GetBlockId())
if err != nil {
return nil, err
return nil, status.Errorf(codes.InvalidArgument, "invalid block id: %v", err)
}

result, err := h.api.GetTransactionResultByIndex(ctx, blockID, req.GetIndex())
eventEncodingVersion := req.GetEventEncodingVersion()

result, err := h.api.GetTransactionResultByIndex(ctx, blockID, req.GetIndex(), eventEncodingVersion)
if err != nil {
return nil, err
}
Expand All @@ -360,7 +365,10 @@ func (h *Handler) GetAccount(
) (*access.GetAccountResponse, error) {
metadata := h.buildMetadataResponse()

address := flow.BytesToAddress(req.GetAddress())
address, err := convert.Address(req.GetAddress(), h.chain)
if err != nil {
return nil, status.Errorf(codes.InvalidArgument, "invalid address: %v", err)
}

account, err := h.api.GetAccount(ctx, address)
if err != nil {
Expand All @@ -387,7 +395,7 @@ func (h *Handler) GetAccountAtLatestBlock(

address, err := convert.Address(req.GetAddress(), h.chain)
if err != nil {
return nil, err
return nil, status.Errorf(codes.InvalidArgument, "invalid address: %v", err)
}

account, err := h.api.GetAccountAtLatestBlock(ctx, address)
Expand All @@ -414,7 +422,7 @@ func (h *Handler) GetAccountAtBlockHeight(

address, err := convert.Address(req.GetAddress(), h.chain)
if err != nil {
return nil, err
return nil, status.Errorf(codes.InvalidArgument, "invalid address: %v", err)
}

account, err := h.api.GetAccountAtBlockHeight(ctx, address, req.GetBlockHeight())
Expand Down Expand Up @@ -513,7 +521,9 @@ func (h *Handler) GetEventsForHeightRange(
startHeight := req.GetStartHeight()
endHeight := req.GetEndHeight()

results, err := h.api.GetEventsForHeightRange(ctx, eventType, startHeight, endHeight)
eventEncodingVersion := req.GetEventEncodingVersion()

results, err := h.api.GetEventsForHeightRange(ctx, eventType, startHeight, endHeight, eventEncodingVersion)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -545,7 +555,9 @@ func (h *Handler) GetEventsForBlockIDs(
return nil, err
}

results, err := h.api.GetEventsForBlockIDs(ctx, eventType, blockIDs)
eventEncodingVersion := req.GetEventEncodingVersion()

results, err := h.api.GetEventsForBlockIDs(ctx, eventType, blockIDs, eventEncodingVersion)
if err != nil {
return nil, err
}
Expand Down
13 changes: 10 additions & 3 deletions access/legacy/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package handler
import (
"context"

"github.com/onflow/flow/protobuf/go/flow/entities"
accessproto "github.com/onflow/flow/protobuf/go/flow/legacy/access"
entitiesproto "github.com/onflow/flow/protobuf/go/flow/legacy/entities"
"google.golang.org/grpc/codes"
Expand Down Expand Up @@ -189,7 +190,13 @@ func (h *Handler) GetTransactionResult(
) (*accessproto.TransactionResultResponse, error) {
id := convert.MessageToIdentifier(req.GetId())

result, err := h.api.GetTransactionResult(ctx, id, flow.ZeroID, flow.ZeroID)
result, err := h.api.GetTransactionResult(
ctx,
id,
flow.ZeroID,
flow.ZeroID,
entities.EventEncodingVersion_JSON_CDC_V0,
)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -313,7 +320,7 @@ func (h *Handler) GetEventsForHeightRange(
startHeight := req.GetStartHeight()
endHeight := req.GetEndHeight()

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

results, err := h.api.GetEventsForBlockIDs(ctx, eventType, blockIDs)
results, err := h.api.GetEventsForBlockIDs(ctx, eventType, blockIDs, entities.EventEncodingVersion_JSON_CDC_V0)
if err != nil {
return nil, err
}
Expand Down
Loading
Loading