Skip to content

Address a bug with message during instantiation.#4366

Merged
MathieuDutSik merged 1 commit intolinera-io:mainfrom
MathieuDutSik:msg_instantiation
Aug 26, 2025
Merged

Address a bug with message during instantiation.#4366
MathieuDutSik merged 1 commit intolinera-io:mainfrom
MathieuDutSik:msg_instantiation

Conversation

@MathieuDutSik
Copy link
Contributor

Motivation

The scenario of a smart contract emitting a message during instantiation breaks the TestValidator framework.
We address the problem here.

Fixes #3539

Proposal

The correction pointed out in the issue is exactly what is needed.
A smart contract has been created that demonstrates that the correction works and also test
in the end-to-end test, which is nice to check.

Test Plan

CI.

Release Plan

  • Nothing to do / These changes follow the usual release cycle.

Links

None.

@MathieuDutSik MathieuDutSik marked this pull request as ready for review August 19, 2025 17:42

let block = creation_certificate.inner().block();
assert_eq!(block.messages().len(), 1);
assert!(block.messages()[0].is_empty());
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this the fix?

Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need the other assert?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes it is the fix.

Yes, we need the other assert. When we instantiate, we have only one block of messages being emitted.

Copy link
Contributor

@afck afck left a comment

Choose a reason for hiding this comment

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

Good catch! I agree with the fix. But do we really need a slow and expensive end-to-end regression test for that one removed line?

@MathieuDutSik
Copy link
Contributor Author

Good catch! I agree with the fix. But do we really need a slow and expensive end-to-end regression test for that one removed line?

No, we do not need it.
It was useful for checking that things work correctly, but I would not defend it as I would in other cases (create-and-call and publish-read-data-blob).

@MathieuDutSik
Copy link
Contributor Author

Good catch! I agree with the fix. But do we really need a slow and expensive end-to-end regression test for that one removed line?

So, I removed the end-to-end test. But I kept the integration test.
I tried to use the meta-counter as an example, but without success, as it is a more complex test case.

@MathieuDutSik MathieuDutSik added this pull request to the merge queue Aug 26, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Aug 26, 2025
@MathieuDutSik MathieuDutSik added this pull request to the merge queue Aug 26, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Aug 26, 2025
@MathieuDutSik MathieuDutSik added this pull request to the merge queue Aug 26, 2025
Merged via the queue into linera-io:main with commit c215b91 Aug 26, 2025
28 checks passed
@MathieuDutSik MathieuDutSik deleted the msg_instantiation branch August 26, 2025 15:16
MathieuDutSik added a commit that referenced this pull request Oct 7, 2025
… changes. (#4739)

Backports #4406, #4397, #4394, #4366

## Motivation

Several changes to the CI are welcomed and make working easier.
Fewer end-to-end tests for what is not viewed as essential.

## Proposal

Those 4 PRs are backported to TestNet Conway.

## Test Plan

The tests are tested in the same way as in the main.

## Release Plan

Backports to TestNet Conway.

## Links

None.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Should we ignore block.messages()[0].is_empty() assertion in test ActiveChain if we'll create message in instantiation ?

3 participants