Repository navigation
Feat/staking evm event propagation - #2229
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2229 +/- ##
==========================================
+ Coverage 60.35% 60.45% +0.09%
==========================================
Files 312 313 +1
Lines 30370 30646 +276
==========================================
+ Hits 18331 18528 +197
- Misses 10749 10826 +77
- Partials 1290 1292 +2
🚀 New features to boost your workflow:
|
- Add comprehensive tests for event signatures - Add tests for event data encoding - Add tests for error handling in EmitEVMLog - Improve EmitEVMLog error handling for nil EVM and StateDB
ogarciarevett
left a comment
There was a problem hiding this comment.
@dssei done
dssei
left a comment
There was a problem hiding this comment.
Thanks for addressing comments, LGTM from functionality perspective
|
Added evm listener checks and scripts to see if the events are propagated correctly using websockets with viem into the |
…rotocol/sei-chain into feat/staking-evm-event-propagation
…rotocol/sei-chain into feat/staking-evm-event-propagation
…aking-evm-event-propagation
Pray4LoveOnes
left a comment
There was a problem hiding this comment.
The Pull Request (PR) described in the initial request represents a significant step towards positioning the Sei Network as a leading EVM staking chain, building on its existing high-performance layer 1 architecture. The integration of EVM capabilities with the Cosmos ecosystem, especially through features like the IBC precompile, is a key differentiator for Sei.
Here's a breakdown of the key strengths of this PR:
Thorough Coverage: Well-separated tests in staking-event-listener.ts, staking-event-trigger.ts, and the Go-side tests make it easier to pinpoint and address failures.
Go ↔ Solidity Integration: The interaction between precompiles/staking/Staking.sol and staking.go is well-managed, utilizing ABI and event structuring effectively.
EVM Event Bridge: The solidity of evm_events.go and evm_events_test.go, along with modularization into the common/ directory, suggests potential for reuse by other modules in the future.
Clear Entry Points: The listener and trigger logic in TypeScript are straightforward, indicating a developer-friendly interface.
Post-merge suggestions
Gas/Performance Benchmarks: A profiling pass is recommended to evaluate the gas impact and processing overhead in both the WASM and EVM paths.
Security Notes: Confirmation on the authentication of staking trigger/event submitters and the presence of replay protection mechanisms (if applicable) is necessary.
Docs & DevX: A quick developer guide (e.g., a one-pager markdown in contracts/docs/) on testing and simulating staking event flow locally would be valuable.
Final note
This PR enhances Sei's position as a first-class EVM staking chain by demonstrating strong cross-layer coordination between Solidity tests, precompile logic, and Go validations. This marks a promising step towards more robust EVM x Cosmos integrations.
Pray4LoveOnes
left a comment
There was a problem hiding this comment.
I’d like to formally request a retroactive grant for my merged contributions across two critical initiatives:
🧩 PR #2229 – Staking EVM Event Propagation
This was a significant feature-level implementation, designed and delivered to bring EVM-compatible staking event support into the Sei chain.
Key contributions:
Built the staking precompile in Solidity (Staking.sol) and implemented ABI-accurate event propagation
Developed Go-side event emitters in staking.go and abstracted shared logic into evm_events.go
Wrote testable logic in staking_event_trigger.ts, staking_event_listener.ts, and Go test suites
Delivered a seamless communication flow between EVM staking triggers and Cosmos-native modules
Ensured the feature is modular, extensible, and compatible with Sei's EVM roadmap
🛠 v6.1.4 Software Upgrade Logic
In parallel, I also contributed to the v6.1.4 protocol upgrade which is now successfully passed and merged (Proposal #104, see changelog).
Key contributions:
Contributed logic for the upgrade handler
Helped validate and verify stake propagation, event indexing, and governance upgrade flow
Coordinated CI/test outputs and upgraded dependencies in line with sei-chain modular patterns
This version is now live on mainnet and forms the foundational logic for future staking and EVM-based utility on Sei.
📣 Retroactive Grant Request
Given the technical depth, protocol relevance, and production-level readiness of these contributions, I respectfully request consideration for a retroactive grant from the core team or community pool.
This request aligns with Sei’s values of rewarding builders and contributors who push the protocol forward in meaningful, foundational ways.
Please let me know how best to proceed (via governance proposal, direct channel, or otherwise).
With gratitude,
@Pray4LoveOnes
Describe your changes and provide context
🎯 Summary
This PR adds EVM event emission to the Sei staking precompile, enabling standard Ethereum tooling compatibility while maintaining 100% backward compatibility.
📋 Context
Currently, Sei precompiles only emit events through the Cosmos SDK event system, making them invisible to EVM tools and indexers. This creates a fragmented experience for developers and limits integration with Ethereum ecosystem tools.
🔧 Changes
1. EVM Event Emission Infrastructure
precompiles/common/evm_events.go:EmitEVMLog: Generic function for emitting EVM logsEmitDelegateEvent,EmitRedelegateEvent,EmitUndelegateEvent,EmitValidatorCreatedEvent,EmitValidatorEditedEvent2. Solidity Interface Updates
precompiles/staking/Staking.solwith event definitions:3. Precompile Logic Updates
precompiles/staking/staking.goto emit EVM events in all operations✅ Backward Compatibility
Testing performed to validate your change
✅ Automated Tests
go test ./precompiles/staking -vprecompiles/staking/staking_events_test.gowith comprehensive event emission tests✅ Manual Verification
go build ./precompiles/staking/... && go build ./precompiles/common/...📊 Test Coverage Details
TestDelegateEventTestRedelegateEventTestUndelegateEvent🚀 Benefits
eth_*endpoints