-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #209 from gobitfly/NOBIDS/execution-deposits
Nobids/execution deposits
- Loading branch information
Showing
9 changed files
with
1,168 additions
and
435 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes","name":"pubkey","type":"bytes"},{"indexed":false,"internalType":"bytes","name":"withdrawal_credentials","type":"bytes"},{"indexed":false,"internalType":"bytes","name":"amount","type":"bytes"},{"indexed":false,"internalType":"bytes","name":"signature","type":"bytes"},{"indexed":false,"internalType":"bytes","name":"index","type":"bytes"}],"name":"DepositEvent","type":"event"},{"inputs":[{"internalType":"bytes","name":"pubkey","type":"bytes"},{"internalType":"bytes","name":"withdrawal_credentials","type":"bytes"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"bytes32","name":"deposit_data_root","type":"bytes32"}],"name":"deposit","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"get_deposit_count","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"get_deposit_root","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"}] |
433 changes: 433 additions & 0 deletions
433
backend/pkg/commons/contracts/deposit_contract/bindings.go
Large diffs are not rendered by default.
Oops, something went wrong.
54 changes: 54 additions & 0 deletions
54
backend/pkg/commons/db/migrations/20240410150926_add_msg_sender_eth1_deposits.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
-- +goose Up | ||
-- +goose StatementBegin | ||
|
||
SELECT('up SQL query - add msg_sender, to_address, and log_index columns to eth1_deposits'); | ||
ALTER TABLE eth1_deposits ADD msg_sender bytea NULL; | ||
ALTER TABLE eth1_deposits ADD to_address bytea NULL; | ||
ALTER TABLE eth1_deposits ADD log_index int4 NULL; | ||
|
||
SELECT('up SQL query - remove duplicate rows from eth1_deposits'); | ||
delete from | ||
eth1_deposits | ||
where | ||
merkletree_index in ( | ||
select | ||
merkletree_index | ||
from | ||
( | ||
select | ||
merkletree_index, | ||
row_number() over (partition by merkletree_index) as rn, | ||
COUNT(*) over (partition by merkletree_index) as cnt | ||
from | ||
eth1_deposits | ||
) t | ||
where | ||
t.cnt > 1 | ||
); | ||
|
||
SELECT('up SQL query - changing the primary key of eth1_deposits to be merkletree_index alone'); | ||
ALTER TABLE eth1_deposits DROP CONSTRAINT IF EXISTS eth1_deposits_pkey; | ||
ALTER TABLE eth1_deposits ADD PRIMARY KEY (merkletree_index); | ||
|
||
SELECT('up SQL query - add block_number index to eth1_deposits'); | ||
CREATE INDEX eth1_deposits_block_number_idx ON eth1_deposits (block_number); | ||
|
||
|
||
-- +goose StatementEnd | ||
|
||
-- +goose Down | ||
-- +goose StatementBegin | ||
|
||
SELECT('down SQL query - remove msg_sender, to_address, and log_index columns from eth1_deposits'); | ||
ALTER TABLE eth1_deposits DROP COLUMN msg_sender; | ||
ALTER TABLE eth1_deposits DROP COLUMN to_address; | ||
ALTER TABLE eth1_deposits DROP COLUMN log_index; | ||
|
||
SELECT('down SQL query - changing the primary key of eth1_deposits back to be tx_hash & merkletree_index'); | ||
ALTER TABLE eth1_deposits DROP CONSTRAINT IF EXISTS eth1_deposits_pkey; | ||
ALTER TABLE eth1_deposits ADD PRIMARY KEY (tx_hash, merkletree_index); | ||
|
||
SELECT('down SQL query - remove block_number index from eth1_deposits'); | ||
DROP INDEX IF EXISTS eth1_deposits_block_number_idx; | ||
|
||
-- +goose StatementEnd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.