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

add support for actor events. #1049

Merged
merged 31 commits into from
Nov 15, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
277aa3c
events: add basic eventing data model.
raulk Nov 5, 2022
912e65b
events: event eventing data model.
raulk Nov 6, 2022
8a5d538
events: implement the fvm-side handling of actor events.
raulk Nov 6, 2022
2c2d958
events: add events AMT root CID in Receipt.
raulk Nov 6, 2022
b498f03
events: implement support in SDK.
raulk Nov 6, 2022
19f88c3
events: implement basic integration tests.
raulk Nov 6, 2022
56b2679
fix typo.
raulk Nov 6, 2022
7d72eee
events: Receipt: make events_root is an Option<Cid>.
raulk Nov 6, 2022
cc60eea
fix clippy.
raulk Nov 6, 2022
d0648f2
events: charge gas for actor events (params TODO) + use bitflags.
raulk Nov 6, 2022
f18b9d9
fix comment.
raulk Nov 6, 2022
ab4880b
fix compile error.
raulk Nov 9, 2022
da15510
Merge branch 'master' into raulk/events
raulk Nov 9, 2022
40bf949
fix clippy.
raulk Nov 9, 2022
9c29e6e
Merge branch 'master' into raulk/events
raulk Nov 13, 2022
bd35a04
events: make sdk::event::emit_event borrow.
raulk Nov 13, 2022
041ea1a
fix clippy.
raulk Nov 14, 2022
1949ba1
Merge branch 'master' into raulk/events
raulk Nov 14, 2022
4b93932
fix events test.
raulk Nov 14, 2022
3d2b971
Merge branch 'master' into raulk/events
raulk Nov 14, 2022
f1ac14b
fix: serde ActorEvent as a tuple.
raulk Nov 14, 2022
44cfc40
events: serialize ActorEvent as transparent.
raulk Nov 14, 2022
10e4f51
events: fix Entry#value type.
raulk Nov 14, 2022
7d1a62f
address review comment.
raulk Nov 14, 2022
f380575
improve TODO.
raulk Nov 14, 2022
547d8c2
events: initialize event accumulator with no capacity.
raulk Nov 15, 2022
3a8d2e5
address review comment.
raulk Nov 15, 2022
a19b83c
discard events emitted by aborting actors, and its subcallees.
raulk Nov 15, 2022
240b7e5
simplify events accumulator layer accounting.
raulk Nov 15, 2022
30c9d71
fix clippy.
raulk Nov 15, 2022
02e7944
address nits.
raulk Nov 15, 2022
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
2 changes: 1 addition & 1 deletion testing/integration/tests/events_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ fn events_test() {
};

let res = executor
.execute_message(message.clone(), ApplyKind::Explicit, 100)
.execute_message(message, ApplyKind::Explicit, 100)
.unwrap();

assert_eq!(ExitCode::OK, res.msg_receipt.exit_code);
Expand Down
4 changes: 3 additions & 1 deletion testing/integration/tests/fil-events-actor/src/actor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@ pub fn invoke(params: u32) -> u32 {

if counter > 0 {
let params = fvm_ipld_encoding::to_vec(&counter).expect("failed to serialize");
sdk::send::send(&our_addr, EMIT_SUBCALLS_REVERT, params.into(), Zero::zero());
let _ =
sdk::send::send(&our_addr, EMIT_SUBCALLS_REVERT, params.into(), Zero::zero())
.ok();
Comment on lines +123 to +125
Copy link
Member

Choose a reason for hiding this comment

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

You don't need the ok() (but I'm not sure why you're not just calling unwrap to assert that this worked.

Copy link
Member Author

Choose a reason for hiding this comment

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

The Result here is deliberately unused, and clippy was complaining. One of these sends is going to fail (see below), and ignoring that failure is part of the test scenario. I can document it.

Copy link
Member

Choose a reason for hiding this comment

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

Why clippy, WHY!!!

}

// The 6th call will abort after performing its send. The caller won't rethrow, so we
Expand Down