Skip to content

Commit

Permalink
Merge branch 'master' into ramtin/evm-offchain-part2
Browse files Browse the repository at this point in the history
  • Loading branch information
ramtinms authored Oct 16, 2024
2 parents 85d74fa + 0dde730 commit d6bd00e
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 30 deletions.
1 change: 1 addition & 0 deletions .github/workflows/builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ jobs:
docker-push:
name: ${{ matrix.role }} images
runs-on: ubuntu-latest
environment: Production Docker Registry
needs: matrix_builder

# setup jobs for each role
Expand Down
19 changes: 15 additions & 4 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
name: CD

on:
push:
tags:
- '*'
- "!daily-*"
# Workflow dispatch for now, while we're testing environments
# push:
# tags:
# - '*'
# - "!daily-*"
workflow_dispatch:
inputs:
tag:
description: 'Tag/commit'
required: true
type: string


env:
GO_VERSION: "1.22"
Expand All @@ -13,6 +21,7 @@ jobs:
docker-push:
name: Push to container registry
runs-on: ubuntu-latest
environment: Production Docker Registry
steps:
- name: Setup Go
uses: actions/setup-go@v4
Expand All @@ -21,6 +30,8 @@ jobs:
go-version: ${{ env.GO_VERSION }}
- name: Checkout repo
uses: actions/checkout@v2
with:
ref: ${{ inputs.tag }}
# Provide Google Service Account credentials to Github Action, allowing interaction with the Google Container Registry
# Logging in as github-actions@dl-flow.iam.gserviceaccount.com
- id: auth
Expand Down
21 changes: 8 additions & 13 deletions engine/common/requester/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -421,15 +421,6 @@ func (e *Engine) dispatchRequest() (bool, error) {
}
e.requests[req.Nonce] = req

if e.log.Debug().Enabled() {
e.log.Debug().
Hex("provider", logging.ID(providerID)).
Uint64("nonce", req.Nonce).
Strs("entities", logging.IDs(entityIDs)).
TimeDiff("duration", time.Now(), requestStart).
Msg("entity request sent")
}

// NOTE: we forget about requests after the expiry of the shortest retry time
// from the entities in the list; this means that we purge requests aggressively.
// However, most requests should be responded to on the first attempt and clearing
Expand All @@ -443,11 +434,15 @@ func (e *Engine) dispatchRequest() (bool, error) {
delete(e.requests, req.Nonce)
}()

if e.log.Debug().Enabled() {
e.log.Debug().
Hex("provider", logging.ID(providerID)).
Uint64("nonce", req.Nonce).
Strs("entities", logging.IDs(entityIDs)).
TimeDiff("duration", time.Now(), requestStart).
Msg("entity request sent")
}
e.metrics.MessageSent(e.channel.String(), metrics.MessageEntityRequest)
e.log.Debug().
Uint64("nonce", req.Nonce).
Strs("entity_ids", flow.IdentifierList(req.EntityIDs).Strings()).
Msg("entity request sent")

return true, nil
}
Expand Down
8 changes: 4 additions & 4 deletions fvm/evm/types/result.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func (res *Result) RLPEncodedLogs() ([]byte, error) {
if len(res.Logs) > 0 {
encodedLogs, err = rlp.EncodeToBytes(res.Logs)
if err != nil {
return nil, err
return encodedLogs, err
}
}
return encodedLogs, nil
Expand All @@ -170,11 +170,11 @@ func (res *Result) DeployedContractAddressString() string {
// StateChangeChecksum constructs a checksum
// based on the state change commitment on the result
func (res *Result) StateChangeChecksum() [ChecksumLength]byte {
return BytesToChecksum(res.StateChangeCommitment)
return SliceToChecksumLength(res.StateChangeCommitment)
}

// BytesToChecksum cuts the first 4 bytes of the input and convert it into checksum
func BytesToChecksum(input []byte) [ChecksumLength]byte {
// SliceToChecksumLength cuts the first 4 bytes of the input and convert it into checksum
func SliceToChecksumLength(input []byte) [ChecksumLength]byte {
// the first 4 bytes of StateChangeCommitment is used as checksum
var checksum [ChecksumLength]byte
if len(input) >= ChecksumLength {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ require (
github.com/multiformats/go-multiaddr-dns v0.3.1
github.com/multiformats/go-multihash v0.2.3
github.com/onflow/atree v0.8.0-rc.6
github.com/onflow/cadence v1.0.0
github.com/onflow/cadence v1.0.1
github.com/onflow/crypto v0.25.2
github.com/onflow/flow v0.3.4
github.com/onflow/flow-core-contracts/lib/go/contracts v1.3.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2171,8 +2171,8 @@ github.com/onflow/atree v0.8.0-rc.6/go.mod h1:yccR+LR7xc1Jdic0mrjocbHvUD7lnVvg8/
github.com/onflow/boxo v0.0.0-20240201202436-f2477b92f483 h1:LpiQhTAfM9CAmNVEs0n//cBBgCg+vJSiIxTHYUklZ84=
github.com/onflow/boxo v0.0.0-20240201202436-f2477b92f483/go.mod h1:pIZgTWdm3k3pLF9Uq6MB8JEcW07UDwNJjlXW1HELW80=
github.com/onflow/cadence v1.0.0-M3/go.mod h1:odXGZZ/wGNA5mwT8bC9v8u8EXACHllB2ABSZK65TGL8=
github.com/onflow/cadence v1.0.0 h1:bvT75F2LZJvDCBmmajAv7QLISK6Qp30FAKcSwqNNH+o=
github.com/onflow/cadence v1.0.0/go.mod h1:7wvvecnAZtYOspLOS3Lh+FuAmMeSrXhAWiycC3kQ1UU=
github.com/onflow/cadence v1.0.1 h1:Vv/txHQsaT5BzS14SrsMRQgj164JdNVKafekXrZ5Fx4=
github.com/onflow/cadence v1.0.1/go.mod h1:7wvvecnAZtYOspLOS3Lh+FuAmMeSrXhAWiycC3kQ1UU=
github.com/onflow/crypto v0.25.0/go.mod h1:C8FbaX0x8y+FxWjbkHy0Q4EASCDR9bSPWZqlpCLYyVI=
github.com/onflow/crypto v0.25.2 h1:GjHunqVt+vPcdqhxxhAXiMIF3YiLX7gTuTR5O+VG2ns=
github.com/onflow/crypto v0.25.2/go.mod h1:fY7eLqUdMKV8EGOw301unP8h7PvLVy8/6gVR++/g0BY=
Expand Down
2 changes: 1 addition & 1 deletion insecure/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ require (
github.com/nxadm/tail v1.4.8 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/onflow/atree v0.8.0-rc.6 // indirect
github.com/onflow/cadence v1.0.0 // indirect
github.com/onflow/cadence v1.0.1 // indirect
github.com/onflow/flow-core-contracts/lib/go/contracts v1.3.1 // indirect
github.com/onflow/flow-core-contracts/lib/go/templates v1.3.1 // indirect
github.com/onflow/flow-ft/lib/go/contracts v1.0.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions insecure/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2159,8 +2159,8 @@ github.com/onflow/atree v0.6.1-0.20230711151834-86040b30171f/go.mod h1:xvP61FoOs
github.com/onflow/atree v0.8.0-rc.6 h1:GWgaylK24b5ta2Hq+TvyOF7X5tZLiLzMMn7lEt59fsA=
github.com/onflow/atree v0.8.0-rc.6/go.mod h1:yccR+LR7xc1Jdic0mrjocbHvUD7lnVvg8/Ct1AA5zBo=
github.com/onflow/cadence v1.0.0-M3/go.mod h1:odXGZZ/wGNA5mwT8bC9v8u8EXACHllB2ABSZK65TGL8=
github.com/onflow/cadence v1.0.0 h1:bvT75F2LZJvDCBmmajAv7QLISK6Qp30FAKcSwqNNH+o=
github.com/onflow/cadence v1.0.0/go.mod h1:7wvvecnAZtYOspLOS3Lh+FuAmMeSrXhAWiycC3kQ1UU=
github.com/onflow/cadence v1.0.1 h1:Vv/txHQsaT5BzS14SrsMRQgj164JdNVKafekXrZ5Fx4=
github.com/onflow/cadence v1.0.1/go.mod h1:7wvvecnAZtYOspLOS3Lh+FuAmMeSrXhAWiycC3kQ1UU=
github.com/onflow/crypto v0.25.0/go.mod h1:C8FbaX0x8y+FxWjbkHy0Q4EASCDR9bSPWZqlpCLYyVI=
github.com/onflow/crypto v0.25.2 h1:GjHunqVt+vPcdqhxxhAXiMIF3YiLX7gTuTR5O+VG2ns=
github.com/onflow/crypto v0.25.2/go.mod h1:fY7eLqUdMKV8EGOw301unP8h7PvLVy8/6gVR++/g0BY=
Expand Down
2 changes: 1 addition & 1 deletion integration/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ require (
github.com/ipfs/go-ds-badger2 v0.1.3
github.com/ipfs/go-ds-pebble v0.3.1-0.20240828032824-d745b9d3200b
github.com/libp2p/go-libp2p v0.32.2
github.com/onflow/cadence v1.0.0
github.com/onflow/cadence v1.0.1
github.com/onflow/crypto v0.25.2
github.com/onflow/flow-core-contracts/lib/go/contracts v1.3.1
github.com/onflow/flow-core-contracts/lib/go/templates v1.3.1
Expand Down
4 changes: 2 additions & 2 deletions integration/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2144,8 +2144,8 @@ github.com/onflow/atree v0.6.1-0.20230711151834-86040b30171f/go.mod h1:xvP61FoOs
github.com/onflow/atree v0.8.0-rc.6 h1:GWgaylK24b5ta2Hq+TvyOF7X5tZLiLzMMn7lEt59fsA=
github.com/onflow/atree v0.8.0-rc.6/go.mod h1:yccR+LR7xc1Jdic0mrjocbHvUD7lnVvg8/Ct1AA5zBo=
github.com/onflow/cadence v1.0.0-M3/go.mod h1:odXGZZ/wGNA5mwT8bC9v8u8EXACHllB2ABSZK65TGL8=
github.com/onflow/cadence v1.0.0 h1:bvT75F2LZJvDCBmmajAv7QLISK6Qp30FAKcSwqNNH+o=
github.com/onflow/cadence v1.0.0/go.mod h1:7wvvecnAZtYOspLOS3Lh+FuAmMeSrXhAWiycC3kQ1UU=
github.com/onflow/cadence v1.0.1 h1:Vv/txHQsaT5BzS14SrsMRQgj164JdNVKafekXrZ5Fx4=
github.com/onflow/cadence v1.0.1/go.mod h1:7wvvecnAZtYOspLOS3Lh+FuAmMeSrXhAWiycC3kQ1UU=
github.com/onflow/crypto v0.25.0/go.mod h1:C8FbaX0x8y+FxWjbkHy0Q4EASCDR9bSPWZqlpCLYyVI=
github.com/onflow/crypto v0.25.2 h1:GjHunqVt+vPcdqhxxhAXiMIF3YiLX7gTuTR5O+VG2ns=
github.com/onflow/crypto v0.25.2/go.mod h1:fY7eLqUdMKV8EGOw301unP8h7PvLVy8/6gVR++/g0BY=
Expand Down

0 comments on commit d6bd00e

Please sign in to comment.