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

Docker updates to build and run #696

Open
wants to merge 200 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
200 commits
Select commit Hold shift + click to select a range
0446472
clenup of event subscriber
janezpodhostnik Oct 29, 2024
c9d3752
pull start height out of event subscriber
janezpodhostnik Oct 29, 2024
bc3b99b
remove heartbeat interval setting
janezpodhostnik Oct 30, 2024
30fe324
Aggregate and expose EVM-related event payloads
m-Peter Oct 25, 2024
eaf0db2
Implement BlockProvider for block snapshotting
m-Peter Oct 28, 2024
d8e1146
remove traces
janezpodhostnik Oct 30, 2024
9a9604b
removed traces settings from the readme
janezpodhostnik Oct 31, 2024
f12cebc
Add special EVM height handling
janezpodhostnik Nov 1, 2024
0aff71c
split tests
janezpodhostnik Nov 1, 2024
97ba7d7
Simplify added test files
m-Peter Nov 4, 2024
4be3166
Simplify usage of FixedHash field on Block type
m-Peter Nov 4, 2024
72d2891
add register storage
janezpodhostnik Oct 30, 2024
2198eed
register storage fix lookup and remove owner
janezpodhostnik Oct 31, 2024
04a6806
register store add tests
janezpodhostnik Nov 1, 2024
bb847c5
separate delta and index
janezpodhostnik Nov 5, 2024
dc486bc
add more comments
janezpodhostnik Nov 5, 2024
2bfd1eb
address comments
janezpodhostnik Nov 5, 2024
55c2ba7
extract cached register snapshot
janezpodhostnik Nov 6, 2024
5a8de37
Update storage/pebble/register_storage.go
janezpodhostnik Nov 7, 2024
7e56601
add comment
janezpodhostnik Nov 7, 2024
e7030cd
Integrate & incorporate flow-go's onchain package
m-Peter Nov 4, 2024
64d33e0
Implement RemoteCadenceArch type for fetching precompiled calls in co…
m-Peter Nov 4, 2024
18045bf
swap storage
janezpodhostnik Nov 6, 2024
69bba54
Add no-op implementation for RegisterDelta.AllocateSlabIndex
m-Peter Nov 7, 2024
a63925e
Extract method for detecting whether the tracer config is equal to th…
m-Peter Nov 7, 2024
3d981d4
Remove StateDB from BlockExecutor
m-Peter Nov 7, 2024
c3e83ab
Remove out-dated comment regarding precompiles
m-Peter Nov 7, 2024
c2524d7
Move tracer assignment in blockContext method
m-Peter Nov 7, 2024
d7b86ee
Remove receipt return value from BlockExecutor.Run
m-Peter Nov 7, 2024
0071555
Check that txTracer is not nil before getting the result
m-Peter Nov 7, 2024
b74a3ab
use batch to init blocks
janezpodhostnik Nov 7, 2024
e068017
fix db init issue in tests
janezpodhostnik Nov 7, 2024
20f3c2b
Simplify condition in TraceBlockByNumber
m-Peter Nov 7, 2024
5f1f05f
Extract common methods for resolving RPC block tags into a utils file
m-Peter Nov 8, 2024
7ca9956
Move down creation of tracers.Context object
m-Peter Nov 8, 2024
e504092
Move caching of returned data from precompiled call to runCall method
m-Peter Nov 8, 2024
3c8ed31
Change evm height in requester to uint64
m-Peter Nov 8, 2024
11e4b99
Simplify Requester API interface
m-Peter Nov 11, 2024
9576606
Remove dead code from Requester
m-Peter Nov 11, 2024
f91ec40
Remove unused const
m-Peter Nov 11, 2024
2a4444f
Move dryRunScript var to RemoteCadenceArch and bump the gas limit
m-Peter Nov 11, 2024
ec9f40a
Extract replaceAddresses helper function to its own file for re-usabi…
m-Peter Nov 11, 2024
4760f2b
Minor improvements for resolveBlockTag function
m-Peter Nov 11, 2024
0ea0c6f
Simplify Requester initialization from bootstrap
m-Peter Nov 11, 2024
20455c7
Simplify DebugAPI initialization from bootstrap
m-Peter Nov 11, 2024
e0d0150
Move hard-coded values to constants
m-Peter Nov 11, 2024
e1b6506
Minor improvements for DebugAPI
m-Peter Nov 11, 2024
7ad6089
Remove redundant error return value from BlockExecutor constructor
m-Peter Nov 11, 2024
c5083dc
Minor improvements for event ingestion engine
m-Peter Nov 11, 2024
1daf28a
Minor improvements for CallTracerCollector
m-Peter Nov 11, 2024
be3728d
Remove Cadence script caching from Requester
m-Peter Nov 11, 2024
2c663f4
Properly initialize trace call config in debug_traceCall
m-Peter Nov 11, 2024
a0aa458
Add test case for debug_traceTransaction with Cadence arch call
m-Peter Nov 11, 2024
603cd32
Enable Cadence Arch calls for debug_traceCall
m-Peter Nov 11, 2024
b4368e1
Remove unused embed import
m-Peter Nov 12, 2024
b54fb43
Move gas limit for Cadence Arch call to a named constant
m-Peter Nov 12, 2024
fb097d6
Better handling of errors for stored default call traces
m-Peter Nov 12, 2024
dfcfdb0
Storage fixes
janezpodhostnik Nov 7, 2024
4bc7382
remove additional locks
janezpodhostnik Nov 8, 2024
5d29b0b
address review comments
janezpodhostnik Nov 12, 2024
4be38cd
Move eth related types to their own package to avoid import cycle errors
m-Peter Nov 13, 2024
9c069d7
Support state overrides for eth_call & eth_estimateGas
m-Peter Nov 13, 2024
c33b372
Extract the common logic from Call & EstimateGas in dryRunTx helper m…
m-Peter Nov 13, 2024
5c38a0f
batch get events when backfilling
janezpodhostnik Nov 8, 2024
78abedb
cleanup
janezpodhostnik Nov 13, 2024
019fdd2
fix test and bug
janezpodhostnik Nov 13, 2024
2e41206
temp skip test
janezpodhostnik Nov 13, 2024
3bfbe7b
address review comments
janezpodhostnik Nov 13, 2024
99c8faa
unskip tests
janezpodhostnik Nov 14, 2024
a9fe319
Fix wrong block hash value for the 1st EVM block with PrevRandao
m-Peter Nov 19, 2024
1949a0a
Refactor re-execution
janezpodhostnik Nov 14, 2024
7627b4e
Remove transactions mutex
janezpodhostnik Nov 20, 2024
6727d4a
Merge pull request #668 from onflow/janez/remove-transaction-mutex
janezpodhostnik Nov 20, 2024
646c16b
Add debug_flowHeight API endpoint
janezpodhostnik Nov 20, 2024
575017b
update readme
janezpodhostnik Nov 20, 2024
e61ac1c
apply review comments
janezpodhostnik Nov 20, 2024
ca18d33
Handle ingestion of missing EVM.BlockExecuted event in backfill process
m-Peter Nov 19, 2024
a22b951
Add more unit tests for NewSingleBlockEvents & NewMultiBlockEvents me…
m-Peter Nov 20, 2024
0974579
Merge pull request #664 from onflow/mpeter/handle-missing-evm-block-e…
m-Peter Nov 21, 2024
0fff9b1
renamed method
janezpodhostnik Nov 21, 2024
dd2b134
Merge pull request #669 from onflow/janez/flow-block-height
janezpodhostnik Nov 21, 2024
b6d5e55
Use offchain package to create block context
janezpodhostnik Nov 21, 2024
3c3d9e9
update emulator
janezpodhostnik Nov 21, 2024
747a4ad
update dependencies
janezpodhostnik Nov 22, 2024
54a4184
Merge pull request #670 from onflow/janez/update-blocks-provider
zhangchiqing Nov 22, 2024
7d1c55d
update flow-go
janezpodhostnik Nov 25, 2024
10dbeca
update emulator
janezpodhostnik Nov 25, 2024
0de5ef9
Merge pull request #673 from onflow/janez/update-flow-go
janezpodhostnik Nov 25, 2024
39812e5
Use a constant backoff retry strategy for retrieving the Flow transac…
m-Peter Nov 25, 2024
01bb8e7
Merge pull request #672 from onflow/mpeter/update-backoff-retry-strategy
m-Peter Nov 26, 2024
537379c
Cleanup cmd
janezpodhostnik Nov 26, 2024
eb05840
Merge pull request #675 from onflow/janez/switch-to-component
janezpodhostnik Nov 26, 2024
e737742
Rework gas estimation logic to find the lower gas limit at which a tr…
m-Peter Nov 21, 2024
512533d
Add note for binary search algorithm used for EstimateGas
m-Peter Nov 26, 2024
227f57e
Always return error from dry-run with highest allowed gas limit
m-Peter Nov 26, 2024
31ecd72
Remove completely the create_coa.cdc transaction as it is not necessary
m-Peter Nov 26, 2024
d8fa7a2
Fix race for startingBlock field of eth_syncing endpoint
m-Peter Nov 27, 2024
70e7f9e
Fix closing channel twice
janezpodhostnik Nov 27, 2024
c98427b
Merge pull request #680 from onflow/janez/fix-double-channel-closure
janezpodhostnik Nov 27, 2024
565e344
switch to flow-go metrics server
janezpodhostnik Nov 26, 2024
5499cc2
Seperate creating and closing pebbleDB from storage
janezpodhostnik Nov 26, 2024
7286060
Close the AN clients
janezpodhostnik Nov 26, 2024
df1750c
fix tidy
janezpodhostnik Nov 27, 2024
5b77d7b
Change import name
janezpodhostnik Nov 27, 2024
528bd94
Merge pull request #678 from onflow/janez/close-clients
janezpodhostnik Nov 27, 2024
ec3fd4b
Merge pull request #679 from onflow/mpeter/fix-eth-syncing-starting-h…
m-Peter Nov 27, 2024
b57e3e0
Merge pull request #674 from onflow/mpeter/fix-coa-creation-tx
m-Peter Nov 27, 2024
6d11b34
Merge pull request #671 from onflow/mpeter/improve-gas-estimation-logic
m-Peter Nov 27, 2024
15cbe70
Revert "Improve gas estimation logic for `eth_estimateGas`"
peterargue Nov 28, 2024
2825b58
Merge pull request #687 from onflow/revert-671-mpeter/improve-gas-est…
peterargue Nov 28, 2024
3e669d1
Switch from config reference to instance
janezpodhostnik Nov 29, 2024
73ca87e
Merge pull request #689 from onflow/janez/config-instance-2
janezpodhostnik Dec 2, 2024
386044f
Revert "Merge pull request #687 from onflow/revert-671-mpeter/improve…
m-Peter Dec 1, 2024
0e107bf
Fix logical error in eth_estimateGas endpoint
m-Peter Dec 1, 2024
4b32ea8
Merge pull request #690 from onflow/mpeter/fix-gas-estimation-logic
m-Peter Dec 3, 2024
c503c78
add util to extract evm state
zhangchiqing Nov 26, 2024
e18dc70
updat flow-go
zhangchiqing Nov 26, 2024
9d7717c
update go.mod
zhangchiqing Nov 27, 2024
d3c813a
add extract EVM state tests
zhangchiqing Nov 27, 2024
3d9f862
fix replay
zhangchiqing Nov 27, 2024
e919eb8
fix lint
zhangchiqing Nov 27, 2024
6d38717
update tests
zhangchiqing Nov 27, 2024
dabec61
update version
zhangchiqing Nov 27, 2024
51d8b63
update version
zhangchiqing Nov 27, 2024
88f6aaa
update version
zhangchiqing Nov 27, 2024
efd5b1d
update version
zhangchiqing Nov 27, 2024
5248ae4
fix extraction
zhangchiqing Nov 27, 2024
1f74dd8
get account balance
zhangchiqing Nov 27, 2024
d0d687f
print account balance from base view
zhangchiqing Nov 27, 2024
e31bb06
update evm state extraction
zhangchiqing Nov 28, 2024
3a12658
tidy
zhangchiqing Dec 2, 2024
be1f5c1
update version
zhangchiqing Dec 3, 2024
c9eae96
update version
zhangchiqing Dec 5, 2024
467051a
revert changes to ingestion engine
zhangchiqing Dec 5, 2024
96c4472
go mod tidy
zhangchiqing Dec 5, 2024
5495113
fix lint add export evm state to cmd
zhangchiqing Dec 5, 2024
bf84136
fix lint
zhangchiqing Dec 5, 2024
c0bf024
Changes to simplify first time setup and docker usage
franklywatson Dec 5, 2024
bfab77e
Not needed
franklywatson Dec 5, 2024
3b517a0
Enable override
franklywatson Dec 5, 2024
d82dd34
Variable use consistency
franklywatson Dec 5, 2024
8d63c9f
nit
franklywatson Dec 5, 2024
968f54a
Correct image name
franklywatson Dec 5, 2024
1eeb2bf
Detach container by default
franklywatson Dec 5, 2024
dfb48e3
Update README
franklywatson Dec 6, 2024
21ab682
Split guidance into two lines
franklywatson Dec 6, 2024
a540d9c
Merge pull request #683 from onflow/leo/extract-evm-state
zhangchiqing Dec 6, 2024
c93e055
Return empty Logs array when block is empty
m-Peter Dec 6, 2024
b3224f6
Merge pull request #697 from onflow/mpeter/fix-eth-get-logs-response
j1010001 Dec 6, 2024
52e0b17
Use proper variable in E2E test file for logs filtering
m-Peter Dec 6, 2024
334a45f
Account for change made in Dockerfile to add $VERSION
franklywatson Dec 7, 2024
0679ffc
Improve usability and code
franklywatson Dec 7, 2024
3d0973f
Tidyup
franklywatson Dec 7, 2024
40b24a1
Fix mount issue
franklywatson Dec 7, 2024
aa76d88
Fix mount issue
franklywatson Dec 7, 2024
46bbe75
Fix mount issue
franklywatson Dec 7, 2024
61b0977
More troubleshooting mount
franklywatson Dec 7, 2024
a2d1792
More troubleshooting mount
franklywatson Dec 7, 2024
ea3e5cd
Fix for mount
franklywatson Dec 7, 2024
dc9daf2
Fix for mount
franklywatson Dec 7, 2024
7082eec
Resolved mount issue
franklywatson Dec 7, 2024
fdad063
Resolved mount issue
franklywatson Dec 7, 2024
b0207f1
Fix port access from other sources
franklywatson Dec 7, 2024
7e6c63e
Minimize heavy logging
franklywatson Dec 7, 2024
56f8b19
Merge pull request #698 from onflow/mpeter/fix-e2e-test-unused-variable
m-Peter Dec 8, 2024
a8fbdde
WIP updates to README
franklywatson Dec 8, 2024
c52d874
Additions for local docker build docker pull version
franklywatson Dec 8, 2024
03718df
No caching when local build
franklywatson Dec 8, 2024
29bebe3
Couple of changes to test local build
franklywatson Dec 8, 2024
1cc6775
Last tweaks and add redirect to main docs
franklywatson Dec 8, 2024
eb68bfa
Nits and remove traces-gcp-bucket config from options
franklywatson Dec 9, 2024
839e5d3
Added missing metrics-port config
franklywatson Dec 9, 2024
d82f71e
remove dupe
franklywatson Dec 9, 2024
d5b4c75
Fix docker-build-local and docker-run-local targets
franklywatson Dec 9, 2024
756a31b
Handle missing GOARCH for macs
franklywatson Dec 9, 2024
6188ee1
Add OS specific flags to go build
franklywatson Dec 9, 2024
76989f8
Enable GOARCH override if ENV var set
franklywatson Dec 10, 2024
3ed2b21
Support GAS_PRICE configuration and default amount
franklywatson Dec 10, 2024
36afe82
Fixed to make docker-run-local work
franklywatson Dec 10, 2024
9ec01a8
Open access to the right port for emulator
franklywatson Dec 10, 2024
a428439
Revert incorrect config
franklywatson Dec 10, 2024
8a515a3
Simplify variable assignment
franklywatson Dec 10, 2024
9df4d7d
Fix broken make targets for local compilation
franklywatson Dec 10, 2024
3cbe37c
Merge remote-tracking branch 'origin/jp/docker-fixes' into jp/docker-…
franklywatson Dec 10, 2024
ade4766
Fix missing compiler arg for Mac
franklywatson Dec 10, 2024
2425298
Remove duplicate variable setting and add ARCH flag
franklywatson Dec 10, 2024
a5a688d
Remove duplicate entries
franklywatson Dec 10, 2024
b5d6462
Specify host.docker.internal:3569 explicitly for the docker-run-local…
franklywatson Dec 10, 2024
1b2d9a1
Fix emulator startup warning message
franklywatson Dec 10, 2024
272ef11
Not needed
franklywatson Dec 11, 2024
56867b8
Image update to highlight cadence transaction arrow
franklywatson Dec 11, 2024
69770c9
Kill background emulator process before restart
franklywatson Dec 11, 2024
874be8a
Merged changes from feature/local-tx-reexecution branch
franklywatson Dec 11, 2024
407f708
Merged changes from feature/local-tx-reexecution branch
franklywatson Dec 12, 2024
af70a04
Fixed incorrect registry paths
franklywatson Dec 12, 2024
50cfcf3
Typo
franklywatson Dec 12, 2024
fddc38c
Fixes to work with mainnet
franklywatson Dec 12, 2024
bdcb06b
Add system.d example files
franklywatson Dec 12, 2024
68ccadc
Fixed dangling comment line
franklywatson Dec 12, 2024
220105a
Fix missing docker pull
franklywatson Dec 13, 2024
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
13 changes: 13 additions & 0 deletions api/debug.go
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@ import (

"github.com/goccy/go-json"
"github.com/onflow/flow-go/fvm/evm/offchain/query"
"github.com/onflow/flow-go/fvm/evm/types"
gethCommon "github.com/onflow/go-ethereum/common"
"github.com/onflow/go-ethereum/eth/tracers"
"github.com/onflow/go-ethereum/eth/tracers/logger"
@@ -19,6 +20,7 @@ import (
"github.com/onflow/flow-evm-gateway/models"
"github.com/onflow/flow-evm-gateway/services/evm"
"github.com/onflow/flow-evm-gateway/services/replayer"
"github.com/onflow/flow-evm-gateway/services/requester"
"github.com/onflow/flow-evm-gateway/storage"
"github.com/onflow/flow-evm-gateway/storage/pebble"
flowEVM "github.com/onflow/flow-go/fvm/evm"
@@ -43,6 +45,7 @@ type DebugAPI struct {
blocks storage.BlockIndexer
transactions storage.TransactionIndexer
receipts storage.ReceiptIndexer
client *requester.CrossSporkClient
config *config.Config
collector metrics.Collector
}
@@ -53,6 +56,7 @@ func NewDebugAPI(
blocks storage.BlockIndexer,
transactions storage.TransactionIndexer,
receipts storage.ReceiptIndexer,
client *requester.CrossSporkClient,
config *config.Config,
logger zerolog.Logger,
collector metrics.Collector,
@@ -64,6 +68,7 @@ func NewDebugAPI(
blocks: blocks,
transactions: transactions,
receipts: receipts,
client: client,
config: config,
collector: collector,
}
@@ -261,6 +266,11 @@ func (d *DebugAPI) TraceCall(
return nil, err
}

cdcHeight, err := d.blocks.GetCadenceHeight(height)
if err != nil {
return nil, err
}

block, err := d.blocks.GetByHeight(height)
if err != nil {
return nil, err
@@ -288,8 +298,11 @@ func (d *DebugAPI) TraceCall(
if tx.To != nil {
to = *tx.To
}
rca := requester.NewRemoteCadenceArch(cdcHeight, d.client, d.config.FlowNetworkID)

opts := []query.DryCallOption{}
opts = append(opts, query.WithTracer(tracer))
opts = append(opts, query.WithExtraPrecompiledContracts([]types.PrecompiledContract{rca}))
if config.StateOverrides != nil {
for addr, account := range *config.StateOverrides {
// Override account nonce.
1 change: 1 addition & 0 deletions bootstrap/bootstrap.go
Original file line number Diff line number Diff line change
@@ -285,6 +285,7 @@ func (b *Bootstrap) StartAPIServer(ctx context.Context) error {
b.storages.Blocks,
b.storages.Transactions,
b.storages.Receipts,
b.client,
b.config,
b.logger,
b.collector,
50 changes: 50 additions & 0 deletions tests/web3js/debug_traces_test.js
Original file line number Diff line number Diff line change
@@ -511,4 +511,54 @@ it('should retrieve call traces', async () => {
callTrace.output,
'0x00000000000000000000000000000000000000000000000000000000000005dc'
)

let flowBlockHeightData = deployed.contract.methods.verifyArchCallToFlowBlockHeight().encodeABI()
traceCall = {
from: conf.eoa.address,
to: contractAddress,
gas: '0xcdd4',
data: flowBlockHeightData,
value: '0x0',
gasPrice: web3.utils.toHex(conf.minGasPrice),
}

callTracer = {
tracer: 'callTracer',
tracerConfig: {
onlyTopCall: false
}
}

response = await helpers.callRPCMethod(
'debug_traceCall',
[traceCall, web3.utils.toHex(latestHeight), callTracer]
)
assert.equal(response.status, 200)
assert.isDefined(response.body)

callTrace = response.body.result
assert.deepEqual(
callTrace,
{
from: conf.eoa.address.toLowerCase(),
gas: '0xcdd4',
gasUsed: '0xbdd4',
to: contractAddress.toLowerCase(),
input: '0xc550f90f',
output: '0x0000000000000000000000000000000000000000000000000000000000000007',
calls: [
{
from: contractAddress.toLowerCase(),
gas: '0x6d44',
gasUsed: '0x5c8f',
to: '0x0000000000000000000000010000000000000001',
input: '0x53e87d66',
output: '0x0000000000000000000000000000000000000000000000000000000000000007',
type: 'STATICCALL'
}
],
value: '0x0',
type: 'CALL'
}
)
})