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

CCIP-4703: Adding check for ChainFeeUpdates field #410

Merged
merged 22 commits into from
Jan 13, 2025
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
4addc48
CCIP-4703: Adding check for ChainFeeUpdates field
b-gopalswami Dec 30, 2024
a28b6b7
Merge branch 'main' of github.com:smartcontractkit/chainlink-ccip int…
b-gopalswami Dec 31, 2024
5bcb9b8
Separating observed chains validation
b-gopalswami Dec 31, 2024
5146533
Lint
b-gopalswami Dec 31, 2024
b36980f
go mod tidy
b-gopalswami Dec 31, 2024
7cb45b1
Merge branch 'main' of github.com:smartcontractkit/chainlink-ccip int…
b-gopalswami Jan 6, 2025
22de002
review comments and adding unit test
b-gopalswami Jan 6, 2025
eaf6b01
Lint fix
b-gopalswami Jan 6, 2025
adf719d
goimports with local
b-gopalswami Jan 6, 2025
053c08f
Merge branch 'main' into cl33-07
b-gopalswami Jan 7, 2025
8a43f25
Merge branch 'main' of github.com:smartcontractkit/chainlink-ccip int…
b-gopalswami Jan 8, 2025
941d029
adding additional checks per review
b-gopalswami Jan 8, 2025
0df3535
Merge branch 'cl33-07' of github.com:smartcontractkit/chainlink-ccip …
b-gopalswami Jan 8, 2025
a0ac3ea
Lint fix
b-gopalswami Jan 8, 2025
9cb84c1
Trigger workflow with dummy commit
b-gopalswami Jan 9, 2025
960a2e8
Add filter by intersecting unique chains
b-gopalswami Jan 9, 2025
a3acd67
lint
b-gopalswami Jan 10, 2025
b9a20ab
Merge branch 'main' of github.com:smartcontractkit/chainlink-ccip int…
b-gopalswami Jan 10, 2025
deac5db
Fix chain fee validation.
asoliman92 Jan 13, 2025
cb2ed66
linting
asoliman92 Jan 13, 2025
71c5c6a
Merge branch 'main' into cl33-07
asoliman92 Jan 13, 2025
f1b4bb2
Merge branch 'main' into cl33-07
b-gopalswami Jan 13, 2025
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
10 changes: 10 additions & 0 deletions commit/chainfee/validate_observation.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"golang.org/x/exp/maps"
)

func (p *processor) ValidateObservation(

Check failure on line 12 in commit/chainfee/validate_observation.go

View workflow job for this annotation

GitHub Actions / build-lint-test

cyclomatic complexity 18 of func `(*processor).ValidateObservation` is high (> 13) (gocyclo)
_ Outcome,
_ Query,
ao plugincommon.AttributedObservation[Observation],
Expand Down Expand Up @@ -50,5 +50,15 @@
}
}

for _, update := range obs.ChainFeeUpdates {
if update.ChainFee.ExecutionFeePriceUSD == nil || update.ChainFee.ExecutionFeePriceUSD.Cmp(zero) <= 0 {
return fmt.Errorf("nil or non-positive %s", "execution fee price")
}

b-gopalswami marked this conversation as resolved.
Show resolved Hide resolved
if update.ChainFee.DataAvFeePriceUSD == nil || update.ChainFee.DataAvFeePriceUSD.Cmp(zero) < 0 {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this DataAvFeePriceUSD might be zero for EVM chain and shouldn't be zero for L2 chains. Is that right? If at all we can know the given chain is L2, then we can add additional check here.

return fmt.Errorf("nil or negative %s", "data availability fee price")
}
}

return nil
}
Loading