add trace logic and impl core messaging logic
update and add more tests