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

Emit balance change events from the protocol #3141

Merged
merged 104 commits into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
77fadb5
Specify the domain of events to emit
sug0 Mar 3, 2024
0ffa408
Test the domain of composite events
sug0 Mar 3, 2024
2d2e638
Add event domains
sug0 Apr 1, 2024
6373050
Logical divison of event kinds into different segments
sug0 Apr 1, 2024
826f4c3
Abstract away the API of event types
sug0 Apr 1, 2024
31bbbc8
Fix broken unit tests
sug0 Apr 3, 2024
056ea86
Phase out event index impls
sug0 Apr 3, 2024
b1cb13e
Implement `to_usize` on result codes
sug0 Apr 4, 2024
aecf988
Switch to type-safe events API on FinalizeBlock tests
sug0 Apr 4, 2024
ac1c28e
Fix block search response in integration tests
sug0 Apr 4, 2024
5e9fa86
Parse gas from strings
sug0 Apr 5, 2024
74bde24
Re-export gas in the SDK
sug0 Apr 5, 2024
0620d78
Remove `query_tx_response`
sug0 Apr 5, 2024
baf13b3
Check if an attribute is present in event attributes map
sug0 Apr 5, 2024
eff6685
Remove raw string attr methods from events
sug0 Apr 5, 2024
3ce3642
Generalize attributes table
sug0 Apr 5, 2024
d805044
Implement attributes map for vecs of tm event attrs
sug0 Apr 5, 2024
7db1359
Parse TxIndex instances from strs
sug0 Apr 5, 2024
e0455dd
Store TxIndex in valid masp tx attrs
sug0 Apr 5, 2024
5e6bcbf
Use domain specific types in masp events code
sug0 Apr 5, 2024
860fdeb
Unsize reading traits and change method names
sug0 Apr 5, 2024
f67b054
IBC event connection id domain type
sug0 Apr 5, 2024
c8d6c50
Event attribute dispatching
sug0 Apr 6, 2024
3fdd825
Create new IBC event attr domain types
sug0 Apr 8, 2024
b4b253a
Parse IBC packet from event attributes
sug0 Apr 8, 2024
2b4392a
Use domain types in `get_packet_from_events`
sug0 Apr 8, 2024
a61304d
Add yet more IBC event attr domain types
sug0 Apr 8, 2024
8a59cdf
Refactor IBC tests to use event attr domain types
sug0 Apr 8, 2024
0466db9
Add new domain types for event attrs
sug0 Apr 8, 2024
1ae49f7
Rework event attr errors
sug0 Apr 8, 2024
0c7e3b3
More domain type usage in IBC event attrs
sug0 Apr 8, 2024
34838e8
IBC receiver event attr domain type
sug0 Apr 8, 2024
632fee4
Add new IBC even attr domain types
sug0 Apr 8, 2024
edc4e5a
Optional reading of event attrs
sug0 Apr 9, 2024
e8164c2
Add new IBC receiver helper methods
sug0 Apr 9, 2024
fff2aae
Replace all IBC event attr raw accesses with domain types
sug0 Apr 9, 2024
a0e7475
Switch to type safe event attrs API in gov
sug0 Apr 10, 2024
0196112
Rework event types
sug0 Apr 12, 2024
5d9a737
Rework the event log
sug0 Apr 9, 2024
02531ae
Rebase fixes
sug0 Apr 15, 2024
fbaad74
Encode IBC event domain in ABCI event attrs
sug0 Apr 17, 2024
703ceb2
Deprecate accessing event attrs directly
sug0 Apr 17, 2024
07306ca
Wrap IBC event types
sug0 Apr 17, 2024
b8f57e6
Query IBC events with IbcEventType
sug0 Apr 17, 2024
827d617
Test parsing event height
sug0 Apr 19, 2024
1925699
Remove unused IBC event domain types
sug0 Apr 19, 2024
b24a4ae
Bump Hermes version in CI
sug0 Apr 23, 2024
251d064
Rebase fixes for v0.34.0
sug0 Apr 29, 2024
f629fea
Changelog for #3032
sug0 Apr 10, 2024
4717806
Derive serde traits on events
sug0 Apr 10, 2024
8740815
Implement AttributesMap on BTreeMap
sug0 Apr 10, 2024
938b18b
Switch to BTreeMap in event attributes
sug0 Apr 10, 2024
d3b10c9
Implement Ord on events
sug0 Apr 10, 2024
b9c8fdd
Impl Hash on events
sug0 Apr 10, 2024
70c3314
Write a more accurate docstr on attributes map
sug0 Apr 15, 2024
5d52c2d
Allow extending query matcher with new attrs
sug0 Apr 15, 2024
49de952
Match the prefix of an event type
sug0 Apr 15, 2024
f2f961d
Docstr fixes
sug0 Apr 15, 2024
caff6a7
Attempt to unify event kinds under the write log
sug0 Apr 15, 2024
a6c29ab
Further remove IBC specific event logic from write log
sug0 Apr 16, 2024
eb83ccf
Change TxEnv def to allow emitting/querying arbitrary events
sug0 Apr 16, 2024
6552fe8
Emit and query arbitrary events from wasm txs
sug0 Apr 16, 2024
713f33b
Query arbitrary events from VPs
sug0 Apr 16, 2024
f292669
Keep all IBC events in VP pseudo exec ctx
sug0 Apr 16, 2024
f4edd39
Fix IBC unit tests
sug0 Apr 16, 2024
8aa51b9
Extend WASM events with the current height in FinalizeBlock
sug0 Apr 23, 2024
9a3e15e
Changelog for #3088
sug0 Apr 19, 2024
8cb39d2
Move IBC events to the appropriate crate
sug0 Apr 19, 2024
f9d3947
Move Eth Bridge events to the appropriate crate
sug0 Mar 28, 2024
82cfb22
Move Governance events to the appropriate crate
sug0 Apr 19, 2024
dc29f70
Move events to their own crate
sug0 Mar 28, 2024
a6ae2f5
Re-export `namada_events` crate from `namada`
sug0 Apr 30, 2024
43d0dc4
Use new events API in benches
sug0 Apr 30, 2024
68420a5
Changelog for #3102
sug0 Apr 22, 2024
75d9afb
Implement FromStr on I256
sug0 Apr 22, 2024
b1f963f
Convert from Uint to Amount with 0 denom
sug0 Apr 22, 2024
06cd002
Negate I256 numbers
sug0 Apr 22, 2024
42a4784
Add token balance change events
sug0 Apr 22, 2024
f79757b
Emit fee payment balance change events
sug0 Apr 22, 2024
b6a9b43
Include current height in wrapper fee payment event
sug0 Apr 22, 2024
4e26c85
Include wrapper tx hash in balance change event
sug0 Apr 23, 2024
4e11bc5
Add more balance change targets
sug0 Apr 23, 2024
e8a0b24
Refactor governace event emission
sug0 Apr 23, 2024
2dab64e
Extend event with a closure
sug0 Apr 23, 2024
5178376
Make the token event's post balance optional
sug0 Apr 23, 2024
430e9b0
Add event level to balance change events
sug0 Apr 23, 2024
e8527e5
Emit PGF payment events
sug0 Apr 23, 2024
555ace4
Add token minting function
sug0 Apr 24, 2024
49a59e4
Implement EmitEvents on state impls
sug0 Apr 24, 2024
4179ce3
Remove unused file
sug0 Apr 24, 2024
d6085fe
Mint IBC tokens and emit events
sug0 Apr 24, 2024
9836186
Burn IBC tokens and emit events
sug0 Apr 24, 2024
1f92db0
Governance refund balance change events
sug0 Apr 26, 2024
0d466ae
Remove minted supply target
sug0 Apr 26, 2024
584ce8d
Refactor token events
sug0 Apr 26, 2024
202a0cf
Move `token` events to `trans_token`
sug0 Apr 26, 2024
42f8937
Proof of stake events
sug0 Apr 26, 2024
b6cb6ce
Add void event sink for testing
sug0 Apr 26, 2024
2f7c41f
Emit PoS slashing events
sug0 Apr 26, 2024
adbf8bb
Emit token transfer event from wasm
sug0 Apr 29, 2024
cdedde5
Fix unit tests
sug0 Apr 30, 2024
afb9733
Log which token failed to be minted on IBC native VP
sug0 Apr 30, 2024
0509338
Fix Multitoken native VP err msg
sug0 Apr 30, 2024
50dc3c7
Changelog for #3141
sug0 Apr 29, 2024
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Emit core events (i.e. `namada_core::event::Event`) from tx wasms.
([\#3088](https://github.com/anoma/namada/pull/3088))
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Move event types to their appropriate crates.
([\#3102](https://github.com/anoma/namada/pull/3102))
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Emit balance change events for various protocol actions.
([\#3141](https://github.com/anoma/namada/pull/3141))
2 changes: 2 additions & 0 deletions .changelog/v0.33.0/improvements/3032-generalize-events.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Erase protocol specific details from the core API of events in Namada.
([\#3032](https://github.com/anoma/namada/pull/3032))
2 changes: 1 addition & 1 deletion .github/workflows/scripts/hermes.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.7.4-namada-beta8-rc2
1.7.4-namada-beta9-rc
91 changes: 91 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ members = [
"crates/core",
"crates/encoding_spec",
"crates/ethereum_bridge",
"crates/events",
"crates/gas",
"crates/governance",
"crates/ibc",
Expand Down Expand Up @@ -113,6 +114,7 @@ indexmap = { git = "https://github.com/heliaxdev/indexmap", tag = "2.2.4-heliax-
itertools = "0.10.0"
jubjub = "0.10"
k256 = { version = "0.13.0", default-features = false, features = ["ecdsa", "pkcs8", "precomputed-tables", "serde", "std"]}
konst = { version = "0.3.8", default-features = false }
lazy_static = "1.4.0"
ledger-namada-rs = { git = "https://github.com/Zondax/ledger-namada", tag = "v0.0.12" }
ledger-transport-hid = "0.10.0"
Expand All @@ -130,6 +132,7 @@ num-traits = "0.2.14"
once_cell = "1.8.0"
orion = "0.16.0"
paste = "1.0.9"
patricia_tree = "0.8.0"
pretty_assertions = "1.4.0"
primitive-types = "0.12.1"
proptest = "1.4.0"
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ crates += namada_benchmarks
crates += namada_core
crates += namada_encoding_spec
crates += namada_ethereum_bridge
crates += namada_events
crates += namada_gas
crates += namada_governance
crates += namada_ibc
Expand Down
29 changes: 10 additions & 19 deletions crates/apps/src/lib/bench_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ use namada::core::masp::{
use namada::core::storage::{BlockHeight, Epoch, Key, KeySeg, TxIndex};
use namada::core::time::DateTimeUtc;
use namada::core::token::{Amount, DenominatedAmount, Transfer};
use namada::events::extend::{ComposeEvent, ValidMaspTx};
use namada::events::Event;
use namada::governance::storage::proposal::ProposalType;
use namada::governance::InitProposalData;
use namada::ibc::apps::transfer::types::msgs::transfer::MsgTransfer as IbcMsgTransfer;
Expand Down Expand Up @@ -73,6 +75,7 @@ use namada::ledger::queries::{
use namada::state::StorageRead;
use namada::tx::data::pos::Bond;
use namada::tx::data::{Fee, TxResult, VpsResult};
use namada::tx::event::{new_tx_event, InnerTx};
use namada::tx::{Authorization, Code, Data, Section, Tx};
use namada::vm::wasm::run;
use namada::{proof_of_stake, tendermint};
Expand Down Expand Up @@ -882,32 +885,20 @@ impl Client for BenchShell {
self.last_block_masp_txs
.iter()
.enumerate()
.map(|(idx, (_tx, changed_keys))| {
.map(|(idx, (tx, changed_keys))| {
let tx_result = TxResult {
gas_used: 0.into(),
wrapper_changed_keys: Default::default(),
changed_keys: changed_keys.to_owned(),
vps_result: VpsResult::default(),
initialized_accounts: vec![],
ibc_events: BTreeSet::default(),
eth_bridge_events: BTreeSet::default(),
events: BTreeSet::default(),
};
namada::tendermint::abci::Event {
kind: "applied".to_string(),
// Mock the masp and tx attributes
attributes: vec![
namada::tendermint::abci::EventAttribute {
key: "is_valid_masp_tx".to_string(),
value: format!("{}", idx),
index: true,
},
namada::tendermint::abci::EventAttribute {
key: "inner_tx".to_string(),
value: tx_result.to_string(),
index: true,
},
],
}
let event: Event = new_tx_event(tx, height.value())
.with(InnerTx(&tx_result))
.with(ValidMaspTx(TxIndex::must_from_usize(idx)))
.into();
namada::tendermint::abci::Event::from(event)
})
.collect(),
)
Expand Down
Loading
Loading