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 core-contracts to latest cadence 1.0 version #5064

Merged
merged 8 commits into from
Dec 11, 2023

Conversation

joshuahannan
Copy link
Member

@joshuahannan joshuahannan commented Nov 27, 2023

Updates to the latest cadence 1.0 version of the token standards and core contracts

This is needed to a new version of the cadence 1.0 CLI and emulator release

@codecov-commenter
Copy link

codecov-commenter commented Nov 28, 2023

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (08e9a24) 50.60% compared to head (e3b8d3c) 55.52%.

Files Patch % Lines
utils/unittest/execution_state.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@                    Coverage Diff                     @@
##           feature/stable-cadence    #5064      +/-   ##
==========================================================
+ Coverage                   50.60%   55.52%   +4.92%     
==========================================================
  Files                         310      922     +612     
  Lines                       32987    85648   +52661     
==========================================================
+ Hits                        16694    47559   +30865     
- Misses                      15021    34479   +19458     
- Partials                     1272     3610    +2338     
Flag Coverage Δ
unittests 55.52% <0.00%> (+4.92%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@joshuahannan joshuahannan changed the title update core-contracts to latest version Update core-contracts to latest cadence 1.0 version Nov 28, 2023
@joshuahannan
Copy link
Member Author

I'm not sure why the CI is failing, the results don't load for me. Anyone know what we need to do?

@jordanschalm
Copy link
Member

I'm not sure why the CI is failing, the results don't load for me. Anyone know what we need to do?

It looks like the execution tests with constants for expected state commitments:

  • Test_ExecutingSystemCollection
  • TestBootstrapLedger
  • TestExecutionFlow

You'll need to change the state commitment constant in the code to the new state commitment, after the smart contract updated, which will be printed in the error message from the test. Here's an example PR where I did this recently: #5027. Changes are in:

  • engine/execution/state/bootstrap/bootstrap_test.go
  • utils/unittest/execution_state.go

@joshuahannan
Copy link
Member Author

anyone know what this error means?

panic: 

mock: Unexpected Method Call
-----------------------------

ExecutionTransactionExecuted(time.Duration,int,uint64,uint64,int,int,bool)
		0: 24058000
		1: 1
		2: 0x102
		3: 0xd64dd2
		4: 3
		5: 1465
		6: false

The closest call I have is: 

ExecutionTransactionExecuted(string,string,string,string,int,int,bool)
		0: "mock.Anything"
		1: "mock.Anything"
		2: "mock.Anything"
		3: "mock.Anything"
		4: 3
		5: 1421
		6: false


Diff: 0: PASS:  (time.Duration=24.058ms) == (string=mock.Anything)
	1: PASS:  (int=1) == (string=mock.Anything)
	2: PASS:  (uint64=258) == (string=mock.Anything)
	3: PASS:  (uint64=14044626) == (string=mock.Anything)
	4: PASS:  (int=3) == (int=3)
	5: FAIL:  (int=1465) != (int=1421)
	6: PASS:  (bool=false) == (bool=false)

goroutine 239 [running]:
github.com/stretchr/testify/mock.(*Mock).fail(0x14000b2fa40, {0x101cdf659?, 0x140008b5ce0?}, {0x1400169c200?, 0x7?, 0x7?})
	/opt/homebrew/opt/go@1.20/bin/pkg/mod/github.com/stretchr/testify@v1.8.4/mock/mock.go:332 +0x15c
github.com/stretchr/testify/mock.(*Mock).MethodCalled(0x14000b2fa40, {0x10255ab9e, 0x1c}, {0x140003a6000, 0x7, 0x7})
	/opt/homebrew/opt/go@1.20/bin/pkg/mod/github.com/stretchr/testify@v1.8.4/mock/mock.go:492 +0x500
github.com/stretchr/testify/mock.(*Mock).Called(0x5b9?, {0x140003a6000, 0x7, 0x7})
	/opt/homebrew/opt/go@1.20/bin/pkg/mod/github.com/stretchr/testify@v1.8.4/mock/mock.go:464 +0x114
github.com/onflow/flow-go/module/mock.(*ExecutionMetrics).ExecutionTransactionExecuted(0x14000b2fa40, 0x140002a6201?, 0x0?, 0x0?, 0x0?, 0x140006d6200?, 0x124?, 0x0)
	/Users/joshuahannan/dapperlabs/flow/flow-go/module/mock/execution_metrics.go:101 +0x22c
github.com/onflow/flow-go/engine/execution/computation/computer.(*resultCollector).processTransactionResult(_, {{{0xd, 0x33, 0x97, 0x74, 0x3d, 0x1, 0x3d, 0xbf, 0xe3, ...}, ...}, ...}, ...)
	/Users/joshuahannan/dapperlabs/flow/flow-go/engine/execution/computation/computer/result_collector.go:254 +0x8fc
github.com/onflow/flow-go/engine/execution/computation/computer.(*resultCollector).runResultProcessor(0x140025854a0)
	/Users/joshuahannan/dapperlabs/flow/flow-go/engine/execution/computation/computer/result_collector.go:328 +0x1d8
created by github.com/onflow/flow-go/engine/execution/computation/computer.newResultCollector
	/Users/joshuahannan/dapperlabs/flow/flow-go/engine/execution/computation/computer/result_collector.go:127 +0x7cc
FAIL	github.com/onflow/flow-go/engine/execution/computation/computer	0.814s

@jordanschalm
Copy link
Member

anyone know what this error means?

@joshuahannan It's expecting that mock function to be called with particular arguments. But the eventSize argument is different:

	5: FAIL:  (int=1465) != (int=1421)

I pushed this commit to your branch which should fix that test: 5d7a937

@joshuahannan
Copy link
Member Author

okay, everything is passing locally for me when I run make test

@joshuahannan
Copy link
Member Author

How do I run all the other CI tests?

@jordanschalm
Copy link
Member

How do I run all the other CI tests?

I think these are not running because the feature branch hasn't been updated to include some CI changes @gomisha did recently. Last change on the feature branch CI config is 3 months ago, last change on master is 3 weeks ago.

I don't completely understand how GH Actions decides which ci.yml(s) to use, but it seems like here it is using both the CI jobs from your branch (same as the feature branch) and from master (because it is the default branch (?) ). My assumption is syncing the feature branch with master, then merging this PR would unblock you. Misha is also back on Monday, and can help here.

@turbolent
Copy link
Member

Updated the feature branch in #5102. Once merged, and this PR has in turn merged in/rebased on the feature branch, CI should work again