diff --git a/appdatabase/migrations/bindata.go b/appdatabase/migrations/bindata.go
index ad0e3eb1e..efdd5985f 100644
--- a/appdatabase/migrations/bindata.go
+++ b/appdatabase/migrations/bindata.go
@@ -76,6 +76,7 @@
// 1687269871_add_device_name.up.sql (108B)
// 1687506642_include_watch_only_account_setting.up.sql (81B)
// 1688022264_add_include_watch_only_account_to_settings_sync_clock.up.sql (98B)
+// 1688054680_add_columns_to_multitransaction.up.sql (342B)
// doc.go (74B)
package migrations
@@ -159,7 +160,7 @@ func _1640111208_dummyUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1640111208_dummy.up.sql", size: 258, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1640111208_dummy.up.sql", size: 258, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x3e, 0xf0, 0xae, 0x20, 0x6e, 0x75, 0xd1, 0x36, 0x14, 0xf2, 0x40, 0xe5, 0xd6, 0x7a, 0xc4, 0xa5, 0x72, 0xaa, 0xb5, 0x4d, 0x71, 0x97, 0xb8, 0xe8, 0x95, 0x22, 0x95, 0xa2, 0xac, 0xaf, 0x48, 0x58}}
return a, nil
}
@@ -179,7 +180,7 @@ func _1642666031_add_removed_clock_to_bookmarksUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1642666031_add_removed_clock_to_bookmarks.up.sql", size: 117, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1642666031_add_removed_clock_to_bookmarks.up.sql", size: 117, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x84, 0x4e, 0x38, 0x99, 0x7a, 0xc, 0x90, 0x13, 0xec, 0xfe, 0x2f, 0x55, 0xff, 0xb7, 0xb6, 0xaa, 0x96, 0xc6, 0x92, 0x79, 0xcc, 0xee, 0x4e, 0x99, 0x53, 0xfe, 0x1c, 0xbb, 0x32, 0x2, 0xa4, 0x27}}
return a, nil
}
@@ -199,7 +200,7 @@ func _1643644541_gif_api_key_settingUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1643644541_gif_api_key_setting.up.sql", size: 108, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1643644541_gif_api_key_setting.up.sql", size: 108, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x1b, 0x94, 0x28, 0xfb, 0x66, 0xd1, 0x7c, 0xb8, 0x89, 0xe2, 0xb4, 0x71, 0x65, 0x24, 0x57, 0x22, 0x95, 0x38, 0x97, 0x3, 0x9b, 0xc6, 0xa4, 0x41, 0x7b, 0xba, 0xf7, 0xdb, 0x70, 0xf7, 0x20, 0x3a}}
return a, nil
}
@@ -219,7 +220,7 @@ func _1644188994_recent_stickersUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1644188994_recent_stickers.up.sql", size: 79, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1644188994_recent_stickers.up.sql", size: 79, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x1e, 0xad, 0xaa, 0x30, 0xbf, 0x4, 0x7, 0xf8, 0xc3, 0x3, 0xb8, 0x97, 0x23, 0x2b, 0xbd, 0x1c, 0x60, 0x69, 0xb0, 0x42, 0x5e, 0x6b, 0xd, 0xa7, 0xa3, 0x6b, 0x2e, 0xdc, 0x70, 0x13, 0x72, 0x7}}
return a, nil
}
@@ -239,7 +240,7 @@ func _1646659233_add_address_to_dapp_permisssionUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1646659233_add_address_to_dapp_permisssion.up.sql", size: 700, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1646659233_add_address_to_dapp_permisssion.up.sql", size: 700, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xed, 0xb0, 0x35, 0xcc, 0x2e, 0x16, 0xe6, 0x15, 0x86, 0x2c, 0x37, 0x80, 0xae, 0xa3, 0xc5, 0x31, 0x78, 0x5, 0x9d, 0xcd, 0x7b, 0xeb, 0x5f, 0xf2, 0xb3, 0x74, 0x72, 0xdf, 0xcf, 0x88, 0xb, 0x40}}
return a, nil
}
@@ -259,7 +260,7 @@ func _1646841105_add_emoji_accountUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1646841105_add_emoji_account.up.sql", size: 96, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1646841105_add_emoji_account.up.sql", size: 96, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xe6, 0x77, 0x29, 0x95, 0x18, 0x64, 0x82, 0x63, 0xe7, 0xaf, 0x6c, 0xa9, 0x15, 0x7d, 0x46, 0xa6, 0xbc, 0xdf, 0xa7, 0xd, 0x2b, 0xd2, 0x2d, 0x97, 0x4d, 0xa, 0x6b, 0xd, 0x6e, 0x90, 0x42, 0x5c}}
return a, nil
}
@@ -279,7 +280,7 @@ func _1647278782_display_nameUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1647278782_display_name.up.sql", size: 110, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1647278782_display_name.up.sql", size: 110, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xf4, 0xa1, 0x1f, 0x3e, 0x61, 0x65, 0x8d, 0xff, 0xee, 0xde, 0xc5, 0x91, 0xd9, 0x5c, 0xb5, 0xe2, 0xf0, 0xb7, 0xe7, 0x5c, 0x5c, 0x16, 0x25, 0x89, 0xee, 0x78, 0x12, 0xea, 0x3e, 0x48, 0x41, 0xa6}}
return a, nil
}
@@ -299,7 +300,7 @@ func _1647862838_reset_last_backupUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1647862838_reset_last_backup.up.sql", size: 37, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1647862838_reset_last_backup.up.sql", size: 37, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x21, 0xe3, 0xd5, 0xf6, 0x5f, 0xfe, 0x65, 0xfa, 0x1d, 0x88, 0xf8, 0x5f, 0x24, 0x71, 0x34, 0x68, 0x96, 0x2a, 0x60, 0x87, 0x15, 0x82, 0x4d, 0x8a, 0x59, 0x3d, 0x1f, 0xd8, 0x56, 0xd4, 0xfb, 0xda}}
return a, nil
}
@@ -319,7 +320,7 @@ func _1647871652_add_settings_sync_clock_tableUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1647871652_add_settings_sync_clock_table.up.sql", size: 1044, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1647871652_add_settings_sync_clock_table.up.sql", size: 1044, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xd8, 0x58, 0xec, 0x85, 0x90, 0xfa, 0x30, 0x98, 0x98, 0x9a, 0xa6, 0xa8, 0x96, 0x2b, 0x38, 0x93, 0xf3, 0xae, 0x46, 0x74, 0xa4, 0x41, 0x62, 0x9b, 0x2, 0x86, 0xbf, 0xe5, 0x2a, 0xce, 0xe2, 0xc0}}
return a, nil
}
@@ -339,7 +340,7 @@ func _1647880168_add_torrent_configUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1647880168_add_torrent_config.up.sql", size: 211, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1647880168_add_torrent_config.up.sql", size: 211, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x1, 0x92, 0x22, 0x37, 0x96, 0xf3, 0xb5, 0x5b, 0x27, 0xd0, 0x7d, 0x43, 0x5, 0x4e, 0x9d, 0xe2, 0x49, 0xbe, 0x86, 0x31, 0xa1, 0x89, 0xff, 0xd6, 0x51, 0xe0, 0x9c, 0xb, 0xda, 0xfc, 0xf2, 0x93}}
return a, nil
}
@@ -359,7 +360,7 @@ func _1647882837_add_communities_settings_tableUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1647882837_add_communities_settings_table.up.sql", size: 206, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1647882837_add_communities_settings_table.up.sql", size: 206, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xbd, 0x87, 0x78, 0x99, 0xd9, 0x5d, 0xbd, 0xf7, 0x57, 0x9c, 0xca, 0x97, 0xbd, 0xb3, 0xe9, 0xb5, 0x89, 0x31, 0x3f, 0xf6, 0x5c, 0x13, 0xb, 0xc3, 0x54, 0x93, 0x18, 0x40, 0x7, 0x82, 0xfe, 0x7e}}
return a, nil
}
@@ -379,7 +380,7 @@ func _1647956635_add_waku_messages_tableUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1647956635_add_waku_messages_table.up.sql", size: 266, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1647956635_add_waku_messages_table.up.sql", size: 266, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xd1, 0xe, 0xe1, 0xdc, 0xda, 0x2e, 0x89, 0x8d, 0xdc, 0x2a, 0x1c, 0x13, 0xa1, 0xfc, 0xfe, 0xf, 0xb2, 0xb9, 0x85, 0xc8, 0x45, 0xd6, 0xd1, 0x7, 0x5c, 0xa3, 0x8, 0x47, 0x44, 0x6d, 0x96, 0xe0}}
return a, nil
}
@@ -399,7 +400,7 @@ func _1648554928_network_testUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1648554928_network_test.up.sql", size: 132, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1648554928_network_test.up.sql", size: 132, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x9a, 0xc5, 0x7f, 0x87, 0xf3, 0x2c, 0xf7, 0xbb, 0xd3, 0x3a, 0x4e, 0x76, 0x88, 0xca, 0xaf, 0x73, 0xce, 0x8f, 0xa1, 0xf6, 0x3d, 0x4d, 0xed, 0x6f, 0x49, 0xf2, 0xfe, 0x56, 0x2a, 0x60, 0x68, 0xca}}
return a, nil
}
@@ -419,7 +420,7 @@ func _1649174829_add_visitble_tokenUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1649174829_add_visitble_token.up.sql", size: 84, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1649174829_add_visitble_token.up.sql", size: 84, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xa3, 0x22, 0xc0, 0x2b, 0x3f, 0x4f, 0x3d, 0x5e, 0x4c, 0x68, 0x7c, 0xd0, 0x15, 0x36, 0x9f, 0xec, 0xa1, 0x2a, 0x7b, 0xb4, 0xe3, 0xc6, 0xc9, 0xb4, 0x81, 0x50, 0x4a, 0x11, 0x3b, 0x35, 0x7, 0xcf}}
return a, nil
}
@@ -439,7 +440,7 @@ func _1649882262_add_derived_from_accountsUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1649882262_add_derived_from_accounts.up.sql", size: 110, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1649882262_add_derived_from_accounts.up.sql", size: 110, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x11, 0xb9, 0x44, 0x4d, 0x85, 0x8d, 0x7f, 0xb4, 0xae, 0x4f, 0x5c, 0x66, 0x64, 0xb6, 0xe2, 0xe, 0x3d, 0xad, 0x9d, 0x8, 0x4f, 0xab, 0x6e, 0xa8, 0x7d, 0x76, 0x3, 0xad, 0x96, 0x1, 0xee, 0x5c}}
return a, nil
}
@@ -459,7 +460,7 @@ func _1650612625_add_community_message_archive_hashes_tableUpSql() (*asset, erro
return nil, err
}
- info := bindataFileInfo{name: "1650612625_add_community_message_archive_hashes_table.up.sql", size: 130, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1650612625_add_community_message_archive_hashes_table.up.sql", size: 130, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x48, 0x31, 0xb3, 0x75, 0x23, 0xe2, 0x45, 0xe, 0x47, 0x1b, 0x35, 0xa5, 0x6e, 0x83, 0x4e, 0x64, 0x7d, 0xd7, 0xa2, 0xda, 0xe9, 0x53, 0xf1, 0x16, 0x86, 0x2c, 0x57, 0xad, 0xfa, 0xca, 0x39, 0xde}}
return a, nil
}
@@ -479,7 +480,7 @@ func _1650616788_add_communities_archives_info_tableUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1650616788_add_communities_archives_info_table.up.sql", size: 208, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1650616788_add_communities_archives_info_table.up.sql", size: 208, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xd1, 0x4f, 0x80, 0x45, 0xb9, 0xd9, 0x15, 0xe2, 0x78, 0xd0, 0xcb, 0x71, 0xc1, 0x1b, 0xb7, 0x1b, 0x1b, 0x97, 0xfe, 0x47, 0x53, 0x3c, 0x62, 0xbc, 0xdd, 0x3a, 0x94, 0x1a, 0xc, 0x48, 0x76, 0xe}}
return a, nil
}
@@ -499,7 +500,7 @@ func _1652715604_add_clock_accountsUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1652715604_add_clock_accounts.up.sql", size: 62, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1652715604_add_clock_accounts.up.sql", size: 62, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xb6, 0xd9, 0x8d, 0x73, 0xc9, 0xef, 0xfa, 0xb1, 0x4b, 0xa5, 0xf3, 0x5, 0x19, 0x26, 0x46, 0xf8, 0x47, 0x93, 0xdb, 0xac, 0x2, 0xef, 0xf9, 0x71, 0x56, 0x83, 0xe6, 0x2d, 0xb0, 0xd7, 0x83, 0x5c}}
return a, nil
}
@@ -519,7 +520,7 @@ func _1653037334_add_notifications_settings_tableUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1653037334_add_notifications_settings_table.up.sql", size: 1276, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1653037334_add_notifications_settings_table.up.sql", size: 1276, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x4b, 0xc4, 0x65, 0xac, 0xa, 0xf2, 0xef, 0xb6, 0x39, 0x3c, 0xc5, 0xb1, 0xb2, 0x9c, 0x86, 0x58, 0xe0, 0x38, 0xcb, 0x57, 0x3c, 0x76, 0x73, 0x87, 0x79, 0x4e, 0xf6, 0xed, 0xb0, 0x8e, 0x9e, 0xa}}
return a, nil
}
@@ -539,7 +540,7 @@ func _1654702119_add_mutual_contact_settingsUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1654702119_add_mutual_contact_settings.up.sql", size: 78, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1654702119_add_mutual_contact_settings.up.sql", size: 78, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x26, 0x66, 0x67, 0x50, 0xfe, 0xd7, 0xe3, 0x29, 0x8b, 0xff, 0x9d, 0x5a, 0x87, 0xa7, 0x99, 0x6e, 0xd6, 0xcd, 0x2e, 0xbb, 0x17, 0xdf, 0x7f, 0xf7, 0xa3, 0xfa, 0x32, 0x7c, 0x2d, 0x92, 0xc8, 0x74}}
return a, nil
}
@@ -559,7 +560,7 @@ func _1655375270_add_clock_field_to_communities_settings_tableUpSql() (*asset, e
return nil, err
}
- info := bindataFileInfo{name: "1655375270_add_clock_field_to_communities_settings_table.up.sql", size: 74, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1655375270_add_clock_field_to_communities_settings_table.up.sql", size: 74, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x19, 0xc5, 0xc0, 0xf9, 0x84, 0x53, 0xdf, 0x83, 0xcf, 0xb6, 0x40, 0x6d, 0xf5, 0xdc, 0x77, 0x37, 0xb7, 0xe3, 0xa, 0x75, 0xe7, 0x6, 0x11, 0xca, 0x2b, 0x51, 0x92, 0xdd, 0x7d, 0xdb, 0xc3, 0xf5}}
return a, nil
}
@@ -579,7 +580,7 @@ func _1655385721_drop_networks_configUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1655385721_drop_networks_config.up.sql", size: 27, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1655385721_drop_networks_config.up.sql", size: 27, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xfc, 0xa7, 0x20, 0xbb, 0x67, 0x21, 0xe, 0xc6, 0xc8, 0x21, 0x74, 0xe0, 0xce, 0xc8, 0xe2, 0x2, 0xb4, 0xea, 0xf0, 0xe5, 0xc4, 0x4d, 0xdd, 0xd4, 0x52, 0x31, 0xa9, 0x3d, 0xcd, 0xd8, 0x9b, 0xab}}
return a, nil
}
@@ -599,7 +600,7 @@ func _1655385724_networks_chaincolor_shortnameUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1655385724_networks_chainColor_shortName.up.sql", size: 220, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1655385724_networks_chainColor_shortName.up.sql", size: 220, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xd9, 0xe7, 0x84, 0xbb, 0x5f, 0xd2, 0x2c, 0x42, 0x88, 0x62, 0x52, 0xb6, 0x58, 0x31, 0xac, 0xc, 0x96, 0x2b, 0x1b, 0xe5, 0x4e, 0x9a, 0x3a, 0xf6, 0xf6, 0xfc, 0xa9, 0x1a, 0x35, 0x62, 0x28, 0x88}}
return a, nil
}
@@ -619,7 +620,7 @@ func _1655456688_add_deleted_at_field_to_bookmarks_tableUpSql() (*asset, error)
return nil, err
}
- info := bindataFileInfo{name: "1655456688_add_deleted_at_field_to_bookmarks_table.up.sql", size: 69, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1655456688_add_deleted_at_field_to_bookmarks_table.up.sql", size: 69, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xe7, 0x9a, 0xbd, 0x9a, 0xc9, 0xf, 0xdf, 0x90, 0x0, 0x5d, 0xea, 0x6e, 0x7d, 0x51, 0x95, 0xcd, 0x90, 0xd3, 0x1a, 0x36, 0x6c, 0xf4, 0xbd, 0xa7, 0x6b, 0xbf, 0xe5, 0xdb, 0xa3, 0x88, 0xe3, 0x50}}
return a, nil
}
@@ -639,7 +640,7 @@ func _1655462032_create_bookmarks_deleted_at_indexUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1655462032_create_bookmarks_deleted_at_index.up.sql", size: 81, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1655462032_create_bookmarks_deleted_at_index.up.sql", size: 81, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xf, 0x8e, 0x20, 0x6b, 0x14, 0x9e, 0xcd, 0x97, 0xd3, 0xfe, 0x62, 0x3, 0x26, 0x59, 0x1, 0x6c, 0x99, 0xef, 0x6d, 0x21, 0xd4, 0xb5, 0xa3, 0xf4, 0x39, 0x40, 0x54, 0x6, 0xd, 0x60, 0x13, 0x38}}
return a, nil
}
@@ -659,7 +660,7 @@ func _1657617291_add_multi_transactions_tableUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1657617291_add_multi_transactions_table.up.sql", size: 412, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1657617291_add_multi_transactions_table.up.sql", size: 412, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x86, 0xb0, 0x4e, 0x8c, 0x4, 0x82, 0xb4, 0x43, 0xaa, 0xd0, 0x16, 0xdd, 0xcb, 0x88, 0x81, 0xac, 0x4, 0x34, 0x1a, 0x8f, 0x2e, 0xc5, 0x69, 0xb, 0xf0, 0x17, 0xf7, 0xe3, 0x9, 0xe, 0x54, 0xe0}}
return a, nil
}
@@ -679,7 +680,7 @@ func _1660134042_add_social_links_settings_tableUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1660134042_add_social_links_settings_table.up.sql", size: 334, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1660134042_add_social_links_settings_table.up.sql", size: 334, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x84, 0x73, 0xb6, 0xe7, 0x3f, 0xaa, 0x39, 0x9a, 0x56, 0x56, 0x31, 0xf1, 0x8e, 0x26, 0x23, 0x1, 0xe4, 0xfa, 0x98, 0xfe, 0x78, 0x87, 0x20, 0xcb, 0x52, 0xf4, 0x38, 0x7f, 0xc4, 0x1c, 0x4, 0x22}}
return a, nil
}
@@ -699,7 +700,7 @@ func _1660134060_settings_bioUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1660134060_settings_bio.up.sql", size: 91, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1660134060_settings_bio.up.sql", size: 91, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x46, 0x25, 0xa0, 0xa6, 0x47, 0xff, 0xbc, 0x2a, 0x0, 0xff, 0x59, 0x4b, 0xb0, 0xc9, 0x4e, 0x15, 0xe4, 0xd9, 0xda, 0xeb, 0xfe, 0x55, 0x98, 0xc3, 0x9d, 0x96, 0xe7, 0xf, 0xd1, 0x5c, 0x93, 0x73}}
return a, nil
}
@@ -719,7 +720,7 @@ func _1660134070_add_wakuv2_storeUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1660134070_add_wakuv2_store.up.sql", size: 269, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1660134070_add_wakuv2_store.up.sql", size: 269, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x1d, 0xe6, 0xc3, 0x9, 0xef, 0xdc, 0xae, 0x49, 0x30, 0x78, 0x54, 0xd6, 0xdb, 0xbf, 0xc0, 0x8e, 0x25, 0x8f, 0xfc, 0x67, 0x80, 0x39, 0x37, 0xd4, 0x86, 0xc1, 0x85, 0xc8, 0x99, 0xc4, 0x59, 0xd4}}
return a, nil
}
@@ -739,7 +740,7 @@ func _1660134072_waku2_store_messagesUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1660134072_waku2_store_messages.up.sql", size: 497, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1660134072_waku2_store_messages.up.sql", size: 497, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x3e, 0xeb, 0xb4, 0xa0, 0xa1, 0x2b, 0xcb, 0x4c, 0x3c, 0xc6, 0xd0, 0xe8, 0x96, 0xe3, 0x96, 0xf1, 0x4f, 0x1f, 0xe0, 0xe7, 0x1f, 0x85, 0xa3, 0xe, 0xf7, 0x52, 0x56, 0x63, 0x2b, 0xb0, 0x87, 0x7b}}
return a, nil
}
@@ -759,7 +760,7 @@ func _1662365868_add_key_uid_accountsUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1662365868_add_key_uid_accounts.up.sql", size: 68, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1662365868_add_key_uid_accounts.up.sql", size: 68, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xc6, 0xd8, 0x2f, 0x2f, 0x3b, 0xa8, 0xbd, 0x6d, 0xf6, 0x87, 0x7e, 0xd2, 0xf1, 0xa2, 0xf7, 0x81, 0x6a, 0x23, 0x10, 0xbc, 0xbf, 0x5b, 0xe7, 0x2b, 0x9c, 0xa9, 0x8a, 0x18, 0xbb, 0xd0, 0x86, 0x91}}
return a, nil
}
@@ -779,7 +780,7 @@ func _1662447680_add_keypairs_tableUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1662447680_add_keypairs_table.up.sql", size: 218, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1662447680_add_keypairs_table.up.sql", size: 218, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xdc, 0x25, 0xa9, 0xc7, 0x63, 0x27, 0x97, 0x35, 0x5f, 0x6b, 0xab, 0x26, 0xcb, 0xf9, 0xbd, 0x5e, 0xac, 0x3, 0xa0, 0x5e, 0xb9, 0x71, 0xa3, 0x1f, 0xb3, 0x4f, 0x7f, 0x79, 0x28, 0x48, 0xbe, 0xc}}
return a, nil
}
@@ -799,7 +800,7 @@ func _1662460056_move_favourites_to_saved_addressesUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1662460056_move_favourites_to_saved_addresses.up.sql", size: 233, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1662460056_move_favourites_to_saved_addresses.up.sql", size: 233, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x10, 0xa2, 0x8c, 0xa3, 0xec, 0xad, 0xdf, 0xc3, 0x48, 0x5, 0x9b, 0x50, 0x25, 0x59, 0xae, 0x7d, 0xee, 0x58, 0xd2, 0x41, 0x27, 0xf2, 0x22, 0x2e, 0x9a, 0xb9, 0x4a, 0xcc, 0x38, 0x6e, 0x3a, 0xb2}}
return a, nil
}
@@ -819,7 +820,7 @@ func _1662738097_add_base_fee_transactionUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1662738097_add_base_fee_transaction.up.sql", size: 112, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1662738097_add_base_fee_transaction.up.sql", size: 112, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x6b, 0xfb, 0x10, 0xae, 0xfc, 0x77, 0x70, 0x98, 0x6f, 0xec, 0xaa, 0xcd, 0x7, 0xc7, 0x74, 0x23, 0xc, 0xd5, 0x1e, 0x82, 0xdd, 0xfe, 0xff, 0x3b, 0xd2, 0x49, 0x10, 0x5b, 0x30, 0xc, 0x2d, 0xb0}}
return a, nil
}
@@ -839,7 +840,7 @@ func _1662972194_add_keypairs_tableUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1662972194_add_keypairs_table.up.sql", size: 345, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1662972194_add_keypairs_table.up.sql", size: 345, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xab, 0x76, 0xf2, 0x86, 0xe1, 0x7e, 0xe9, 0x47, 0x32, 0x48, 0xd5, 0x6b, 0xe5, 0xd, 0xab, 0xb7, 0xf1, 0xd4, 0xf1, 0xad, 0x38, 0xa6, 0x11, 0xe7, 0xce, 0x5c, 0x11, 0x11, 0xf, 0x47, 0xb2, 0x4}}
return a, nil
}
@@ -859,7 +860,7 @@ func _1664392661_add_third_party_id_to_waku_messagesUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1664392661_add_third_party_id_to_waku_messages.up.sql", size: 70, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1664392661_add_third_party_id_to_waku_messages.up.sql", size: 70, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xfd, 0x67, 0x66, 0x9e, 0x66, 0x74, 0xce, 0x1c, 0xb, 0x1b, 0x9d, 0xd5, 0xfc, 0x65, 0xe, 0x83, 0x90, 0x4c, 0x61, 0x4e, 0x6b, 0xe7, 0x86, 0xbe, 0x36, 0x4f, 0x91, 0x36, 0x4, 0x47, 0x7b, 0x82}}
return a, nil
}
@@ -879,7 +880,7 @@ func _1664783660_add_sync_info_to_saved_addressesUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1664783660_add_sync_info_to_saved_addresses.up.sql", size: 388, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1664783660_add_sync_info_to_saved_addresses.up.sql", size: 388, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x67, 0x7c, 0x3a, 0x95, 0x4e, 0x55, 0xb2, 0xbd, 0xb4, 0x18, 0x93, 0xc1, 0xcf, 0x9f, 0x12, 0xbb, 0x49, 0x8a, 0x2a, 0x6a, 0x2a, 0x7f, 0xad, 0x44, 0xc3, 0xf, 0x3a, 0x79, 0x18, 0xb9, 0x4c, 0x64}}
return a, nil
}
@@ -899,7 +900,7 @@ func _1668109917_wakunodesUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1668109917_wakunodes.up.sql", size: 99, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1668109917_wakunodes.up.sql", size: 99, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x29, 0xaa, 0x9e, 0x2, 0x66, 0x85, 0x69, 0xa8, 0xd9, 0xe2, 0x4b, 0x8d, 0x2a, 0x9c, 0xdf, 0xd2, 0xef, 0x64, 0x58, 0xe3, 0xa6, 0xe7, 0xc1, 0xd1, 0xc8, 0x9c, 0xc0, 0x2c, 0x1, 0xa8, 0x7b, 0x81}}
return a, nil
}
@@ -919,7 +920,7 @@ func _1670249678_display_name_to_settings_sync_clock_tableUpSql() (*asset, error
return nil, err
}
- info := bindataFileInfo{name: "1670249678_display_name_to_settings_sync_clock_table.up.sql", size: 83, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1670249678_display_name_to_settings_sync_clock_table.up.sql", size: 83, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x39, 0x18, 0xdc, 0xc4, 0x1f, 0x79, 0x22, 0x16, 0x4d, 0xdf, 0x6c, 0x66, 0xd5, 0xa4, 0x88, 0x5d, 0x5, 0x37, 0xa7, 0x41, 0x5, 0x50, 0xae, 0x12, 0xfa, 0x7e, 0x89, 0x24, 0x5c, 0xae, 0x30, 0xfc}}
return a, nil
}
@@ -939,7 +940,7 @@ func _1670836810_add_imported_flag_to_community_archive_hashesUpSql() (*asset, e
return nil, err
}
- info := bindataFileInfo{name: "1670836810_add_imported_flag_to_community_archive_hashes.up.sql", size: 144, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1670836810_add_imported_flag_to_community_archive_hashes.up.sql", size: 144, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x6f, 0xf, 0xf0, 0xbd, 0xfe, 0x63, 0x25, 0x8f, 0x5e, 0x46, 0x4b, 0x45, 0x31, 0x8b, 0x3e, 0xd8, 0x6b, 0x5d, 0x9d, 0x6d, 0x10, 0x9a, 0x87, 0x4b, 0x18, 0xc6, 0x39, 0x81, 0x6e, 0xe4, 0x75, 0xfb}}
return a, nil
}
@@ -959,7 +960,7 @@ func _1671438731_add_magnetlink_uri_to_communities_archive_infoUpSql() (*asset,
return nil, err
}
- info := bindataFileInfo{name: "1671438731_add_magnetlink_uri_to_communities_archive_info.up.sql", size: 86, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1671438731_add_magnetlink_uri_to_communities_archive_info.up.sql", size: 86, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xda, 0x8b, 0x4b, 0xd6, 0xd8, 0xe2, 0x3d, 0xf7, 0x6b, 0xcd, 0x1e, 0x70, 0x9, 0x2e, 0x35, 0x4, 0x61, 0xc3, 0xb5, 0x9d, 0xc5, 0x27, 0x21, 0xa, 0x5a, 0xd6, 0x3e, 0xa6, 0x24, 0xa2, 0x12, 0xdf}}
return a, nil
}
@@ -979,7 +980,7 @@ func _1672933930_switcher_cardUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1672933930_switcher_card.up.sql", size: 162, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1672933930_switcher_card.up.sql", size: 162, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x39, 0xba, 0xdc, 0xbb, 0x40, 0x4, 0xf2, 0x10, 0xdf, 0xb4, 0xd2, 0x80, 0x8a, 0x74, 0x4d, 0xf6, 0xbc, 0x50, 0x7, 0xd, 0x22, 0x7f, 0xc4, 0xaf, 0xaa, 0xde, 0xdc, 0x71, 0xe9, 0x42, 0x98, 0x36}}
return a, nil
}
@@ -999,7 +1000,7 @@ func _1674056187_add_price_cacheUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1674056187_add_price_cache.up.sql", size: 255, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1674056187_add_price_cache.up.sql", size: 255, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xb7, 0x79, 0x6a, 0x9b, 0x28, 0xd1, 0x22, 0xf0, 0x84, 0x76, 0x40, 0x39, 0x49, 0x15, 0x5d, 0xaa, 0xfd, 0x11, 0xff, 0x13, 0x27, 0x42, 0x12, 0xfa, 0x82, 0xe6, 0x7a, 0xf0, 0x5e, 0x1f, 0xe3, 0xba}}
return a, nil
}
@@ -1019,7 +1020,7 @@ func _1674136690_ens_usernamesUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1674136690_ens_usernames.up.sql", size: 98, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1674136690_ens_usernames.up.sql", size: 98, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x81, 0x7a, 0xf3, 0xa8, 0x88, 0x99, 0xd6, 0x9c, 0x69, 0x48, 0x3c, 0x10, 0xda, 0x72, 0xdc, 0x14, 0xd, 0x6e, 0x8c, 0x82, 0x92, 0x2d, 0x2c, 0xee, 0x4c, 0x70, 0xa4, 0xdc, 0x5c, 0x5, 0x2, 0xc3}}
return a, nil
}
@@ -1039,7 +1040,7 @@ func _1674232431_add_balance_historyUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1674232431_add_balance_history.up.sql", size: 698, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1674232431_add_balance_history.up.sql", size: 698, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xf7, 0xb5, 0x18, 0xca, 0x4a, 0x93, 0xbb, 0x6f, 0xa4, 0xee, 0xe4, 0x3e, 0xff, 0x6a, 0x4b, 0xe2, 0xe1, 0x61, 0x28, 0xee, 0xc5, 0x26, 0x57, 0x61, 0x5e, 0x6d, 0x44, 0x1e, 0x85, 0x43, 0x70, 0xa2}}
return a, nil
}
@@ -1059,7 +1060,7 @@ func _1676368933_keypairs_to_keycardsUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1676368933_keypairs_to_keycards.up.sql", size: 639, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1676368933_keypairs_to_keycards.up.sql", size: 639, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x81, 0x93, 0x27, 0x2, 0xf0, 0x37, 0x81, 0x65, 0xa4, 0xb3, 0x5b, 0x60, 0x36, 0x95, 0xfc, 0x81, 0xf0, 0x3b, 0x7c, 0xc3, 0x2c, 0x85, 0xbd, 0x38, 0x46, 0xa4, 0x95, 0x4a, 0x6, 0x3e, 0x74, 0xd5}}
return a, nil
}
@@ -1079,7 +1080,7 @@ func _1676951398_add_currency_format_cacheUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1676951398_add_currency_format_cache.up.sql", size: 291, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1676951398_add_currency_format_cache.up.sql", size: 291, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xf9, 0xa3, 0x76, 0x35, 0xca, 0xf, 0xe8, 0xdf, 0xd9, 0x61, 0xf9, 0xed, 0xfc, 0x6d, 0xf5, 0xe, 0x11, 0x88, 0xbd, 0x14, 0x92, 0xc6, 0x57, 0x53, 0xe, 0xcd, 0x52, 0xf4, 0xa9, 0xb1, 0xdd, 0xfd}}
return a, nil
}
@@ -1099,7 +1100,7 @@ func _1676968196_keycards_add_clock_columnUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1676968196_keycards_add_clock_column.up.sql", size: 73, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1676968196_keycards_add_clock_column.up.sql", size: 73, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x4c, 0xf, 0x1c, 0x28, 0x41, 0x57, 0x57, 0x6c, 0xe, 0x75, 0x6b, 0x75, 0x12, 0x0, 0x18, 0x1e, 0x88, 0x1e, 0x45, 0xe0, 0x32, 0xb9, 0xd4, 0xd9, 0x2e, 0xc8, 0xb, 0x80, 0x6, 0x51, 0x3d, 0x28}}
return a, nil
}
@@ -1119,7 +1120,7 @@ func _1676968197_add_fallback_rpc_to_networksUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1676968197_add_fallback_rpc_to_networks.up.sql", size: 112, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1676968197_add_fallback_rpc_to_networks.up.sql", size: 112, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x77, 0x6a, 0xc6, 0x45, 0xfa, 0x62, 0x84, 0x74, 0x6d, 0x7c, 0xd7, 0x1d, 0x79, 0xb6, 0x38, 0x43, 0xa8, 0x8, 0x6b, 0x75, 0x3d, 0x9, 0x2, 0xc5, 0x9f, 0xbb, 0x45, 0x56, 0x4c, 0x4e, 0x17, 0x89}}
return a, nil
}
@@ -1139,7 +1140,7 @@ func _1677674090_add_chains_ens_istest_to_saved_addressesUpSql() (*asset, error)
return nil, err
}
- info := bindataFileInfo{name: "1677674090_add_chains_ens_istest_to_saved_addresses.up.sql", size: 638, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1677674090_add_chains_ens_istest_to_saved_addresses.up.sql", size: 638, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xa8, 0x2d, 0xa4, 0x1b, 0xf6, 0x6a, 0x13, 0x7b, 0xe, 0x59, 0xcd, 0xe2, 0x4e, 0x81, 0x99, 0xc4, 0x33, 0x84, 0xde, 0x66, 0xca, 0xac, 0x2f, 0x5, 0x90, 0xac, 0xfd, 0x4e, 0xfc, 0x55, 0x44, 0xe5}}
return a, nil
}
@@ -1159,7 +1160,7 @@ func _1677681143_accounts_table_type_column_updateUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1677681143_accounts_table_type_column_update.up.sql", size: 135, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1677681143_accounts_table_type_column_update.up.sql", size: 135, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xd2, 0xc4, 0x6, 0x42, 0x50, 0x1d, 0xf4, 0x48, 0x55, 0xbc, 0xa2, 0x19, 0xdd, 0xad, 0xc8, 0xc, 0xa7, 0x30, 0xb6, 0xaf, 0xe, 0x2b, 0xaa, 0x2a, 0xa4, 0xe1, 0xb9, 0x41, 0x23, 0x66, 0xd3, 0x3}}
return a, nil
}
@@ -1179,7 +1180,7 @@ func _1678264207_accounts_table_new_columns_addedUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1678264207_accounts_table_new_columns_added.up.sql", size: 130, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1678264207_accounts_table_new_columns_added.up.sql", size: 130, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xf4, 0xd4, 0xf3, 0x35, 0xef, 0x5c, 0x19, 0x3c, 0x15, 0x90, 0x60, 0xbd, 0x1f, 0x81, 0xf0, 0x86, 0x73, 0x89, 0xa0, 0x70, 0xf2, 0x46, 0xae, 0xea, 0xd0, 0xc6, 0x9e, 0x55, 0x4a, 0x54, 0x62, 0xbb}}
return a, nil
}
@@ -1199,7 +1200,7 @@ func _1680770368_add_bio_to_settings_sync_clock_tableUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1680770368_add_bio_to_settings_sync_clock_table.up.sql", size: 75, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1680770368_add_bio_to_settings_sync_clock_table.up.sql", size: 75, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x4a, 0x52, 0xf6, 0x3f, 0xaa, 0xd, 0xa0, 0xee, 0xe8, 0xe6, 0x16, 0x21, 0x80, 0x61, 0xe4, 0x7a, 0x4e, 0x37, 0x8d, 0x30, 0x51, 0x20, 0x4d, 0x15, 0x47, 0xfb, 0x6, 0xa1, 0xce, 0xc8, 0x27, 0x5a}}
return a, nil
}
@@ -1219,7 +1220,7 @@ func _1681110436_add_mnemonic_to_settings_sync_clock_tableUpSql() (*asset, error
return nil, err
}
- info := bindataFileInfo{name: "1681110436_add_mnemonic_to_settings_sync_clock_table.up.sql", size: 311, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1681110436_add_mnemonic_to_settings_sync_clock_table.up.sql", size: 311, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x3d, 0x74, 0x81, 0x7d, 0x9e, 0x77, 0xb6, 0xfe, 0xe3, 0xcb, 0x48, 0xe5, 0x5f, 0x39, 0x23, 0xa1, 0x7d, 0x53, 0x22, 0xe8, 0x96, 0x15, 0x8a, 0x1e, 0x8e, 0xbc, 0xe2, 0x1d, 0xc4, 0xc2, 0x56, 0x34}}
return a, nil
}
@@ -1239,7 +1240,7 @@ func _1681392602_9d_sync_periodUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1681392602_9d_sync_period.up.sql", size: 60, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1681392602_9d_sync_period.up.sql", size: 60, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xc9, 0xa, 0x90, 0x29, 0x7f, 0x76, 0x98, 0xa7, 0x71, 0x80, 0x5a, 0x2f, 0xbe, 0x23, 0x9a, 0xd4, 0xf4, 0x39, 0x19, 0xd3, 0xa5, 0x34, 0x6e, 0x67, 0x6a, 0xbe, 0x8a, 0xad, 0x21, 0xc7, 0xba, 0x88}}
return a, nil
}
@@ -1259,7 +1260,7 @@ func _1681762078_default_sync_period_9dUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1681762078_default_sync_period_9d.up.sql", size: 3002, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1681762078_default_sync_period_9d.up.sql", size: 3002, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x3e, 0xd9, 0x26, 0xfc, 0xa9, 0x45, 0xc1, 0x81, 0xa8, 0xe2, 0x2c, 0xe9, 0x3c, 0xea, 0x1d, 0x37, 0x11, 0x45, 0x8c, 0x6c, 0xbc, 0xc2, 0x6, 0x69, 0x2, 0x75, 0x29, 0x40, 0x9f, 0xc5, 0xbb, 0x36}}
return a, nil
}
@@ -1279,7 +1280,7 @@ func _1681780680_add_clock_to_social_links_settingsUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1681780680_add_clock_to_social_links_settings.up.sql", size: 137, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1681780680_add_clock_to_social_links_settings.up.sql", size: 137, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x63, 0x11, 0xf5, 0x41, 0xe5, 0x5a, 0xf4, 0xe3, 0xf3, 0x14, 0x87, 0x28, 0xd8, 0xf0, 0x52, 0x31, 0x8, 0xd5, 0xbb, 0xf4, 0xff, 0x55, 0x5f, 0x42, 0x90, 0xcb, 0xf7, 0x46, 0x2, 0x6, 0xbe, 0x42}}
return a, nil
}
@@ -1299,7 +1300,7 @@ func _1682073779_settings_table_remove_latest_derived_path_columnUpSql() (*asset
return nil, err
}
- info := bindataFileInfo{name: "1682073779_settings_table_remove_latest_derived_path_column.up.sql", size: 4470, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1682073779_settings_table_remove_latest_derived_path_column.up.sql", size: 4470, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x7a, 0x36, 0x2, 0x41, 0xd, 0x5c, 0xd1, 0x92, 0x85, 0x6d, 0x84, 0xff, 0x67, 0xa7, 0x4c, 0x67, 0xa4, 0xef, 0x52, 0x69, 0x1f, 0x22, 0x25, 0x92, 0xc, 0xb3, 0x89, 0x50, 0x91, 0xc, 0x49, 0xf9}}
return a, nil
}
@@ -1319,7 +1320,7 @@ func _1682146075_add_created_at_to_saved_addressesUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1682146075_add_created_at_to_saved_addresses.up.sql", size: 107, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1682146075_add_created_at_to_saved_addresses.up.sql", size: 107, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x88, 0xfe, 0x35, 0x9c, 0x6b, 0xdf, 0x67, 0x18, 0x16, 0xe4, 0xc9, 0xd4, 0x77, 0x7c, 0x4, 0xe2, 0x6c, 0x41, 0xd9, 0x53, 0x97, 0xfe, 0x5, 0xa3, 0x23, 0xce, 0x82, 0xad, 0x92, 0x5e, 0xd7, 0x7d}}
return a, nil
}
@@ -1339,7 +1340,7 @@ func _1682393575_sync_ens_nameUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1682393575_sync_ens_name.up.sql", size: 713, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1682393575_sync_ens_name.up.sql", size: 713, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xfb, 0xea, 0xcb, 0x4d, 0x71, 0x5a, 0x49, 0x19, 0x8b, 0xef, 0x66, 0x27, 0x33, 0x89, 0xb0, 0xe, 0x37, 0x1b, 0x41, 0x8, 0x12, 0xcc, 0x56, 0xd8, 0x1b, 0xf, 0xf8, 0x50, 0x4b, 0x93, 0xf1, 0x29}}
return a, nil
}
@@ -1359,7 +1360,7 @@ func _1683457503_add_blocks_ranges_sequential_tableUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1683457503_add_blocks_ranges_sequential_table.up.sql", size: 263, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1683457503_add_blocks_ranges_sequential_table.up.sql", size: 263, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xfe, 0x57, 0x2e, 0x0, 0x6a, 0x6e, 0xd7, 0xeb, 0xe6, 0x66, 0x79, 0x32, 0x22, 0x82, 0x92, 0xf4, 0xc9, 0xf1, 0x58, 0x1a, 0x45, 0x60, 0x77, 0x50, 0xe7, 0x54, 0x4a, 0xc0, 0x42, 0x3a, 0x4f, 0x35}}
return a, nil
}
@@ -1379,7 +1380,7 @@ func _1683627613_accounts_and_keycards_improvementsUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1683627613_accounts_and_keycards_improvements.up.sql", size: 3640, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1683627613_accounts_and_keycards_improvements.up.sql", size: 3640, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x8e, 0xbe, 0x62, 0xf5, 0x9, 0x42, 0x8c, 0x8f, 0xa8, 0x45, 0xe7, 0x36, 0xc9, 0xde, 0xf4, 0xe2, 0xfd, 0xc4, 0x8, 0xd0, 0xa3, 0x8, 0x64, 0xe2, 0x56, 0xcc, 0xa7, 0x6d, 0xc5, 0xcc, 0x82, 0x2c}}
return a, nil
}
@@ -1399,7 +1400,7 @@ func _1685041348_settings_table_add_latest_derived_path_columnUpSql() (*asset, e
return nil, err
}
- info := bindataFileInfo{name: "1685041348_settings_table_add_latest_derived_path_column.up.sql", size: 115, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1685041348_settings_table_add_latest_derived_path_column.up.sql", size: 115, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x21, 0xd4, 0x1b, 0xbf, 0x8, 0xf9, 0xd4, 0xb0, 0xa0, 0x6, 0x5b, 0xfb, 0x7e, 0xff, 0xfa, 0xbf, 0xcc, 0x64, 0x47, 0x81, 0x8b, 0x5e, 0x17, 0x6a, 0xa7, 0xa4, 0x35, 0x8f, 0x30, 0x4f, 0xd9, 0xd}}
return a, nil
}
@@ -1419,7 +1420,7 @@ func _1685440989_update_color_id_accountsUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1685440989_update_color_id_accounts.up.sql", size: 918, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1685440989_update_color_id_accounts.up.sql", size: 918, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x10, 0x2e, 0x51, 0x1d, 0x2d, 0x16, 0x84, 0xd6, 0xe8, 0xbc, 0x20, 0x53, 0x47, 0xb8, 0x40, 0x21, 0x52, 0x5c, 0xd9, 0xbb, 0xea, 0xe2, 0xa5, 0x77, 0xc8, 0x35, 0x4c, 0xe0, 0x9d, 0x42, 0x44, 0x50}}
return a, nil
}
@@ -1439,7 +1440,7 @@ func _1685463947_add_to_asset_to_multitransactionUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1685463947_add_to_asset_to_multitransaction.up.sql", size: 61, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1685463947_add_to_asset_to_multitransaction.up.sql", size: 61, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xd3, 0x66, 0x15, 0x10, 0xfa, 0x66, 0x81, 0x68, 0xd9, 0xb4, 0x93, 0x9e, 0x11, 0xed, 0x1d, 0x16, 0x9d, 0x5a, 0xf8, 0xd7, 0x8, 0xea, 0x7a, 0xaf, 0xe4, 0xb3, 0x22, 0x19, 0xca, 0xff, 0x75, 0x7c}}
return a, nil
}
@@ -1459,7 +1460,7 @@ func _1685880973_add_profile_links_settings_tableUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1685880973_add_profile_links_settings_table.up.sql", size: 1656, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1685880973_add_profile_links_settings_table.up.sql", size: 1656, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x13, 0x23, 0x7b, 0x1e, 0x82, 0x61, 0xcc, 0x76, 0xd6, 0xc7, 0x42, 0x6e, 0x69, 0x21, 0x1b, 0xfd, 0x7d, 0xda, 0xd7, 0xb7, 0xc7, 0xd3, 0x22, 0x63, 0xfe, 0xc6, 0xd3, 0xdf, 0xc8, 0x5f, 0x50, 0xcc}}
return a, nil
}
@@ -1479,7 +1480,7 @@ func _1686041510_add_idx_transfers_blkno_loadedUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1686041510_add_idx_transfers_blkno_loaded.up.sql", size: 71, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1686041510_add_idx_transfers_blkno_loaded.up.sql", size: 71, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xe2, 0x5d, 0x7e, 0x43, 0x14, 0x3c, 0x50, 0x44, 0x25, 0xd0, 0xe1, 0x75, 0xba, 0x61, 0x7b, 0x68, 0x2e, 0x43, 0x74, 0x1d, 0x10, 0x61, 0x8e, 0x45, 0xe6, 0x25, 0x78, 0x81, 0x68, 0x6, 0x24, 0x5b}}
return a, nil
}
@@ -1499,7 +1500,7 @@ func _1686048341_transfers_receipt_json_blob_outUpSqlDownSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1686048341_transfers_receipt_json_blob_out.up.sql.down.sql", size: 104, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1686048341_transfers_receipt_json_blob_out.up.sql.down.sql", size: 104, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x9f, 0x6c, 0xd9, 0x76, 0x83, 0x64, 0xf0, 0xf2, 0x74, 0x97, 0xca, 0xd7, 0xaa, 0x4, 0x74, 0x7c, 0x34, 0x56, 0x88, 0x10, 0xa9, 0x4d, 0x1d, 0x8e, 0x85, 0xc3, 0x66, 0x1, 0x2b, 0x30, 0x90, 0xf4}}
return a, nil
}
@@ -1519,7 +1520,7 @@ func _1686048341_transfers_receipt_json_blob_outUpSqlUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1686048341_transfers_receipt_json_blob_out.up.sql.up.sql", size: 1500, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1686048341_transfers_receipt_json_blob_out.up.sql.up.sql", size: 1500, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x49, 0xcd, 0xe3, 0xa6, 0x8c, 0x53, 0x51, 0xe6, 0x3c, 0x64, 0xcb, 0x3, 0x3, 0xb, 0x4d, 0x52, 0xa5, 0x1c, 0xcc, 0xe1, 0x23, 0x94, 0x14, 0x79, 0xd7, 0x56, 0x58, 0xef, 0xcc, 0x1a, 0x6, 0xa4}}
return a, nil
}
@@ -1539,7 +1540,7 @@ func _1686825075_cleanup_token_addressUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1686825075_cleanup_token_address.up.sql", size: 273, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1686825075_cleanup_token_address.up.sql", size: 273, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x14, 0x72, 0x10, 0xec, 0x97, 0xc9, 0x3a, 0xdb, 0x39, 0x33, 0xc9, 0x6, 0x92, 0xbe, 0xe4, 0xc2, 0x5c, 0xb6, 0xaa, 0xe5, 0x25, 0x21, 0x4d, 0x74, 0x18, 0x94, 0xc, 0x33, 0x2f, 0xa4, 0x9, 0x99}}
return a, nil
}
@@ -1559,7 +1560,7 @@ func _1687193315_transfers_extract_from_to_addressDownSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1687193315_transfers_extract_from_to_address.down.sql", size: 104, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1687193315_transfers_extract_from_to_address.down.sql", size: 104, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x9f, 0x6c, 0xd9, 0x76, 0x83, 0x64, 0xf0, 0xf2, 0x74, 0x97, 0xca, 0xd7, 0xaa, 0x4, 0x74, 0x7c, 0x34, 0x56, 0x88, 0x10, 0xa9, 0x4d, 0x1d, 0x8e, 0x85, 0xc3, 0x66, 0x1, 0x2b, 0x30, 0x90, 0xf4}}
return a, nil
}
@@ -1579,7 +1580,7 @@ func _1687193315_transfers_extract_from_to_addressUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1687193315_transfers_extract_from_to_address.up.sql", size: 499, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "1687193315_transfers_extract_from_to_address.up.sql", size: 499, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x4c, 0xef, 0xf4, 0x66, 0xac, 0x3a, 0xa6, 0xe3, 0x26, 0x43, 0x53, 0xe, 0xd8, 0xfe, 0xf2, 0xaa, 0x20, 0x8, 0x4e, 0x52, 0x49, 0x37, 0xbf, 0x46, 0xbf, 0x53, 0xa7, 0xcf, 0x27, 0x23, 0xab, 0x99}}
return a, nil
}
@@ -1599,7 +1600,7 @@ func _1687249080_add_position_accountsUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1687249080_add_position_accounts.up..sql", size: 2053, mode: os.FileMode(0644), modTime: time.Unix(1688036173, 0)}
+ info := bindataFileInfo{name: "1687249080_add_position_accounts.up..sql", size: 2053, mode: os.FileMode(0644), modTime: time.Unix(1688054623, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xf3, 0x47, 0x9f, 0xb4, 0xe3, 0xc, 0x35, 0x15, 0x74, 0xc3, 0x72, 0x57, 0x9f, 0x3b, 0xc9, 0xd5, 0x9b, 0x31, 0xef, 0xd6, 0x21, 0xc4, 0x27, 0x8e, 0x37, 0xd5, 0x5, 0xdb, 0x3d, 0xcf, 0x37, 0xbb}}
return a, nil
}
@@ -1619,7 +1620,7 @@ func _1687269871_add_device_nameUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1687269871_add_device_name.up.sql", size: 108, mode: os.FileMode(0644), modTime: time.Unix(1688027346, 0)}
+ info := bindataFileInfo{name: "1687269871_add_device_name.up.sql", size: 108, mode: os.FileMode(0644), modTime: time.Unix(1688054623, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xed, 0x61, 0xf2, 0xf9, 0x78, 0x57, 0xc3, 0x57, 0xdb, 0x37, 0xe, 0x7, 0x15, 0xde, 0x5a, 0x2a, 0xb5, 0x86, 0xb8, 0x5, 0x48, 0x68, 0x2a, 0xb, 0x7c, 0xd, 0x60, 0xba, 0x67, 0x30, 0x2d, 0xa3}}
return a, nil
}
@@ -1639,7 +1640,7 @@ func _1687506642_include_watch_only_account_settingUpSql() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "1687506642_include_watch_only_account_setting.up.sql", size: 81, mode: os.FileMode(0644), modTime: time.Unix(1687966839, 0)}
+ info := bindataFileInfo{name: "1687506642_include_watch_only_account_setting.up.sql", size: 81, mode: os.FileMode(0644), modTime: time.Unix(1687962760, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xaa, 0xa0, 0x61, 0xf8, 0xb9, 0x15, 0x22, 0x9a, 0xca, 0x9b, 0x89, 0x96, 0x90, 0x47, 0x56, 0xf3, 0x21, 0xf6, 0xbd, 0xd1, 0xa1, 0x8f, 0xa8, 0x34, 0xc3, 0x54, 0x86, 0x69, 0x14, 0x96, 0xdb, 0xbb}}
return a, nil
}
@@ -1659,11 +1660,31 @@ func _1688022264_add_include_watch_only_account_to_settings_sync_clockUpSql() (*
return nil, err
}
- info := bindataFileInfo{name: "1688022264_add_include_watch_only_account_to_settings_sync_clock.up.sql", size: 98, mode: os.FileMode(0644), modTime: time.Unix(1688036174, 0)}
+ info := bindataFileInfo{name: "1688022264_add_include_watch_only_account_to_settings_sync_clock.up.sql", size: 98, mode: os.FileMode(0644), modTime: time.Unix(1688054623, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xab, 0xa2, 0x31, 0xcc, 0x3d, 0x59, 0x1b, 0x26, 0x5b, 0x78, 0xd, 0x6a, 0x75, 0x2a, 0xe0, 0x2, 0x21, 0x28, 0x8c, 0x92, 0x24, 0x98, 0x86, 0xdd, 0x2, 0x53, 0xe8, 0xf6, 0xc2, 0x7d, 0x57, 0x13}}
return a, nil
}
+var __1688054680_add_columns_to_multitransactionUpSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xac\xcf\x41\x0a\xc2\x30\x10\x40\xd1\xbd\xa7\x18\x7a\x0d\x57\x93\x26\xd6\x42\x4c\x21\x26\x6e\x43\xa8\x4a\x83\x36\x81\xcc\x88\x3d\xbe\xe8\xce\x9d\x05\x0f\xf0\x1f\x7c\xd4\x4e\x59\x70\x28\xb4\x82\xf9\x71\xe7\x14\xb8\xc6\x4c\x71\xe4\x54\x32\x01\x4a\x09\xed\xa0\xfd\xc1\xc0\xb5\x96\x39\xe4\x0b\x3f\x4b\xbd\x85\x74\x06\x6f\x8e\x7d\x67\x94\x04\xd1\x77\xbd\x71\xdb\xcd\xef\x14\x97\x3f\x41\x63\x2d\x44\x81\x97\x37\x73\x42\xdb\xee\xd1\x82\x54\x3b\xf4\xda\x41\xd3\xac\x91\x3e\x77\xbc\x84\x29\xd2\x04\x42\x0f\x62\xe5\xcf\x77\xfa\x0a\x00\x00\xff\xff\x09\x48\xcf\x50\x56\x01\x00\x00")
+
+func _1688054680_add_columns_to_multitransactionUpSqlBytes() ([]byte, error) {
+ return bindataRead(
+ __1688054680_add_columns_to_multitransactionUpSql,
+ "1688054680_add_columns_to_multitransaction.up.sql",
+ )
+}
+
+func _1688054680_add_columns_to_multitransactionUpSql() (*asset, error) {
+ bytes, err := _1688054680_add_columns_to_multitransactionUpSqlBytes()
+ if err != nil {
+ return nil, err
+ }
+
+ info := bindataFileInfo{name: "1688054680_add_columns_to_multitransaction.up.sql", size: 342, mode: os.FileMode(0644), modTime: time.Unix(1688054624, 0)}
+ a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xb5, 0xbb, 0x88, 0xde, 0x98, 0x9e, 0xa8, 0xc0, 0xf7, 0x2b, 0xc4, 0x33, 0x77, 0xf5, 0x58, 0x46, 0x52, 0xc6, 0xc2, 0x27, 0x1d, 0x8, 0xc9, 0x83, 0xb6, 0x16, 0x31, 0x99, 0x15, 0xcb, 0xb1, 0x40}}
+ return a, nil
+}
+
var _docGo = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x2c\xc9\xb1\x0d\xc4\x20\x0c\x05\xd0\x9e\x29\xfe\x02\xd8\xfd\x6d\xe3\x4b\xac\x2f\x44\x82\x09\x78\x7f\xa5\x49\xfd\xa6\x1d\xdd\xe8\xd8\xcf\x55\x8a\x2a\xe3\x47\x1f\xbe\x2c\x1d\x8c\xfa\x6f\xe3\xb4\x34\xd4\xd9\x89\xbb\x71\x59\xb6\x18\x1b\x35\x20\xa2\x9f\x0a\x03\xa2\xe5\x0d\x00\x00\xff\xff\x60\xcd\x06\xbe\x4a\x00\x00\x00")
func docGoBytes() ([]byte, error) {
@@ -1679,7 +1700,7 @@ func docGo() (*asset, error) {
return nil, err
}
- info := bindataFileInfo{name: "doc.go", size: 74, mode: os.FileMode(0644), modTime: time.Unix(1687889856, 0)}
+ info := bindataFileInfo{name: "doc.go", size: 74, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xde, 0x7c, 0x28, 0xcd, 0x47, 0xf2, 0xfa, 0x7c, 0x51, 0x2d, 0xd8, 0x38, 0xb, 0xb0, 0x34, 0x9d, 0x4c, 0x62, 0xa, 0x9e, 0x28, 0xc3, 0x31, 0x23, 0xd9, 0xbb, 0x89, 0x9f, 0xa0, 0x89, 0x1f, 0xe8}}
return a, nil
}
@@ -1851,6 +1872,7 @@ var _bindata = map[string]func() (*asset, error){
"1687269871_add_device_name.up.sql": _1687269871_add_device_nameUpSql,
"1687506642_include_watch_only_account_setting.up.sql": _1687506642_include_watch_only_account_settingUpSql,
"1688022264_add_include_watch_only_account_to_settings_sync_clock.up.sql": _1688022264_add_include_watch_only_account_to_settings_sync_clockUpSql,
+ "1688054680_add_columns_to_multitransaction.up.sql": _1688054680_add_columns_to_multitransactionUpSql,
"doc.go": docGo,
}
@@ -1976,6 +1998,7 @@ var _bintree = &bintree{nil, map[string]*bintree{
"1687269871_add_device_name.up.sql": {_1687269871_add_device_nameUpSql, map[string]*bintree{}},
"1687506642_include_watch_only_account_setting.up.sql": {_1687506642_include_watch_only_account_settingUpSql, map[string]*bintree{}},
"1688022264_add_include_watch_only_account_to_settings_sync_clock.up.sql": {_1688022264_add_include_watch_only_account_to_settings_sync_clockUpSql, map[string]*bintree{}},
+ "1688054680_add_columns_to_multitransaction.up.sql": {_1688054680_add_columns_to_multitransactionUpSql, map[string]*bintree{}},
"doc.go": {docGo, map[string]*bintree{}},
}}
diff --git a/appdatabase/migrations/sql/1688054680_add_columns_to_multitransaction.up.sql b/appdatabase/migrations/sql/1688054680_add_columns_to_multitransaction.up.sql
new file mode 100644
index 000000000..eba1882e0
--- /dev/null
+++ b/appdatabase/migrations/sql/1688054680_add_columns_to_multitransaction.up.sql
@@ -0,0 +1,5 @@
+ALTER TABLE multi_transactions ADD COLUMN from_network_id UNSIGNED BIGINT;
+ALTER TABLE multi_transactions ADD COLUMN to_network_id UNSIGNED BIGINT;
+ALTER TABLE multi_transactions ADD COLUMN cross_tx_id VARCHAR DEFAULT "";
+ALTER TABLE multi_transactions ADD COLUMN from_tx_hash BLOB;
+ALTER TABLE multi_transactions ADD COLUMN to_tx_hash BLOB;
diff --git a/go.mod b/go.mod
index 876b482ff..ba11e0302 100644
--- a/go.mod
+++ b/go.mod
@@ -2,7 +2,7 @@ module github.com/status-im/status-go
go 1.19
-replace github.com/ethereum/go-ethereum v1.10.26 => github.com/status-im/go-ethereum v1.10.25-status.6
+replace github.com/ethereum/go-ethereum v1.10.26 => github.com/status-im/go-ethereum v1.10.25-status.7
replace github.com/docker/docker => github.com/docker/engine v1.4.2-0.20190717161051-705d9623b7c1
diff --git a/go.sum b/go.sum
index 417bd0410..0d78bb703 100644
--- a/go.sum
+++ b/go.sum
@@ -1975,8 +1975,8 @@ github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/y
github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg=
github.com/status-im/doubleratchet v3.0.0+incompatible h1:aJ1ejcSERpSzmWZBgtfYtiU2nF0Q8ZkGyuEPYETXkCY=
github.com/status-im/doubleratchet v3.0.0+incompatible/go.mod h1:1sqR0+yhiM/bd+wrdX79AOt2csZuJOni0nUDzKNuqOU=
-github.com/status-im/go-ethereum v1.10.25-status.6 h1:5YC8k1inTBqA6LpON0uX6y86niOKukA/LnKxzd5GFyI=
-github.com/status-im/go-ethereum v1.10.25-status.6/go.mod h1:Dt4K5JYMhJRdtXJwBEyGZLZn9iz/chSOZyjVmt5ZhwQ=
+github.com/status-im/go-ethereum v1.10.25-status.7 h1:egCCdvUQSdfnnDcv2vP1RCuIDr184eYlBvyucxuKJj8=
+github.com/status-im/go-ethereum v1.10.25-status.7/go.mod h1:Dt4K5JYMhJRdtXJwBEyGZLZn9iz/chSOZyjVmt5ZhwQ=
github.com/status-im/go-multiaddr-ethv4 v1.2.5 h1:pN+ey6wYKbvNNu5/xq9+VL0N8Yq0pZUTbZp0URg+Yn4=
github.com/status-im/go-multiaddr-ethv4 v1.2.5/go.mod h1:Fhe/18yWU5QwlAYiOO3Bb1BLe0bn5YobcNBHsjRr4kk=
github.com/status-im/go-sqlcipher/v4 v4.5.4-status.2 h1:Oi9JTAI2DZEe5UKlpUcvKBCCSn3ULsLIrix7jPnEoPE=
diff --git a/services/wallet/common/log_parser.go b/services/wallet/common/log_parser.go
index 09dec9cd2..2c4ba474e 100644
--- a/services/wallet/common/log_parser.go
+++ b/services/wallet/common/log_parser.go
@@ -25,16 +25,20 @@ const (
Erc721Transfer Type = "erc721"
UniswapV2Swap Type = "uniswapV2Swap"
UniswapV3Swap Type = "uniswapV3Swap"
+ HopBridgeFrom Type = "HopBridgeFrom"
+ HopBridgeTo Type = "HopBridgeTo"
unknownTransaction Type = "unknown"
// Event types
- WETHDepositEventType EventType = "wethDepositEvent"
- WETHWithdrawalEventType EventType = "wethWithdrawalEvent"
- Erc20TransferEventType EventType = "erc20Event"
- Erc721TransferEventType EventType = "erc721Event"
- UniswapV2SwapEventType EventType = "uniswapV2SwapEvent"
- UniswapV3SwapEventType EventType = "uniswapV3SwapEvent"
- UnknownEventType EventType = "unknownEvent"
+ WETHDepositEventType EventType = "wethDepositEvent"
+ WETHWithdrawalEventType EventType = "wethWithdrawalEvent"
+ Erc20TransferEventType EventType = "erc20Event"
+ Erc721TransferEventType EventType = "erc721Event"
+ UniswapV2SwapEventType EventType = "uniswapV2SwapEvent"
+ UniswapV3SwapEventType EventType = "uniswapV3SwapEvent"
+ HopBridgeTransferSentToL2EventType EventType = "hopBridgeTransferSentToL2Event"
+ HopBridgeTransferFromL1CompletedEventType EventType = "hopBridgeTransferFromL1CompletedEvent"
+ UnknownEventType EventType = "unknownEvent"
// Deposit (index_topic_1 address dst, uint256 wad)
wethDepositEventSignature = "Deposit(address,uint256)"
@@ -52,6 +56,11 @@ const (
uniswapV2SwapEventSignature = "Swap(address,uint256,uint256,uint256,uint256,address)" // also used by SushiSwap
// Swap (index_topic_1 address sender, index_topic_2 address recipient, int256 amount0, int256 amount1, uint160 sqrtPriceX96, uint128 liquidity, int24 tick)
uniswapV3SwapEventSignature = "Swap(address,address,int256,int256,uint160,uint128,int24)"
+
+ // TransferSentToL2 (index_topic_1 uint256 chainId, index_topic_2 address recipient, uint256 amount, uint256 amountOutMin, uint256 deadline, index_topic_3 address relayer, uint256 relayerFee)
+ hopBridgeTransferSentToL2EventSignature = "TransferSentToL2(uint256,address,uint256,uint256,uint256,address,uint256)"
+ // TransferFromL1Completed (index_topic_1 address recipient, uint256 amount, uint256 amountOutMin, uint256 deadline, index_topic_2 address relayer, uint256 relayerFee)
+ HopBridgeTransferFromL1CompletedEventSignature = "TransferFromL1Completed(address,uint256,uint256,uint256,address,uint256)"
)
var (
@@ -66,6 +75,8 @@ func GetEventType(log *types.Log) EventType {
erc20_721TransferEventSignatureHash := GetEventSignatureHash(Erc20_721TransferEventSignature)
uniswapV2SwapEventSignatureHash := GetEventSignatureHash(uniswapV2SwapEventSignature)
uniswapV3SwapEventSignatureHash := GetEventSignatureHash(uniswapV3SwapEventSignature)
+ hopBridgeTransferSentToL2EventSignatureHash := GetEventSignatureHash(hopBridgeTransferSentToL2EventSignature)
+ hopBridgeTransferFromL1CompletedEventSignatureHash := GetEventSignatureHash(HopBridgeTransferFromL1CompletedEventSignature)
if len(log.Topics) > 0 {
switch log.Topics[0] {
@@ -84,6 +95,10 @@ func GetEventType(log *types.Log) EventType {
return UniswapV2SwapEventType
case uniswapV3SwapEventSignatureHash:
return UniswapV3SwapEventType
+ case hopBridgeTransferSentToL2EventSignatureHash:
+ return HopBridgeTransferSentToL2EventType
+ case hopBridgeTransferFromL1CompletedEventSignatureHash:
+ return HopBridgeTransferFromL1CompletedEventType
}
}
@@ -100,6 +115,10 @@ func EventTypeToSubtransactionType(eventType EventType) Type {
return UniswapV2Swap
case UniswapV3SwapEventType:
return UniswapV3Swap
+ case HopBridgeTransferSentToL2EventType:
+ return HopBridgeFrom
+ case HopBridgeTransferFromL1CompletedEventType:
+ return HopBridgeTo
}
return unknownTransaction
@@ -296,6 +315,74 @@ func ParseUniswapV3Log(ethlog *types.Log) (poolAddress common.Address, sender co
return
}
+func ParseHopBridgeTransferSentToL2Log(ethlog *types.Log) (chainID uint64, recipient common.Address, relayer common.Address, amount *big.Int, err error) {
+ chainIDInt := new(big.Int)
+ amount = new(big.Int)
+
+ if len(ethlog.Topics) < 4 {
+ err = fmt.Errorf("not enough topics for HopBridgeTransferSentToL2 event %s, %v", "topics", ethlog.Topics)
+ return
+ }
+
+ if len(ethlog.Topics[1]) != 32 {
+ err = fmt.Errorf("second topic is not padded to 32 byte address %s, %v", "topic", ethlog.Topics[1])
+ return
+ }
+ chainIDInt.SetBytes(ethlog.Topics[1][:])
+ chainID = chainIDInt.Uint64()
+
+ if len(ethlog.Topics[2]) != 32 {
+ err = fmt.Errorf("third topic is not padded to 32 byte address %s, %v", "topic", ethlog.Topics[2])
+ return
+ }
+ copy(recipient[:], ethlog.Topics[2][12:])
+
+ if len(ethlog.Topics[3]) != 32 {
+ err = fmt.Errorf("fourth topic is not padded to 32 byte address %s, %v", "topic", ethlog.Topics[3])
+ return
+ }
+ copy(relayer[:], ethlog.Topics[3][12:])
+
+ if len(ethlog.Data) != 32*4 {
+ err = fmt.Errorf("data is not padded to 4 * 32 bytes big int %s, %v", "data", ethlog.Data)
+ return
+ }
+
+ amount.SetBytes(ethlog.Data[0:32])
+
+ return
+}
+
+func ParseHopBridgeTransferFromL1CompletedLog(ethlog *types.Log) (recipient common.Address, relayer common.Address, amount *big.Int, err error) {
+ amount = new(big.Int)
+
+ if len(ethlog.Topics) < 3 {
+ err = fmt.Errorf("not enough topics for HopBridgeTransferFromL1Completed event %s, %v", "topics", ethlog.Topics)
+ return
+ }
+
+ if len(ethlog.Topics[1]) != 32 {
+ err = fmt.Errorf("second topic is not padded to 32 byte address %s, %v", "topic", ethlog.Topics[1])
+ return
+ }
+ copy(recipient[:], ethlog.Topics[1][12:])
+
+ if len(ethlog.Topics[2]) != 32 {
+ err = fmt.Errorf("third topic is not padded to 32 byte address %s, %v", "topic", ethlog.Topics[2])
+ return
+ }
+ copy(relayer[:], ethlog.Topics[2][12:])
+
+ if len(ethlog.Data) != 32*4 {
+ err = fmt.Errorf("data is not padded to 4 * 32 bytes big int %s, %v", "data", ethlog.Data)
+ return
+ }
+
+ amount.SetBytes(ethlog.Data[0:32])
+
+ return
+}
+
func GetEventSignatureHash(signature string) common.Hash {
return crypto.Keccak256Hash([]byte(signature))
}
@@ -333,3 +420,35 @@ func ExtractTokenIdentity(dbEntryType Type, log *types.Log, tx *types.Transactio
return
}
+
+func TxDataContainsAddress(txType uint8, txData []byte, address common.Address) bool {
+ // First 4 bytes are related to the methodID
+ const methodIDLen int = 4
+ const paramLen int = 32
+
+ var paramOffset int = 0
+ switch txType {
+ case types.OptimismDepositTxType:
+ // Offset for relayMessage data.
+ // I actually don't know what the 2x32 + 4 bytes mean, but it seems to be constant in all transactions I've
+ // checked. Will update the comment when I find out more about it.
+ paramOffset = 5*32 + 2*32 + 4
+ }
+
+ // Check if address is contained in any 32-byte parameter
+ for paramStart := methodIDLen + paramOffset; paramStart < len(txData); paramStart += paramLen {
+ paramEnd := paramStart + paramLen
+
+ if paramEnd > len(txData) {
+ break
+ }
+
+ // Address bytes should be in the last addressLen positions
+ paramBytes := txData[paramStart:paramEnd]
+ paramAddress := common.BytesToAddress(paramBytes)
+ if address == paramAddress {
+ return true
+ }
+ }
+ return false
+}
diff --git a/services/wallet/common/log_paser_test.go b/services/wallet/common/log_paser_test.go
new file mode 100644
index 000000000..439bc57f4
--- /dev/null
+++ b/services/wallet/common/log_paser_test.go
@@ -0,0 +1,61 @@
+package common
+
+import (
+ "encoding/hex"
+ "encoding/json"
+ "testing"
+
+ "github.com/ethereum/go-ethereum/common"
+ "github.com/ethereum/go-ethereum/core/types"
+ "github.com/stretchr/testify/require"
+)
+
+func TestLegacyTxDataContainsAddress(t *testing.T) {
+ txDataString := "deace8f5000000000000000000000000000000000000000000000000000000000000000a00000000000000000" +
+ "0000000d6255ae13ac335b347aa846802ad6ac39dd2543a000000000000000000000000000000000000000000000000002c68af0bb" +
+ "14000000000000000000000000000000000000000000000000000002c29ddae0698830000000000000000000000000000000000000" +
+ "0000000000000000000649a33b3000000000000000000000000710bda329b2a6224e4b44833de30f38e7f81d564000000000000000" +
+ "0000000000000000000000000000000000000000000000000"
+
+ txData, err := hex.DecodeString(txDataString)
+ require.NoError(t, err)
+
+ containedAddress := common.HexToAddress("0xd6255aE13aC335b347aa846802aD6aC39dd2543a")
+ randomAddress := common.HexToAddress("0xb8901acB165ed027E32754E0FFe830802919727f")
+
+ require.True(t, TxDataContainsAddress(types.LegacyTxType, txData, containedAddress))
+ require.False(t, TxDataContainsAddress(types.LegacyTxType, txData, randomAddress))
+}
+
+func TestOptDepositTxDataContainsAddress(t *testing.T) {
+ txDataString := "d764ad0b00010000000000000000000000000000000000000000000000000000000019b7000000000000000000000000a45df1a388049fb8d76e72d350d24e2c3f7aebd100000000000000000000000083f6244bd87662118d96d9a6d44f09dfff14b30e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000249f000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000c4cc29a306000000000000000000000000e813d34c0525e0fbb1e6478b86d40b83603c200800000000000000000000000000000000000000000000000000470de4df8200000000000000000000000000000000000000000000000000000046a8e2b55dea2100000000000000000000000000000000000000000000000000000000649d6931000000000000000000000000710bda329b2a6224e4b44833de30f38e7f81d564000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
+
+ txData, err := hex.DecodeString(txDataString)
+ require.NoError(t, err)
+
+ containedAddress := common.HexToAddress("0xE813d34C0525E0fBb1e6478B86D40B83603C2008")
+ randomAddress := common.HexToAddress("0xb8901acB165ed027E32754E0FFe830802919727f")
+
+ require.True(t, TxDataContainsAddress(types.OptimismDepositTxType, txData, containedAddress))
+ require.False(t, TxDataContainsAddress(types.OptimismDepositTxType, txData, randomAddress))
+}
+
+func TestLogHopBridgeTransferSentToL2(t *testing.T) {
+ eventLogTestData := `{"address":"0xb8901acb165ed027e32754e0ffe830802919727f","topics":["0x0a0607688c86ec1775abcdbab7b33a3a35a6c9cde677c9be880150c231cc6b0b","0x000000000000000000000000000000000000000000000000000000000000000a","0x000000000000000000000000d6255ae13ac335b347aa846802ad6ac39dd2543a","0x000000000000000000000000710bda329b2a6224e4b44833de30f38e7f81d564"],"data":"0x000000000000000000000000000000000000000000000000002c68af0bb14000000000000000000000000000000000000000000000000000002c29ddae06988300000000000000000000000000000000000000000000000000000000649a33b30000000000000000000000000000000000000000000000000000000000000000","blockNumber":"0x10b4baf","transactionHash":"0xfc4687f8d985ef0cc86d79a0c7abc582552b8bae0e13a90c59eeadf7e64ed569","transactionIndex":"0x48","blockHash":"0xea7f003d02a43be4dfec836803a033c0ce22ecf9a48d4a3ed3700db9c722d994","logIndex":"0xfa","removed":false}`
+ var eventLog types.Log
+ err := json.Unmarshal([]byte(eventLogTestData), &eventLog)
+ require.NoError(t, err)
+
+ eventType := GetEventType(&eventLog)
+ require.Equal(t, HopBridgeTransferSentToL2EventType, eventType)
+}
+
+func TestLogHopBridgeTransferFromL1Completed(t *testing.T) {
+ eventLogTestData := `{"address":"0x83f6244Bd87662118d96D9a6D44f09dffF14b30E","topics":["0x320958176930804eb66c2343c7343fc0367dc16249590c0f195783bee199d094","0x000000000000000000000000d6255ae13ac335b347aa846802ad6ac39dd2543a","0x000000000000000000000000710bda329b2a6224e4b44833de30f38e7f81d564"],"data":"0x000000000000000000000000000000000000000000000000002c68af0bb14000000000000000000000000000000000000000000000000000002c29ddae06988300000000000000000000000000000000000000000000000000000000649a33b30000000000000000000000000000000000000000000000000000000000000000","blockNumber":"0x64E8FF0","transactionHash":"0x67a6f407824be389e6a960ebb1ddbe7e2f24a809a86b50452ee3dc70cc708d00","transactionIndex":"0x48","blockHash":"0xea7f003d02a43be4dfec836803a033c0ce22ecf9a48d4a3ed3700db9c722d994","logIndex":"0xfa","removed":false}`
+ var eventLog types.Log
+ err := json.Unmarshal([]byte(eventLogTestData), &eventLog)
+ require.NoError(t, err)
+
+ eventType := GetEventType(&eventLog)
+ require.Equal(t, HopBridgeTransferFromL1CompletedEventType, eventType)
+}
diff --git a/services/wallet/transfer/bridge_identifier.go b/services/wallet/transfer/bridge_identifier.go
new file mode 100644
index 000000000..03a67e9bd
--- /dev/null
+++ b/services/wallet/transfer/bridge_identifier.go
@@ -0,0 +1,130 @@
+package transfer
+
+import (
+ "context"
+ "encoding/hex"
+ "fmt"
+
+ "github.com/ethereum/go-ethereum/common"
+ "github.com/ethereum/go-ethereum/common/hexutil"
+ "github.com/status-im/status-go/rpc/chain"
+ w_common "github.com/status-im/status-go/services/wallet/common"
+ "github.com/status-im/status-go/services/wallet/token"
+)
+
+// TODO: Find proper way to uniquely match Origin and Destination transactions (some sort of hash or uniqueID)
+// Current approach is not failsafe (for example, if multiple identical bridge operations are triggered
+// at the same time)
+// Recipient + Relayer + Data should match in both Origin and Destination transactions
+func getHopBridgeCrossTxID(recipient common.Address, relayer common.Address, logData []byte) string {
+ return fmt.Sprintf("%s_%s_%s", recipient.String(), relayer.String(), hex.EncodeToString(logData))
+}
+
+func buildHopBridgeMultitransaction(ctx context.Context, client *chain.ClientWithFallback, transactionManager *TransactionManager, tokenManager *token.Manager, subTx *Transfer) (*MultiTransaction, error) {
+ // Identify if it's from/to transaction
+ switch w_common.GetEventType(subTx.Log) {
+ case w_common.HopBridgeTransferSentToL2EventType:
+ // L1-L2 Origin transaciton
+ fromChainID := subTx.NetworkID
+ fromTxHash := subTx.Receipt.TxHash
+
+ toChainID, recipient, relayer, fromAmount, err := w_common.ParseHopBridgeTransferSentToL2Log(subTx.Log)
+ if err != nil {
+ return nil, err
+ }
+ crossTxID := getHopBridgeCrossTxID(recipient, relayer, subTx.Log.Data)
+
+ // Try to find "destination" half of the multiTx
+ multiTx, err := transactionManager.GetBridgeDestinationMultiTransaction(ctx, toChainID, crossTxID)
+ if err != nil {
+ return nil, err
+ }
+
+ if multiTx == nil {
+ multiTx = &MultiTransaction{
+ // Data from "origin" transaction
+ FromNetworkID: fromChainID,
+ FromTxHash: fromTxHash,
+ FromAddress: subTx.From,
+ FromAsset: "ETH",
+ FromAmount: (*hexutil.Big)(fromAmount),
+ ToNetworkID: toChainID,
+ ToAddress: recipient,
+ // To be replaced by "destination" transaction, need to be non-null
+ ToAmount: (*hexutil.Big)(fromAmount),
+ // Common data
+ Type: MultiTransactionBridge,
+ CrossTxID: crossTxID,
+ }
+
+ _, err := transactionManager.InsertMultiTransaction(multiTx)
+ if err != nil {
+ return nil, err
+ }
+
+ } else {
+ multiTx.FromNetworkID = fromChainID
+ multiTx.FromTxHash = fromTxHash
+ multiTx.FromAddress = subTx.From
+ multiTx.FromAsset = "ETH"
+ multiTx.FromAmount = (*hexutil.Big)(fromAmount)
+
+ err := transactionManager.UpdateMultiTransaction(multiTx)
+ if err != nil {
+ return nil, err
+ }
+ }
+ return multiTx, nil
+
+ case w_common.HopBridgeTransferFromL1CompletedEventType:
+ // L1-L2 Destination transaciton
+ toChainID := subTx.NetworkID
+ toTxHash := subTx.Receipt.TxHash
+
+ recipient, relayer, toAmount, err := w_common.ParseHopBridgeTransferFromL1CompletedLog(subTx.Log)
+ if err != nil {
+ return nil, err
+ }
+ crossTxID := getHopBridgeCrossTxID(recipient, relayer, subTx.Log.Data)
+
+ // Try to find "origin" half of the multiTx
+ multiTx, err := transactionManager.GetBridgeOriginMultiTransaction(ctx, toChainID, crossTxID)
+ if err != nil {
+ return nil, err
+ }
+
+ if multiTx == nil {
+ multiTx = &MultiTransaction{
+ // To be replaced by "origin" transaction, need to be non-null
+ FromAddress: recipient,
+ FromAsset: "ETH",
+ FromAmount: (*hexutil.Big)(toAmount),
+ // Data from "destination" transaction
+ ToNetworkID: toChainID,
+ ToTxHash: toTxHash,
+ ToAddress: recipient,
+ ToAsset: "ETH",
+ ToAmount: (*hexutil.Big)(toAmount),
+ // Common data
+ Type: MultiTransactionBridge,
+ CrossTxID: crossTxID,
+ }
+
+ _, err := transactionManager.InsertMultiTransaction(multiTx)
+ if err != nil {
+ return nil, err
+ }
+ } else {
+ multiTx.ToTxHash = toTxHash
+ multiTx.ToAsset = "ETH"
+ multiTx.ToAmount = (*hexutil.Big)(toAmount)
+
+ err := transactionManager.UpdateMultiTransaction(multiTx)
+ if err != nil {
+ return nil, err
+ }
+ }
+ return multiTx, nil
+ }
+ return nil, nil
+}
diff --git a/services/wallet/transfer/commands.go b/services/wallet/transfer/commands.go
index c0911e6bd..a238791b4 100644
--- a/services/wallet/transfer/commands.go
+++ b/services/wallet/transfer/commands.go
@@ -491,6 +491,26 @@ func (c *transfersCommand) checkAndProcessSwapMultiTx(ctx context.Context, tx Tr
return false, nil
}
+func (c *transfersCommand) checkAndProcessBridgeMultiTx(ctx context.Context, tx Transaction) (bool, error) {
+ for _, subTx := range tx {
+ switch subTx.Type {
+ // If the Tx contains any hopBridge subTx, create/update Bridge multiTx
+ case w_common.HopBridgeFrom, w_common.HopBridgeTo:
+ multiTransaction, err := buildHopBridgeMultitransaction(ctx, c.chainClient, c.transactionManager, c.tokenManager, subTx)
+ if err != nil {
+ return false, err
+ }
+
+ if multiTransaction != nil {
+ setMultiTxID(tx, MultiTransactionIDType(multiTransaction.ID))
+ return true, nil
+ }
+ }
+ }
+
+ return false, nil
+}
+
func (c *transfersCommand) processMultiTransactions(ctx context.Context, allTransfers []Transfer) error {
txByTxHash := subTransactionListToTransactionsByTxHash(allTransfers)
@@ -505,7 +525,16 @@ func (c *transfersCommand) processMultiTransactions(ctx context.Context, allTran
}
// Then check for a Swap transaction
- _, err = c.checkAndProcessSwapMultiTx(ctx, tx)
+ txProcessed, err := c.checkAndProcessSwapMultiTx(ctx, tx)
+ if err != nil {
+ return err
+ }
+ if txProcessed {
+ continue
+ }
+
+ // Then check for a Bridge transaction
+ _, err = c.checkAndProcessBridgeMultiTx(ctx, tx)
if err != nil {
return err
}
@@ -694,7 +723,7 @@ func (c *findAndCheckBlockRangeCommand) fastIndexErc20(ctx context.Context, from
commands := make([]*erc20HistoricalCommand, len(c.accounts))
for i, address := range c.accounts {
erc20 := &erc20HistoricalCommand{
- erc20: NewERC20TransfersDownloader(c.chainClient, []common.Address{address}, types.NewLondonSigner(c.chainClient.ToBigInt())),
+ erc20: NewERC20TransfersDownloader(c.chainClient, []common.Address{address}, types.LatestSignerForChainID(c.chainClient.ToBigInt())),
chainClient: c.chainClient,
feed: c.feed,
address: address,
@@ -735,7 +764,7 @@ func loadTransfers(ctx context.Context, accounts []common.Address, blockDAO *Blo
eth: ÐDownloader{
chainClient: chainClient,
accounts: []common.Address{address},
- signer: types.NewLondonSigner(chainClient.ToBigInt()),
+ signer: types.LatestSignerForChainID(chainClient.ToBigInt()),
db: db,
},
blockNums: blocksByAddress[address],
diff --git a/services/wallet/transfer/commands_sequential.go b/services/wallet/transfer/commands_sequential.go
index 3ccc29de1..663305b23 100644
--- a/services/wallet/transfer/commands_sequential.go
+++ b/services/wallet/transfer/commands_sequential.go
@@ -296,7 +296,7 @@ func (c *findBlocksCommand) fastIndexErc20(ctx context.Context, fromBlockNumber
group := async.NewGroup(ctx)
erc20 := &erc20HistoricalCommand{
- erc20: NewERC20TransfersDownloader(c.chainClient, []common.Address{c.account}, types.NewLondonSigner(c.chainClient.ToBigInt())),
+ erc20: NewERC20TransfersDownloader(c.chainClient, []common.Address{c.account}, types.LatestSignerForChainID(c.chainClient.ToBigInt())),
chainClient: c.chainClient,
feed: c.feed,
address: c.account,
diff --git a/services/wallet/transfer/controller.go b/services/wallet/transfer/controller.go
index 4197d436b..9ad10cc6a 100644
--- a/services/wallet/transfer/controller.go
+++ b/services/wallet/transfer/controller.go
@@ -193,7 +193,7 @@ func (c *Controller) LoadTransferByHash(ctx context.Context, rpcClient *rpc.Clie
return err
}
- signer := types.NewLondonSigner(chainClient.ToBigInt())
+ signer := types.LatestSignerForChainID(chainClient.ToBigInt())
transfer, err := getTransferByHash(ctx, chainClient, signer, address, hash)
if err != nil {
@@ -231,7 +231,7 @@ func (c *Controller) GetTransfersByAddress(ctx context.Context, chainID uint64,
func (c *Controller) GetTransfersForIdentities(ctx context.Context, identities []TransactionIdentity) ([]View, error) {
rst, err := c.db.GetTransfersForIdentities(ctx, identities)
if err != nil {
- log.Error("[transfer.Controller.GetTransfersByAddress] DB err", err)
+ log.Error("[transfer.Controller.GetTransfersForIdentities] DB err", err)
return nil, err
}
diff --git a/services/wallet/transfer/downloader.go b/services/wallet/transfer/downloader.go
index 42c0db378..d0cd8b5d3 100644
--- a/services/wallet/transfer/downloader.go
+++ b/services/wallet/transfer/downloader.go
@@ -153,13 +153,17 @@ func (d *ETHDownloader) getTransfersInBlock(ctx context.Context, blk *types.Bloc
if err != nil {
return nil, err
}
+
+ areSubTxsCheckedForTxHash := make(map[common.Hash]bool)
+
for _, t := range transactionsToLoad {
subtransactions, err := d.subTransactionsFromTransactionHash(ctx, t.Log.TxHash, address)
if err != nil {
- log.Error("can't fetch erc20 transfer from log", "error", err)
+ log.Error("can't fetch subTxs for erc20/erc721 transfer", "error", err)
return nil, err
}
rst = append(rst, subtransactions...)
+ areSubTxsCheckedForTxHash[t.Log.TxHash] = true
}
for _, tx := range blk.Transactions() {
@@ -176,24 +180,46 @@ func (d *ETHDownloader) getTransfersInBlock(ctx context.Context, blk *types.Bloc
return nil, err
}
- if from == address || (tx.To() != nil && *tx.To() == address) {
+ isPlainTransfer := from == address || (tx.To() != nil && *tx.To() == address)
+ mustCheckSubTxs := false
+
+ if !isPlainTransfer {
+ // We might miss some subTransactions of interest for some transaction types. We need to check if we
+ // find the address in the transaction data.
+ switch tx.Type() {
+ case types.OptimismDepositTxType, types.ArbitrumDepositTxType, types.ArbitrumRetryTxType:
+ mustCheckSubTxs = !areSubTxsCheckedForTxHash[tx.Hash()] && w_common.TxDataContainsAddress(tx.Type(), tx.Data(), address)
+ }
+ }
+
+ if isPlainTransfer || mustCheckSubTxs {
receipt, err := d.chainClient.TransactionReceipt(ctx, tx.Hash())
if err != nil {
return nil, err
}
- eventType, _ := w_common.GetFirstEvent(receipt.Logs)
-
baseGasFee, err := d.chainClient.GetBaseFeeFromBlock(blk.Number())
if err != nil {
return nil, err
}
- // If the transaction is not already some known transfer type, add it
- // to the list as a plain eth transfer
- if eventType == w_common.UnknownEventType {
+ // Since we've already got the receipt, check for subTxs of
+ // interest in case we haven't already.
+ if !areSubTxsCheckedForTxHash[tx.Hash()] {
+ subtransactions, err := d.subTransactionsFromTransactionData(tx, receipt, blk, baseGasFee, address)
+ if err != nil {
+ log.Error("can't fetch subTxs for eth transfer", "error", err)
+ return nil, err
+ }
+ rst = append(rst, subtransactions...)
+ areSubTxsCheckedForTxHash[tx.Hash()] = true
+ }
+
+ // If it's a plain ETH transfer, add it to the list
+ if isPlainTransfer {
rst = append(rst, Transfer{
Type: w_common.EthTransfer,
+ NetworkID: tx.ChainId().Uint64(),
ID: tx.Hash(),
Address: address,
BlockNumber: blk.Number(),
@@ -263,12 +289,16 @@ func (d *ETHDownloader) subTransactionsFromTransactionHash(parent context.Contex
if err != nil {
return nil, err
}
- from, err := types.Sender(d.signer, tx)
+
+ ctx, cancel = context.WithTimeout(parent, 3*time.Second)
+ receipt, err := d.chainClient.TransactionReceipt(ctx, txHash)
+ cancel()
if err != nil {
return nil, err
}
+
ctx, cancel = context.WithTimeout(parent, 3*time.Second)
- receipt, err := d.chainClient.TransactionReceipt(ctx, txHash)
+ blk, err := d.chainClient.BlockByHash(ctx, receipt.BlockHash)
cancel()
if err != nil {
return nil, err
@@ -279,10 +309,15 @@ func (d *ETHDownloader) subTransactionsFromTransactionHash(parent context.Contex
return nil, err
}
- ctx, cancel = context.WithTimeout(parent, 3*time.Second)
- blk, err := d.chainClient.BlockByHash(ctx, receipt.BlockHash)
- cancel()
+ return d.subTransactionsFromTransactionData(tx, receipt, blk, baseGasFee, address)
+}
+
+func (d *ETHDownloader) subTransactionsFromTransactionData(tx *types.Transaction, receipt *types.Receipt, blk *types.Block, baseGasFee string, address common.Address) ([]Transfer, error) {
+ from, err := types.Sender(d.signer, tx)
if err != nil {
+ if err == core.ErrTxTypeNotSupported {
+ return nil, nil
+ }
return nil, err
}
@@ -295,17 +330,19 @@ func (d *ETHDownloader) subTransactionsFromTransactionHash(parent context.Contex
mustAppend := false
switch eventType {
case w_common.Erc20TransferEventType:
- from, to, _ := w_common.ParseErc20TransferLog(log)
- if from == address || to == address {
+ trFrom, trTo, _ := w_common.ParseErc20TransferLog(log)
+ if trFrom == address || trTo == address {
mustAppend = true
}
case w_common.Erc721TransferEventType:
- from, to, _ := w_common.ParseErc721TransferLog(log)
- if from == address || to == address {
+ trFrom, trTo, _ := w_common.ParseErc721TransferLog(log)
+ if trFrom == address || trTo == address {
mustAppend = true
}
case w_common.UniswapV2SwapEventType, w_common.UniswapV3SwapEventType:
mustAppend = true
+ case w_common.HopBridgeTransferSentToL2EventType, w_common.HopBridgeTransferFromL1CompletedEventType:
+ mustAppend = true
}
if mustAppend {
@@ -316,6 +353,7 @@ func (d *ETHDownloader) subTransactionsFromTransactionHash(parent context.Contex
BlockNumber: new(big.Int).SetUint64(log.BlockNumber),
BlockHash: log.BlockHash,
Loaded: true,
+ NetworkID: d.signer.ChainID().Uint64(),
From: from,
Log: log,
BaseGasFees: baseGasFee,
diff --git a/services/wallet/transfer/reactor.go b/services/wallet/transfer/reactor.go
index 2733ba817..2acfb7c2e 100644
--- a/services/wallet/transfer/reactor.go
+++ b/services/wallet/transfer/reactor.go
@@ -70,7 +70,7 @@ type OnDemandFetchStrategy struct {
}
func (s *OnDemandFetchStrategy) newControlCommand(chainClient *chain.ClientWithFallback, accounts []common.Address) *controlCommand {
- signer := types.NewLondonSigner(chainClient.ToBigInt())
+ signer := types.LatestSignerForChainID(chainClient.ToBigInt())
ctl := &controlCommand{
db: s.db,
chainClient: chainClient,
diff --git a/services/wallet/transfer/swap_identifier.go b/services/wallet/transfer/swap_identifier.go
index b30fda746..c05167387 100644
--- a/services/wallet/transfer/swap_identifier.go
+++ b/services/wallet/transfer/swap_identifier.go
@@ -203,9 +203,13 @@ func fetchUniswapInfo(ctx context.Context, client *chain.ClientWithFallback, tok
// We only care about the first and last swap to identify the input/output token and amounts
func buildUniswapSwapMultitransaction(ctx context.Context, client *chain.ClientWithFallback, tokenManager *token.Manager, transfer *Transfer) (*MultiTransaction, error) {
multiTransaction := MultiTransaction{
- Type: MultiTransactionSwap,
- FromAddress: transfer.Address,
- ToAddress: transfer.Address,
+ Type: MultiTransactionSwap,
+ FromNetworkID: transfer.NetworkID,
+ FromTxHash: transfer.Receipt.TxHash,
+ FromAddress: transfer.Address,
+ ToNetworkID: transfer.NetworkID,
+ ToTxHash: transfer.Receipt.TxHash,
+ ToAddress: transfer.Address,
}
var firstSwapLog, lastSwapLog *types.Log
diff --git a/services/wallet/transfer/transaction.go b/services/wallet/transfer/transaction.go
index b3db25432..7f6c87c48 100644
--- a/services/wallet/transfer/transaction.go
+++ b/services/wallet/transfer/transaction.go
@@ -52,6 +52,10 @@ func NewTransactionManager(db *sql.DB, gethManager *account.GethManager, transac
}
}
+var (
+ emptyHash = common.Hash{}
+)
+
type MultiTransactionType uint8
const (
@@ -61,15 +65,20 @@ const (
)
type MultiTransaction struct {
- ID uint `json:"id"`
- Timestamp uint64 `json:"timestamp"`
- FromAddress common.Address `json:"fromAddress"`
- ToAddress common.Address `json:"toAddress"`
- FromAsset string `json:"fromAsset"`
- ToAsset string `json:"toAsset"`
- FromAmount *hexutil.Big `json:"fromAmount"`
- ToAmount *hexutil.Big `json:"toAmount"`
- Type MultiTransactionType `json:"type"`
+ ID uint `json:"id"`
+ Timestamp uint64 `json:"timestamp"`
+ FromNetworkID uint64 `json:"fromNetworkID"`
+ ToNetworkID uint64 `json:"toNetworkID"`
+ FromTxHash common.Hash `json:"fromTxHash"`
+ ToTxHash common.Hash `json:"toTxHash"`
+ FromAddress common.Address `json:"fromAddress"`
+ ToAddress common.Address `json:"toAddress"`
+ FromAsset string `json:"fromAsset"`
+ ToAsset string `json:"toAsset"`
+ FromAmount *hexutil.Big `json:"fromAmount"`
+ ToAmount *hexutil.Big `json:"toAmount"`
+ Type MultiTransactionType `json:"type"`
+ CrossTxID string
}
type MultiTransactionCommand struct {
@@ -321,29 +330,85 @@ func (tm *TransactionManager) Watch(ctx context.Context, transactionHash common.
return watchTxCommand.Command()(commandContext)
}
-const multiTransactionColumns = "from_address, from_asset, from_amount, to_address, to_asset, to_amount, type, timestamp"
+const multiTransactionColumns = "from_network_id, from_tx_hash, from_address, from_asset, from_amount, to_network_id, to_tx_hash, to_address, to_asset, to_amount, type, cross_tx_id, timestamp"
+
+func rowsToMultiTransactions(rows *sql.Rows) ([]*MultiTransaction, error) {
+ var multiTransactions []*MultiTransaction
+ for rows.Next() {
+ multiTransaction := &MultiTransaction{}
+ var fromAmountDB, toAmountDB sql.NullString
+ err := rows.Scan(
+ &multiTransaction.ID,
+ &multiTransaction.FromNetworkID,
+ &multiTransaction.FromTxHash,
+ &multiTransaction.FromAddress,
+ &multiTransaction.FromAsset,
+ &fromAmountDB,
+ &multiTransaction.ToNetworkID,
+ &multiTransaction.ToTxHash,
+ &multiTransaction.ToAddress,
+ &multiTransaction.ToAsset,
+ &toAmountDB,
+ &multiTransaction.Type,
+ &multiTransaction.CrossTxID,
+ &multiTransaction.Timestamp,
+ )
+ if err != nil {
+ return nil, err
+ }
+
+ if fromAmountDB.Valid {
+ multiTransaction.FromAmount = new(hexutil.Big)
+ if _, ok := (*big.Int)(multiTransaction.FromAmount).SetString(fromAmountDB.String, 0); !ok {
+ return nil, errors.New("failed to convert fromAmountDB.String to big.Int: " + fromAmountDB.String)
+ }
+ }
+
+ if toAmountDB.Valid {
+ multiTransaction.ToAmount = new(hexutil.Big)
+ if _, ok := (*big.Int)(multiTransaction.ToAmount).SetString(toAmountDB.String, 0); !ok {
+ return nil, errors.New("failed to convert fromAmountDB.String to big.Int: " + toAmountDB.String)
+ }
+ }
+
+ multiTransactions = append(multiTransactions, multiTransaction)
+ }
+
+ return multiTransactions, nil
+}
func insertMultiTransaction(db *sql.DB, multiTransaction *MultiTransaction) (MultiTransactionIDType, error) {
- insert, err := db.Prepare(fmt.Sprintf(`INSERT OR REPLACE INTO multi_transactions (%s)
- VALUES(?, ?, ?, ?, ?, ?, ?, ?)`, multiTransactionColumns))
+ insert, err := db.Prepare(fmt.Sprintf(`INSERT INTO multi_transactions (%s)
+ VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, multiTransactionColumns))
if err != nil {
return 0, err
}
+
+ timestamp := time.Now().Unix()
result, err := insert.Exec(
+ multiTransaction.FromNetworkID,
+ multiTransaction.FromTxHash,
multiTransaction.FromAddress,
multiTransaction.FromAsset,
multiTransaction.FromAmount.String(),
+ multiTransaction.ToNetworkID,
+ multiTransaction.ToTxHash,
multiTransaction.ToAddress,
multiTransaction.ToAsset,
multiTransaction.ToAmount.String(),
multiTransaction.Type,
- time.Now().Unix(),
+ multiTransaction.CrossTxID,
+ timestamp,
)
if err != nil {
return 0, err
}
defer insert.Close()
multiTransactionID, err := result.LastInsertId()
+
+ multiTransaction.Timestamp = uint64(timestamp)
+ multiTransaction.ID = uint(multiTransactionID)
+
return MultiTransactionIDType(multiTransactionID), err
}
@@ -351,6 +416,43 @@ func (tm *TransactionManager) InsertMultiTransaction(multiTransaction *MultiTran
return insertMultiTransaction(tm.db, multiTransaction)
}
+func updateMultiTransaction(db *sql.DB, multiTransaction *MultiTransaction) error {
+ if MultiTransactionIDType(multiTransaction.ID) == NoMultiTransactionID {
+ return fmt.Errorf("no multitransaction ID")
+ }
+
+ update, err := db.Prepare(fmt.Sprintf(`REPLACE INTO multi_transactions (rowid, %s)
+ VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, multiTransactionColumns))
+
+ if err != nil {
+ return err
+ }
+ _, err = update.Exec(
+ multiTransaction.ID,
+ multiTransaction.FromNetworkID,
+ multiTransaction.FromTxHash,
+ multiTransaction.FromAddress,
+ multiTransaction.FromAsset,
+ multiTransaction.FromAmount.String(),
+ multiTransaction.ToNetworkID,
+ multiTransaction.ToTxHash,
+ multiTransaction.ToAddress,
+ multiTransaction.ToAsset,
+ multiTransaction.ToAmount.String(),
+ multiTransaction.Type,
+ multiTransaction.CrossTxID,
+ time.Now().Unix(),
+ )
+ if err != nil {
+ return err
+ }
+ return update.Close()
+}
+
+func (tm *TransactionManager) UpdateMultiTransaction(multiTransaction *MultiTransaction) error {
+ return updateMultiTransaction(tm.db, multiTransaction)
+}
+
func (tm *TransactionManager) CreateMultiTransactionFromCommand(ctx context.Context, command *MultiTransactionCommand, data []*bridge.TransactionBridge, bridges map[string]bridge.Bridge, password string) (*MultiTransactionCommandResult, error) {
multiTransaction := &MultiTransaction{
FromAddress: command.FromAddress,
@@ -427,43 +529,58 @@ func (tm *TransactionManager) GetMultiTransactions(ctx context.Context, ids []Mu
}
defer rows.Close()
- var multiTransactions []*MultiTransaction
- for rows.Next() {
- multiTransaction := &MultiTransaction{}
- var fromAmountDB, toAmountDB sql.NullString
- err := rows.Scan(
- &multiTransaction.ID,
- &multiTransaction.FromAddress,
- &multiTransaction.FromAsset,
- &fromAmountDB,
- &multiTransaction.ToAddress,
- &multiTransaction.ToAsset,
- &toAmountDB,
- &multiTransaction.Type,
- &multiTransaction.Timestamp,
- )
- if err != nil {
- return nil, err
- }
+ return rowsToMultiTransactions(rows)
+}
- if fromAmountDB.Valid {
- multiTransaction.FromAmount = new(hexutil.Big)
- if _, ok := (*big.Int)(multiTransaction.FromAmount).SetString(fromAmountDB.String, 0); !ok {
- return nil, errors.New("failed to convert fromAmountDB.String to big.Int: " + fromAmountDB.String)
- }
- }
+func (tm *TransactionManager) getBridgeMultiTransactions(ctx context.Context, toChainID uint64, crossTxID string) ([]*MultiTransaction, error) {
+ stmt, err := tm.db.Prepare(fmt.Sprintf(`SELECT rowid, %s
+ FROM multi_transactions
+ WHERE type=? AND to_network_id=? AND cross_tx_id=?`,
+ multiTransactionColumns))
+ if err != nil {
+ return nil, err
+ }
+ defer stmt.Close()
- if toAmountDB.Valid {
- multiTransaction.ToAmount = new(hexutil.Big)
- if _, ok := (*big.Int)(multiTransaction.ToAmount).SetString(toAmountDB.String, 0); !ok {
- return nil, errors.New("failed to convert fromAmountDB.String to big.Int: " + toAmountDB.String)
- }
- }
+ rows, err := stmt.Query(MultiTransactionBridge, toChainID, crossTxID)
+ if err != nil {
+ return nil, err
+ }
+ defer rows.Close()
- multiTransactions = append(multiTransactions, multiTransaction)
+ return rowsToMultiTransactions(rows)
+}
+
+func (tm *TransactionManager) GetBridgeOriginMultiTransaction(ctx context.Context, toChainID uint64, crossTxID string) (*MultiTransaction, error) {
+ multiTxs, err := tm.getBridgeMultiTransactions(ctx, toChainID, crossTxID)
+ if err != nil {
+ return nil, err
}
- return multiTransactions, nil
+ for _, multiTx := range multiTxs {
+ // Origin MultiTxs will have a missing "ToTxHash"
+ if multiTx.ToTxHash == emptyHash {
+ return multiTx, nil
+ }
+ }
+
+ return nil, nil
+}
+
+func (tm *TransactionManager) GetBridgeDestinationMultiTransaction(ctx context.Context, toChainID uint64, crossTxID string) (*MultiTransaction, error) {
+ multiTxs, err := tm.getBridgeMultiTransactions(ctx, toChainID, crossTxID)
+ if err != nil {
+ return nil, err
+ }
+
+ for _, multiTx := range multiTxs {
+ // Destination MultiTxs will have a missing "FromTxHash"
+ if multiTx.FromTxHash == emptyHash {
+ return multiTx, nil
+ }
+ }
+
+ return nil, nil
}
func (tm *TransactionManager) getVerifiedWalletAccount(address, password string) (*account.SelectedExtKey, error) {
diff --git a/services/wallet/transfer/transaction_test.go b/services/wallet/transfer/transaction_test.go
index 18fabe213..0b421b4c5 100644
--- a/services/wallet/transfer/transaction_test.go
+++ b/services/wallet/transfer/transaction_test.go
@@ -23,6 +23,22 @@ func setupTestTransactionDB(t *testing.T) (*TransactionManager, func()) {
}
}
+func areMultiTransactionsEqual(mt1, mt2 *MultiTransaction) bool {
+ return mt1.Timestamp == mt2.Timestamp &&
+ mt1.FromNetworkID == mt2.FromNetworkID &&
+ mt1.ToNetworkID == mt2.ToNetworkID &&
+ mt1.FromTxHash == mt2.FromTxHash &&
+ mt1.ToTxHash == mt2.ToTxHash &&
+ mt1.FromAddress == mt2.FromAddress &&
+ mt1.ToAddress == mt2.ToAddress &&
+ mt1.FromAsset == mt2.FromAsset &&
+ mt1.ToAsset == mt2.ToAsset &&
+ mt1.FromAmount.String() == mt2.FromAmount.String() &&
+ mt1.ToAmount.String() == mt2.ToAmount.String() &&
+ mt1.Type == mt2.Type &&
+ mt1.CrossTxID == mt2.CrossTxID
+}
+
func TestPendingTransactions(t *testing.T) {
manager, stop := setupTestTransactionDB(t)
defer stop()
@@ -76,12 +92,16 @@ func TestPendingTransactions(t *testing.T) {
require.Equal(t, 0, len(rst))
}
-func TestMultiTransactions(t *testing.T) {
+func TestBridgeMultiTransactions(t *testing.T) {
manager, stop := setupTestTransactionDB(t)
defer stop()
trx1 := MultiTransaction{
- Timestamp: 123,
+ Timestamp: 123,
+ FromNetworkID: 0,
+ ToNetworkID: 1,
+ FromTxHash: common.Hash{5},
+ // Empty ToTxHash
FromAddress: common.Address{1},
ToAddress: common.Address{2},
FromAsset: "fromAsset",
@@ -89,32 +109,109 @@ func TestMultiTransactions(t *testing.T) {
FromAmount: (*hexutil.Big)(big.NewInt(123)),
ToAmount: (*hexutil.Big)(big.NewInt(234)),
Type: MultiTransactionBridge,
+ CrossTxID: "crossTxD1",
+ }
+
+ trx2 := MultiTransaction{
+ Timestamp: 321,
+ FromNetworkID: 1,
+ ToNetworkID: 0,
+ //Empty FromTxHash
+ ToTxHash: common.Hash{6},
+ FromAddress: common.Address{2},
+ ToAddress: common.Address{1},
+ FromAsset: "fromAsset",
+ ToAsset: "toAsset",
+ FromAmount: (*hexutil.Big)(big.NewInt(123)),
+ ToAmount: (*hexutil.Big)(big.NewInt(234)),
+ Type: MultiTransactionBridge,
+ CrossTxID: "crossTxD2",
+ }
+
+ trxs := []*MultiTransaction{&trx1, &trx2}
+
+ var err error
+ ids := make([]MultiTransactionIDType, len(trxs))
+ for i, trx := range trxs {
+ ids[i], err = insertMultiTransaction(manager.db, trx)
+ require.NoError(t, err)
+ require.Equal(t, MultiTransactionIDType(i+1), ids[i])
+ }
+
+ rst, err := manager.GetBridgeOriginMultiTransaction(context.Background(), trx1.ToNetworkID, trx1.CrossTxID)
+ require.NoError(t, err)
+ require.NotEmpty(t, rst)
+ require.True(t, areMultiTransactionsEqual(&trx1, rst))
+
+ rst, err = manager.GetBridgeDestinationMultiTransaction(context.Background(), trx1.ToNetworkID, trx1.CrossTxID)
+ require.NoError(t, err)
+ require.Empty(t, rst)
+
+ rst, err = manager.GetBridgeOriginMultiTransaction(context.Background(), trx2.ToNetworkID, trx2.CrossTxID)
+ require.NoError(t, err)
+ require.Empty(t, rst)
+
+ rst, err = manager.GetBridgeDestinationMultiTransaction(context.Background(), trx2.ToNetworkID, trx2.CrossTxID)
+ require.NoError(t, err)
+ require.NotEmpty(t, rst)
+ require.True(t, areMultiTransactionsEqual(&trx2, rst))
+}
+
+func TestMultiTransactions(t *testing.T) {
+ manager, stop := setupTestTransactionDB(t)
+ defer stop()
+
+ trx1 := MultiTransaction{
+ Timestamp: 123,
+ FromNetworkID: 0,
+ ToNetworkID: 1,
+ FromTxHash: common.Hash{5},
+ ToTxHash: common.Hash{6},
+ FromAddress: common.Address{1},
+ ToAddress: common.Address{2},
+ FromAsset: "fromAsset",
+ ToAsset: "toAsset",
+ FromAmount: (*hexutil.Big)(big.NewInt(123)),
+ ToAmount: (*hexutil.Big)(big.NewInt(234)),
+ Type: MultiTransactionBridge,
+ CrossTxID: "crossTxD",
}
trx2 := trx1
trx2.FromAmount = (*hexutil.Big)(big.NewInt(456))
trx2.ToAmount = (*hexutil.Big)(big.NewInt(567))
+ trxs := []*MultiTransaction{&trx1, &trx2}
+
var err error
- ids := make([]MultiTransactionIDType, 2)
- ids[0], err = insertMultiTransaction(manager.db, &trx1)
- require.NoError(t, err)
- require.Equal(t, MultiTransactionIDType(1), ids[0])
- ids[1], err = insertMultiTransaction(manager.db, &trx2)
- require.NoError(t, err)
- require.Equal(t, MultiTransactionIDType(2), ids[1])
+ ids := make([]MultiTransactionIDType, len(trxs))
+ for i, trx := range trxs {
+ ids[i], err = insertMultiTransaction(manager.db, trx)
+ require.NoError(t, err)
+ require.Equal(t, MultiTransactionIDType(i+1), ids[i])
+ }
rst, err := manager.GetMultiTransactions(context.Background(), []MultiTransactionIDType{ids[0], 555})
require.NoError(t, err)
require.Equal(t, 1, len(rst))
+ require.True(t, areMultiTransactionsEqual(trxs[0], rst[0]))
+
+ trx1.FromAmount = (*hexutil.Big)(big.NewInt(789))
+ trx1.ToAmount = (*hexutil.Big)(big.NewInt(890))
+ err = updateMultiTransaction(manager.db, &trx1)
+ require.NoError(t, err)
rst, err = manager.GetMultiTransactions(context.Background(), ids)
require.NoError(t, err)
- require.Equal(t, 2, len(rst))
+ require.Equal(t, len(ids), len(rst))
- for _, id := range ids {
+ for i, id := range ids {
found := false
for _, trx := range rst {
- found = found || id == MultiTransactionIDType(trx.ID)
+ if id == MultiTransactionIDType(trx.ID) {
+ found = true
+ require.True(t, areMultiTransactionsEqual(trxs[i], trx))
+ break
+ }
}
require.True(t, found, "result contains transaction with id %d", id)
}
diff --git a/vendor/github.com/ethereum/go-ethereum/core/rawdb/accessors_chain.go b/vendor/github.com/ethereum/go-ethereum/core/rawdb/accessors_chain.go
index 881660aa8..9706f9e76 100644
--- a/vendor/github.com/ethereum/go-ethereum/core/rawdb/accessors_chain.go
+++ b/vendor/github.com/ethereum/go-ethereum/core/rawdb/accessors_chain.go
@@ -636,7 +636,12 @@ func ReadReceipts(db ethdb.Reader, hash common.Hash, number uint64, config *para
log.Error("Missing body but have receipt", "hash", hash, "number", number)
return nil
}
- if err := receipts.DeriveFields(config, hash, number, body.Transactions); err != nil {
+ header := ReadHeader(db, hash, number)
+ if header == nil {
+ log.Error("Missing header but have receipt", "hash", hash, "number", number)
+ return nil
+ }
+ if err := receipts.DeriveFields(config, hash, number, header.Time, header.BaseFee, body.Transactions); err != nil {
log.Error("Failed to derive block receipts fields", "hash", hash, "number", number, "err", err)
return nil
}
@@ -673,6 +678,16 @@ type storedReceiptRLP struct {
PostStateOrStatus []byte
CumulativeGasUsed uint64
Logs []*types.LogForStorage
+ ContractAddress *common.Address `rlp:"optional"` // set on new versions if an Arbitrum tx type
+
+ // Remaining fields are declared to allow the receipt RLP to be parsed without errors.
+ // However, they must not be used as they may not be populated correctly due to multiple receipt formats
+ // being combined into a single list of optional fields which can be mistaken for each other.
+ // DepositNonce (*uint64) from Regolith deposit tx receipts will be parsed into L1GasUsed
+ L1GasUsed *big.Int `rlp:"optional"` // OVM legacy
+ L1GasPrice *big.Int `rlp:"optional"` // OVM legacy
+ L1Fee *big.Int `rlp:"optional"` // OVM legacy
+ FeeScalar string `rlp:"optional"` // OVM legacy
}
// ReceiptLogs is a barebone version of ReceiptForStorage which only keeps
diff --git a/vendor/github.com/ethereum/go-ethereum/core/types/arb_types.go b/vendor/github.com/ethereum/go-ethereum/core/types/arb_types.go
index 84be0cbc5..05eb63ad0 100644
--- a/vendor/github.com/ethereum/go-ethereum/core/types/arb_types.go
+++ b/vendor/github.com/ethereum/go-ethereum/core/types/arb_types.go
@@ -3,7 +3,6 @@ package types
import (
"context"
"encoding/binary"
- "fmt"
"math/big"
"github.com/ethereum/go-ethereum/common/hexutil"
@@ -13,6 +12,12 @@ import (
"github.com/ethereum/go-ethereum/common"
)
+// Returns true if nonce checks should be skipped based on inner's isFake()
+// This also disables requiring that sender is an EOA and not a contract
+func (tx *Transaction) SkipAccountChecks() bool {
+ return tx.inner.isFake()
+}
+
type fallbackError struct {
}
@@ -92,6 +97,7 @@ func (tx *ArbitrumUnsignedTx) value() *big.Int { return tx.Value }
func (tx *ArbitrumUnsignedTx) nonce() uint64 { return tx.Nonce }
func (tx *ArbitrumUnsignedTx) to() *common.Address { return tx.To }
func (tx *ArbitrumUnsignedTx) isFake() bool { return false }
+func (tx *ArbitrumUnsignedTx) isSystemTx() bool { return false }
func (tx *ArbitrumUnsignedTx) rawSignatureValues() (v, r, s *big.Int) {
return bigZero, bigZero, bigZero
@@ -101,6 +107,13 @@ func (tx *ArbitrumUnsignedTx) setSignatureValues(chainID, v, r, s *big.Int) {
}
+func (tx *ArbitrumUnsignedTx) effectiveGasPrice(dst *big.Int, baseFee *big.Int) *big.Int {
+ if baseFee == nil {
+ return dst.Set(tx.GasFeeCap)
+ }
+ return dst.Set(baseFee)
+}
+
type ArbitrumContractTx struct {
ChainId *big.Int
RequestId common.Hash
@@ -157,6 +170,14 @@ func (tx *ArbitrumContractTx) rawSignatureValues() (v, r, s *big.Int) {
}
func (tx *ArbitrumContractTx) setSignatureValues(chainID, v, r, s *big.Int) {}
func (tx *ArbitrumContractTx) isFake() bool { return true }
+func (tx *ArbitrumContractTx) isSystemTx() bool { return false }
+
+func (tx *ArbitrumContractTx) effectiveGasPrice(dst *big.Int, baseFee *big.Int) *big.Int {
+ if baseFee == nil {
+ return dst.Set(tx.GasFeeCap)
+ }
+ return dst.Set(baseFee)
+}
type ArbitrumRetryTx struct {
ChainId *big.Int
@@ -228,6 +249,14 @@ func (tx *ArbitrumRetryTx) rawSignatureValues() (v, r, s *big.Int) {
}
func (tx *ArbitrumRetryTx) setSignatureValues(chainID, v, r, s *big.Int) {}
func (tx *ArbitrumRetryTx) isFake() bool { return true }
+func (tx *ArbitrumRetryTx) isSystemTx() bool { return false }
+
+func (tx *ArbitrumRetryTx) effectiveGasPrice(dst *big.Int, baseFee *big.Int) *big.Int {
+ if baseFee == nil {
+ return dst.Set(tx.GasFeeCap)
+ }
+ return dst.Set(baseFee)
+}
type ArbitrumSubmitRetryableTx struct {
ChainId *big.Int
@@ -303,6 +332,14 @@ func (tx *ArbitrumSubmitRetryableTx) rawSignatureValues() (v, r, s *big.Int) {
}
func (tx *ArbitrumSubmitRetryableTx) setSignatureValues(chainID, v, r, s *big.Int) {}
func (tx *ArbitrumSubmitRetryableTx) isFake() bool { return true }
+func (tx *ArbitrumSubmitRetryableTx) isSystemTx() bool { return false }
+
+func (tx *ArbitrumSubmitRetryableTx) effectiveGasPrice(dst *big.Int, baseFee *big.Int) *big.Int {
+ if baseFee == nil {
+ return dst.Set(tx.GasFeeCap)
+ }
+ return dst.Set(baseFee)
+}
func (tx *ArbitrumSubmitRetryableTx) data() []byte {
var retryTo common.Address
@@ -375,6 +412,7 @@ func (d *ArbitrumDepositTx) value() *big.Int { return d.Value }
func (d *ArbitrumDepositTx) nonce() uint64 { return 0 }
func (d *ArbitrumDepositTx) to() *common.Address { return &d.To }
func (d *ArbitrumDepositTx) isFake() bool { return true }
+func (d *ArbitrumDepositTx) isSystemTx() bool { return false }
func (d *ArbitrumDepositTx) rawSignatureValues() (v, r, s *big.Int) {
return bigZero, bigZero, bigZero
@@ -384,6 +422,10 @@ func (d *ArbitrumDepositTx) setSignatureValues(chainID, v, r, s *big.Int) {
}
+func (tx *ArbitrumDepositTx) effectiveGasPrice(dst *big.Int, baseFee *big.Int) *big.Int {
+ return dst.Set(bigZero)
+}
+
type ArbitrumInternalTx struct {
ChainId *big.Int
Data []byte
@@ -411,6 +453,7 @@ func (t *ArbitrumInternalTx) value() *big.Int { return common.Big0 }
func (t *ArbitrumInternalTx) nonce() uint64 { return 0 }
func (t *ArbitrumInternalTx) to() *common.Address { return &ArbosAddress }
func (t *ArbitrumInternalTx) isFake() bool { return true }
+func (t *ArbitrumInternalTx) isSystemTx() bool { return false }
func (d *ArbitrumInternalTx) rawSignatureValues() (v, r, s *big.Int) {
return bigZero, bigZero, bigZero
@@ -420,6 +463,10 @@ func (d *ArbitrumInternalTx) setSignatureValues(chainID, v, r, s *big.Int) {
}
+func (tx *ArbitrumInternalTx) effectiveGasPrice(dst *big.Int, baseFee *big.Int) *big.Int {
+ return dst.Set(bigZero)
+}
+
type HeaderInfo struct {
SendRoot common.Hash
SendCount uint64
@@ -444,19 +491,16 @@ func (info HeaderInfo) UpdateHeaderWithInfo(header *Header) {
header.Extra = info.extra()
}
-func DeserializeHeaderExtraInformation(header *Header) (HeaderInfo, error) {
- if header.BaseFee == nil || header.BaseFee.Sign() == 0 || len(header.Extra) == 0 {
+func DeserializeHeaderExtraInformation(header *Header) HeaderInfo {
+ if header.BaseFee == nil || header.BaseFee.Sign() == 0 || len(header.Extra) != 32 || header.Difficulty.Cmp(common.Big1) != 0 {
// imported blocks have no base fee
// The genesis block doesn't have an ArbOS encoded extra field
- return HeaderInfo{}, nil
- }
- if len(header.Extra) != 32 {
- return HeaderInfo{}, fmt.Errorf("unexpected header extra field length %v", len(header.Extra))
+ return HeaderInfo{}
}
extra := HeaderInfo{}
copy(extra.SendRoot[:], header.Extra)
extra.SendCount = binary.BigEndian.Uint64(header.MixDigest[:8])
extra.L1BlockNumber = binary.BigEndian.Uint64(header.MixDigest[8:16])
extra.ArbOSFormatVersion = binary.BigEndian.Uint64(header.MixDigest[16:24])
- return extra, nil
+ return extra
}
diff --git a/vendor/github.com/ethereum/go-ethereum/core/types/block.go b/vendor/github.com/ethereum/go-ethereum/core/types/block.go
index 8942082b6..3f741347e 100644
--- a/vendor/github.com/ethereum/go-ethereum/core/types/block.go
+++ b/vendor/github.com/ethereum/go-ethereum/core/types/block.go
@@ -31,11 +31,6 @@ import (
"github.com/ethereum/go-ethereum/rlp"
)
-var (
- EmptyRootHash = common.HexToHash("56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421")
- EmptyUncleHash = rlpHash([]*Header(nil))
-)
-
// A BlockNonce is a 64-bit hash which proves (combined with the
// mix-hash) that a sufficient amount of computation has been carried
// out on a block.
@@ -87,6 +82,12 @@ type Header struct {
// BaseFee was added by EIP-1559 and is ignored in legacy headers.
BaseFee *big.Int `json:"baseFeePerGas" rlp:"optional"`
+ // WithdrawalsHash was added by EIP-4895 and is ignored in legacy headers.
+ WithdrawalsHash *common.Hash `json:"withdrawalsRoot" rlp:"optional"`
+
+ // ExcessDataGas was added by EIP-4844 and is ignored in legacy headers.
+ ExcessDataGas *big.Int `json:"excessDataGas" rlp:"optional"`
+
/*
TODO (MariusVanDerWijden) Add this field once needed
// Random was added during the merge and contains the BeaconState randomness
@@ -149,14 +150,17 @@ func (h *Header) SanityCheck() error {
}
// EmptyBody returns true if there is no additional 'body' to complete the header
-// that is: no transactions and no uncles.
+// that is: no transactions, no uncles and no withdrawals.
func (h *Header) EmptyBody() bool {
- return h.TxHash == EmptyRootHash && h.UncleHash == EmptyUncleHash
+ if h.WithdrawalsHash == nil {
+ return h.TxHash == EmptyTxsHash && h.UncleHash == EmptyUncleHash
+ }
+ return h.TxHash == EmptyTxsHash && h.UncleHash == EmptyUncleHash && *h.WithdrawalsHash == EmptyWithdrawalsHash
}
// EmptyReceipts returns true if there are no receipts for this header/block.
func (h *Header) EmptyReceipts() bool {
- return h.ReceiptHash == EmptyRootHash
+ return h.ReceiptHash == EmptyReceiptsHash
}
// Body is a simple (mutable, non-safe) data container for storing and moving
@@ -164,6 +168,7 @@ func (h *Header) EmptyReceipts() bool {
type Body struct {
Transactions []*Transaction
Uncles []*Header
+ Withdrawals []*Withdrawal `rlp:"optional"`
}
// Block represents an entire block in the Ethereum blockchain.
@@ -171,6 +176,7 @@ type Block struct {
header *Header
uncles []*Header
transactions Transactions
+ withdrawals Withdrawals
// caches
hash atomic.Value
@@ -184,9 +190,10 @@ type Block struct {
// "external" block encoding. used for eth protocol, etc.
type extblock struct {
- Header *Header
- Txs []*Transaction
- Uncles []*Header
+ Header *Header
+ Txs []*Transaction
+ Uncles []*Header
+ Withdrawals []*Withdrawal `rlp:"optional"`
}
// NewBlock creates a new block. The input data is copied,
@@ -201,7 +208,7 @@ func NewBlock(header *Header, txs []*Transaction, uncles []*Header, receipts []*
// TODO: panic if len(txs) != len(receipts)
if len(txs) == 0 {
- b.header.TxHash = EmptyRootHash
+ b.header.TxHash = EmptyTxsHash
} else {
b.header.TxHash = DeriveSha(Transactions(txs), hasher)
b.transactions = make(Transactions, len(txs))
@@ -209,7 +216,7 @@ func NewBlock(header *Header, txs []*Transaction, uncles []*Header, receipts []*
}
if len(receipts) == 0 {
- b.header.ReceiptHash = EmptyRootHash
+ b.header.ReceiptHash = EmptyReceiptsHash
} else {
b.header.ReceiptHash = DeriveSha(Receipts(receipts), hasher)
b.header.Bloom = CreateBloom(receipts)
@@ -228,6 +235,28 @@ func NewBlock(header *Header, txs []*Transaction, uncles []*Header, receipts []*
return b
}
+// NewBlockWithWithdrawals creates a new block with withdrawals. The input data
+// is copied, changes to header and to the field values will not
+// affect the block.
+//
+// The values of TxHash, UncleHash, ReceiptHash and Bloom in header
+// are ignored and set to values derived from the given txs, uncles
+// and receipts.
+func NewBlockWithWithdrawals(header *Header, txs []*Transaction, uncles []*Header, receipts []*Receipt, withdrawals []*Withdrawal, hasher TrieHasher) *Block {
+ b := NewBlock(header, txs, uncles, receipts, hasher)
+
+ if withdrawals == nil {
+ b.header.WithdrawalsHash = nil
+ } else if len(withdrawals) == 0 {
+ b.header.WithdrawalsHash = &EmptyWithdrawalsHash
+ } else {
+ h := DeriveSha(Withdrawals(withdrawals), hasher)
+ b.header.WithdrawalsHash = &h
+ }
+
+ return b.WithWithdrawals(withdrawals)
+}
+
// NewBlockWithHeader creates a block with the given header data. The
// header data is copied, changes to header and to the field values
// will not affect the block.
@@ -252,6 +281,10 @@ func CopyHeader(h *Header) *Header {
cpy.Extra = make([]byte, len(h.Extra))
copy(cpy.Extra, h.Extra)
}
+ if h.WithdrawalsHash != nil {
+ cpy.WithdrawalsHash = new(common.Hash)
+ *cpy.WithdrawalsHash = *h.WithdrawalsHash
+ }
return &cpy
}
@@ -262,17 +295,18 @@ func (b *Block) DecodeRLP(s *rlp.Stream) error {
if err := s.Decode(&eb); err != nil {
return err
}
- b.header, b.uncles, b.transactions = eb.Header, eb.Uncles, eb.Txs
- b.size.Store(common.StorageSize(rlp.ListSize(size)))
+ b.header, b.uncles, b.transactions, b.withdrawals = eb.Header, eb.Uncles, eb.Txs, eb.Withdrawals
+ b.size.Store(rlp.ListSize(size))
return nil
}
// EncodeRLP serializes b into the Ethereum RLP block format.
func (b *Block) EncodeRLP(w io.Writer) error {
return rlp.Encode(w, extblock{
- Header: b.header,
- Txs: b.transactions,
- Uncles: b.uncles,
+ Header: b.header,
+ Txs: b.transactions,
+ Uncles: b.uncles,
+ Withdrawals: b.withdrawals,
})
}
@@ -315,10 +349,14 @@ func (b *Block) BaseFee() *big.Int {
return new(big.Int).Set(b.header.BaseFee)
}
+func (b *Block) Withdrawals() Withdrawals {
+ return b.withdrawals
+}
+
func (b *Block) Header() *Header { return CopyHeader(b.header) }
// Body returns the non-header content of the block.
-func (b *Block) Body() *Body { return &Body{b.transactions, b.uncles} }
+func (b *Block) Body() *Body { return &Body{b.transactions, b.uncles, b.withdrawals} }
// Size returns the true RLP encoded storage size of the block, either by encoding
// and returning it, or returning a previously cached value.
@@ -338,7 +376,7 @@ func (b *Block) SanityCheck() error {
return b.header.SanityCheck()
}
-type writeCounter common.StorageSize
+type writeCounter uint64
func (c *writeCounter) Write(b []byte) (int, error) {
*c += writeCounter(len(b))
@@ -361,6 +399,7 @@ func (b *Block) WithSeal(header *Header) *Block {
header: &cpy,
transactions: b.transactions,
uncles: b.uncles,
+ withdrawals: b.withdrawals,
}
}
@@ -378,6 +417,15 @@ func (b *Block) WithBody(transactions []*Transaction, uncles []*Header) *Block {
return block
}
+// WithWithdrawals sets the withdrawal contents of a block, does not return a new block.
+func (b *Block) WithWithdrawals(withdrawals []*Withdrawal) *Block {
+ if withdrawals != nil {
+ b.withdrawals = make([]*Withdrawal, len(withdrawals))
+ copy(b.withdrawals, withdrawals)
+ }
+ return b
+}
+
// Hash returns the keccak256 hash of b's header.
// The hash is computed on the first call and cached thereafter.
func (b *Block) Hash() common.Hash {
diff --git a/vendor/github.com/ethereum/go-ethereum/core/types/gen_header_json.go b/vendor/github.com/ethereum/go-ethereum/core/types/gen_header_json.go
index 74746d033..5c8b81652 100644
--- a/vendor/github.com/ethereum/go-ethereum/core/types/gen_header_json.go
+++ b/vendor/github.com/ethereum/go-ethereum/core/types/gen_header_json.go
@@ -16,23 +16,24 @@ var _ = (*headerMarshaling)(nil)
// MarshalJSON marshals as JSON.
func (h Header) MarshalJSON() ([]byte, error) {
type Header struct {
- ParentHash common.Hash `json:"parentHash" gencodec:"required"`
- UncleHash common.Hash `json:"sha3Uncles" gencodec:"required"`
- Coinbase common.Address `json:"miner"`
- Root common.Hash `json:"stateRoot" gencodec:"required"`
- TxHash common.Hash `json:"transactionsRoot" gencodec:"required"`
- ReceiptHash common.Hash `json:"receiptsRoot" gencodec:"required"`
- Bloom Bloom `json:"logsBloom" gencodec:"required"`
- Difficulty *hexutil.Big `json:"difficulty" gencodec:"required"`
- Number *hexutil.Big `json:"number" gencodec:"required"`
- GasLimit hexutil.Uint64 `json:"gasLimit" gencodec:"required"`
- GasUsed hexutil.Uint64 `json:"gasUsed" gencodec:"required"`
- Time hexutil.Uint64 `json:"timestamp" gencodec:"required"`
- Extra hexutil.Bytes `json:"extraData" gencodec:"required"`
- MixDigest common.Hash `json:"mixHash"`
- Nonce BlockNonce `json:"nonce"`
- BaseFee *hexutil.Big `json:"baseFeePerGas" rlp:"optional"`
- Hash common.Hash `json:"hash"`
+ ParentHash common.Hash `json:"parentHash" gencodec:"required"`
+ UncleHash common.Hash `json:"sha3Uncles" gencodec:"required"`
+ Coinbase common.Address `json:"miner"`
+ Root common.Hash `json:"stateRoot" gencodec:"required"`
+ TxHash common.Hash `json:"transactionsRoot" gencodec:"required"`
+ ReceiptHash common.Hash `json:"receiptsRoot" gencodec:"required"`
+ Bloom Bloom `json:"logsBloom" gencodec:"required"`
+ Difficulty *hexutil.Big `json:"difficulty" gencodec:"required"`
+ Number *hexutil.Big `json:"number" gencodec:"required"`
+ GasLimit hexutil.Uint64 `json:"gasLimit" gencodec:"required"`
+ GasUsed hexutil.Uint64 `json:"gasUsed" gencodec:"required"`
+ Time hexutil.Uint64 `json:"timestamp" gencodec:"required"`
+ Extra hexutil.Bytes `json:"extraData" gencodec:"required"`
+ MixDigest common.Hash `json:"mixHash"`
+ Nonce BlockNonce `json:"nonce"`
+ BaseFee *hexutil.Big `json:"baseFeePerGas" rlp:"optional"`
+ WithdrawalsHash *common.Hash `json:"withdrawalsRoot" rlp:"optional"`
+ Hash common.Hash `json:"hash"`
}
var enc Header
enc.ParentHash = h.ParentHash
@@ -51,6 +52,7 @@ func (h Header) MarshalJSON() ([]byte, error) {
enc.MixDigest = h.MixDigest
enc.Nonce = h.Nonce
enc.BaseFee = (*hexutil.Big)(h.BaseFee)
+ enc.WithdrawalsHash = h.WithdrawalsHash
enc.Hash = h.Hash()
return json.Marshal(&enc)
}
@@ -58,22 +60,23 @@ func (h Header) MarshalJSON() ([]byte, error) {
// UnmarshalJSON unmarshals from JSON.
func (h *Header) UnmarshalJSON(input []byte) error {
type Header struct {
- ParentHash *common.Hash `json:"parentHash" gencodec:"required"`
- UncleHash *common.Hash `json:"sha3Uncles" gencodec:"required"`
- Coinbase *common.Address `json:"miner"`
- Root *common.Hash `json:"stateRoot" gencodec:"required"`
- TxHash *common.Hash `json:"transactionsRoot" gencodec:"required"`
- ReceiptHash *common.Hash `json:"receiptsRoot" gencodec:"required"`
- Bloom *Bloom `json:"logsBloom" gencodec:"required"`
- Difficulty *hexutil.Big `json:"difficulty" gencodec:"required"`
- Number *hexutil.Big `json:"number" gencodec:"required"`
- GasLimit *hexutil.Uint64 `json:"gasLimit" gencodec:"required"`
- GasUsed *hexutil.Uint64 `json:"gasUsed" gencodec:"required"`
- Time *hexutil.Uint64 `json:"timestamp" gencodec:"required"`
- Extra *hexutil.Bytes `json:"extraData" gencodec:"required"`
- MixDigest *common.Hash `json:"mixHash"`
- Nonce *BlockNonce `json:"nonce"`
- BaseFee *hexutil.Big `json:"baseFeePerGas" rlp:"optional"`
+ ParentHash *common.Hash `json:"parentHash" gencodec:"required"`
+ UncleHash *common.Hash `json:"sha3Uncles" gencodec:"required"`
+ Coinbase *common.Address `json:"miner"`
+ Root *common.Hash `json:"stateRoot" gencodec:"required"`
+ TxHash *common.Hash `json:"transactionsRoot" gencodec:"required"`
+ ReceiptHash *common.Hash `json:"receiptsRoot" gencodec:"required"`
+ Bloom *Bloom `json:"logsBloom" gencodec:"required"`
+ Difficulty *hexutil.Big `json:"difficulty" gencodec:"required"`
+ Number *hexutil.Big `json:"number" gencodec:"required"`
+ GasLimit *hexutil.Uint64 `json:"gasLimit" gencodec:"required"`
+ GasUsed *hexutil.Uint64 `json:"gasUsed" gencodec:"required"`
+ Time *hexutil.Uint64 `json:"timestamp" gencodec:"required"`
+ Extra *hexutil.Bytes `json:"extraData" gencodec:"required"`
+ MixDigest *common.Hash `json:"mixHash"`
+ Nonce *BlockNonce `json:"nonce"`
+ BaseFee *hexutil.Big `json:"baseFeePerGas" rlp:"optional"`
+ WithdrawalsHash *common.Hash `json:"withdrawalsRoot" rlp:"optional"`
}
var dec Header
if err := json.Unmarshal(input, &dec); err != nil {
@@ -139,5 +142,8 @@ func (h *Header) UnmarshalJSON(input []byte) error {
if dec.BaseFee != nil {
h.BaseFee = (*big.Int)(dec.BaseFee)
}
+ if dec.WithdrawalsHash != nil {
+ h.WithdrawalsHash = dec.WithdrawalsHash
+ }
return nil
}
diff --git a/vendor/github.com/ethereum/go-ethereum/core/types/gen_header_rlp.go b/vendor/github.com/ethereum/go-ethereum/core/types/gen_header_rlp.go
index e1a687331..7fd2cf8f2 100644
--- a/vendor/github.com/ethereum/go-ethereum/core/types/gen_header_rlp.go
+++ b/vendor/github.com/ethereum/go-ethereum/core/types/gen_header_rlp.go
@@ -41,7 +41,8 @@ func (obj *Header) EncodeRLP(_w io.Writer) error {
w.WriteBytes(obj.MixDigest[:])
w.WriteBytes(obj.Nonce[:])
_tmp1 := obj.BaseFee != nil
- if _tmp1 {
+ _tmp2 := obj.WithdrawalsHash != nil
+ if _tmp1 || _tmp2 {
if obj.BaseFee == nil {
w.Write(rlp.EmptyString)
} else {
@@ -51,6 +52,13 @@ func (obj *Header) EncodeRLP(_w io.Writer) error {
w.WriteBigInt(obj.BaseFee)
}
}
+ if _tmp2 {
+ if obj.WithdrawalsHash == nil {
+ w.Write([]byte{0x80})
+ } else {
+ w.WriteBytes(obj.WithdrawalsHash[:])
+ }
+ }
w.ListEnd(_tmp0)
return w.Flush()
}
diff --git a/vendor/github.com/ethereum/go-ethereum/core/types/gen_receipt_json.go b/vendor/github.com/ethereum/go-ethereum/core/types/gen_receipt_json.go
index bb892f85b..a3dc1aea2 100644
--- a/vendor/github.com/ethereum/go-ethereum/core/types/gen_receipt_json.go
+++ b/vendor/github.com/ethereum/go-ethereum/core/types/gen_receipt_json.go
@@ -16,6 +16,7 @@ var _ = (*receiptMarshaling)(nil)
// MarshalJSON marshals as JSON.
func (r Receipt) MarshalJSON() ([]byte, error) {
type Receipt struct {
+ GasUsedForL1 hexutil.Uint64 `json:"gasUsedForL1,omitempty"`
Type hexutil.Uint64 `json:"type,omitempty"`
PostState hexutil.Bytes `json:"root"`
Status hexutil.Uint64 `json:"status"`
@@ -25,11 +26,17 @@ func (r Receipt) MarshalJSON() ([]byte, error) {
TxHash common.Hash `json:"transactionHash" gencodec:"required"`
ContractAddress common.Address `json:"contractAddress"`
GasUsed hexutil.Uint64 `json:"gasUsed" gencodec:"required"`
+ EffectiveGasPrice *hexutil.Big `json:"effectiveGasPrice,omitempty"`
BlockHash common.Hash `json:"blockHash,omitempty"`
BlockNumber *hexutil.Big `json:"blockNumber,omitempty"`
TransactionIndex hexutil.Uint `json:"transactionIndex"`
+ L1GasPrice *hexutil.Big `json:"l1GasPrice,omitempty"`
+ L1GasUsed *hexutil.Big `json:"l1GasUsed,omitempty"`
+ L1Fee *hexutil.Big `json:"l1Fee,omitempty"`
+ FeeScalar *big.Float `json:"l1FeeScalar,omitempty"`
}
var enc Receipt
+ enc.GasUsedForL1 = hexutil.Uint64(r.GasUsedForL1)
enc.Type = hexutil.Uint64(r.Type)
enc.PostState = r.PostState
enc.Status = hexutil.Uint64(r.Status)
@@ -39,15 +46,21 @@ func (r Receipt) MarshalJSON() ([]byte, error) {
enc.TxHash = r.TxHash
enc.ContractAddress = r.ContractAddress
enc.GasUsed = hexutil.Uint64(r.GasUsed)
+ enc.EffectiveGasPrice = (*hexutil.Big)(r.EffectiveGasPrice)
enc.BlockHash = r.BlockHash
enc.BlockNumber = (*hexutil.Big)(r.BlockNumber)
enc.TransactionIndex = hexutil.Uint(r.TransactionIndex)
+ enc.L1GasPrice = (*hexutil.Big)(r.L1GasPrice)
+ enc.L1GasUsed = (*hexutil.Big)(r.L1GasUsed)
+ enc.L1Fee = (*hexutil.Big)(r.L1Fee)
+ enc.FeeScalar = r.FeeScalar
return json.Marshal(&enc)
}
// UnmarshalJSON unmarshals from JSON.
func (r *Receipt) UnmarshalJSON(input []byte) error {
type Receipt struct {
+ GasUsedForL1 *hexutil.Uint64 `json:"gasUsedForL1,omitempty"`
Type *hexutil.Uint64 `json:"type,omitempty"`
PostState *hexutil.Bytes `json:"root"`
Status *hexutil.Uint64 `json:"status"`
@@ -57,14 +70,23 @@ func (r *Receipt) UnmarshalJSON(input []byte) error {
TxHash *common.Hash `json:"transactionHash" gencodec:"required"`
ContractAddress *common.Address `json:"contractAddress"`
GasUsed *hexutil.Uint64 `json:"gasUsed" gencodec:"required"`
+ EffectiveGasPrice *hexutil.Big `json:"effectiveGasPrice,omitempty"`
BlockHash *common.Hash `json:"blockHash,omitempty"`
BlockNumber *hexutil.Big `json:"blockNumber,omitempty"`
TransactionIndex *hexutil.Uint `json:"transactionIndex"`
+ L1GasPrice *hexutil.Big `json:"l1GasPrice,omitempty"`
+ L1GasUsed *hexutil.Big `json:"l1GasUsed,omitempty"`
+ L1Fee *hexutil.Big `json:"l1Fee,omitempty"`
+ FeeScalar *big.Float `json:"l1FeeScalar,omitempty"`
+ DepositNonce *hexutil.Uint64 `json:"depositNonce,omitempty"`
}
var dec Receipt
if err := json.Unmarshal(input, &dec); err != nil {
return err
}
+ if dec.GasUsedForL1 != nil {
+ r.GasUsedForL1 = uint64(*dec.GasUsedForL1)
+ }
if dec.Type != nil {
r.Type = uint8(*dec.Type)
}
@@ -97,6 +119,9 @@ func (r *Receipt) UnmarshalJSON(input []byte) error {
return errors.New("missing required field 'gasUsed' for Receipt")
}
r.GasUsed = uint64(*dec.GasUsed)
+ if dec.EffectiveGasPrice != nil {
+ r.EffectiveGasPrice = (*big.Int)(dec.EffectiveGasPrice)
+ }
if dec.BlockHash != nil {
r.BlockHash = *dec.BlockHash
}
@@ -106,5 +131,20 @@ func (r *Receipt) UnmarshalJSON(input []byte) error {
if dec.TransactionIndex != nil {
r.TransactionIndex = uint(*dec.TransactionIndex)
}
+ if dec.L1GasPrice != nil {
+ r.L1GasPrice = (*big.Int)(dec.L1GasPrice)
+ }
+ if dec.L1GasUsed != nil {
+ r.L1GasUsed = (*big.Int)(dec.L1GasUsed)
+ }
+ if dec.L1Fee != nil {
+ r.L1Fee = (*big.Int)(dec.L1Fee)
+ }
+ if dec.FeeScalar != nil {
+ r.FeeScalar = dec.FeeScalar
+ }
+ if dec.DepositNonce != nil {
+ r.DepositNonce = (*uint64)(dec.DepositNonce)
+ }
return nil
}
diff --git a/vendor/github.com/ethereum/go-ethereum/core/types/gen_withdrawal_json.go b/vendor/github.com/ethereum/go-ethereum/core/types/gen_withdrawal_json.go
new file mode 100644
index 000000000..983a7f7a1
--- /dev/null
+++ b/vendor/github.com/ethereum/go-ethereum/core/types/gen_withdrawal_json.go
@@ -0,0 +1,55 @@
+// Code generated by github.com/fjl/gencodec. DO NOT EDIT.
+
+package types
+
+import (
+ "encoding/json"
+
+ "github.com/ethereum/go-ethereum/common"
+ "github.com/ethereum/go-ethereum/common/hexutil"
+)
+
+var _ = (*withdrawalMarshaling)(nil)
+
+// MarshalJSON marshals as JSON.
+func (w Withdrawal) MarshalJSON() ([]byte, error) {
+ type Withdrawal struct {
+ Index hexutil.Uint64 `json:"index"`
+ Validator hexutil.Uint64 `json:"validatorIndex"`
+ Address common.Address `json:"address"`
+ Amount hexutil.Uint64 `json:"amount"`
+ }
+ var enc Withdrawal
+ enc.Index = hexutil.Uint64(w.Index)
+ enc.Validator = hexutil.Uint64(w.Validator)
+ enc.Address = w.Address
+ enc.Amount = hexutil.Uint64(w.Amount)
+ return json.Marshal(&enc)
+}
+
+// UnmarshalJSON unmarshals from JSON.
+func (w *Withdrawal) UnmarshalJSON(input []byte) error {
+ type Withdrawal struct {
+ Index *hexutil.Uint64 `json:"index"`
+ Validator *hexutil.Uint64 `json:"validatorIndex"`
+ Address *common.Address `json:"address"`
+ Amount *hexutil.Uint64 `json:"amount"`
+ }
+ var dec Withdrawal
+ if err := json.Unmarshal(input, &dec); err != nil {
+ return err
+ }
+ if dec.Index != nil {
+ w.Index = uint64(*dec.Index)
+ }
+ if dec.Validator != nil {
+ w.Validator = uint64(*dec.Validator)
+ }
+ if dec.Address != nil {
+ w.Address = *dec.Address
+ }
+ if dec.Amount != nil {
+ w.Amount = uint64(*dec.Amount)
+ }
+ return nil
+}
diff --git a/vendor/github.com/ethereum/go-ethereum/core/types/gen_withdrawal_rlp.go b/vendor/github.com/ethereum/go-ethereum/core/types/gen_withdrawal_rlp.go
new file mode 100644
index 000000000..d0b4e0147
--- /dev/null
+++ b/vendor/github.com/ethereum/go-ethereum/core/types/gen_withdrawal_rlp.go
@@ -0,0 +1,20 @@
+// Code generated by rlpgen. DO NOT EDIT.
+
+//go:build !norlpgen
+// +build !norlpgen
+
+package types
+
+import "github.com/ethereum/go-ethereum/rlp"
+import "io"
+
+func (obj *Withdrawal) EncodeRLP(_w io.Writer) error {
+ w := rlp.NewEncoderBuffer(_w)
+ _tmp0 := w.List()
+ w.WriteUint64(obj.Index)
+ w.WriteUint64(obj.Validator)
+ w.WriteBytes(obj.Address[:])
+ w.WriteUint64(obj.Amount)
+ w.ListEnd(_tmp0)
+ return w.Flush()
+}
diff --git a/vendor/github.com/ethereum/go-ethereum/core/types/hashes.go b/vendor/github.com/ethereum/go-ethereum/core/types/hashes.go
new file mode 100644
index 000000000..3bad430be
--- /dev/null
+++ b/vendor/github.com/ethereum/go-ethereum/core/types/hashes.go
@@ -0,0 +1,42 @@
+// Copyright 2023 The go-ethereum Authors
+// This file is part of the go-ethereum library.
+//
+// The go-ethereum library is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Lesser General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// The go-ethereum library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public License
+// along with the go-ethereum library. If not, see .
+
+package types
+
+import (
+ "github.com/ethereum/go-ethereum/common"
+ "github.com/ethereum/go-ethereum/crypto"
+)
+
+var (
+ // EmptyRootHash is the known root hash of an empty trie.
+ EmptyRootHash = common.HexToHash("56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421")
+
+ // EmptyUncleHash is the known hash of the empty uncle set.
+ EmptyUncleHash = rlpHash([]*Header(nil)) // 1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347
+
+ // EmptyCodeHash is the known hash of the empty EVM bytecode.
+ EmptyCodeHash = crypto.Keccak256Hash(nil) // c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470
+
+ // EmptyTxsHash is the known hash of the empty transaction set.
+ EmptyTxsHash = common.HexToHash("56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421")
+
+ // EmptyReceiptsHash is the known hash of the empty receipt set.
+ EmptyReceiptsHash = common.HexToHash("56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421")
+
+ // EmptyWithdrawalsHash is the known hash of the empty withdrawal set.
+ EmptyWithdrawalsHash = common.HexToHash("56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421")
+)
diff --git a/vendor/github.com/ethereum/go-ethereum/core/types/legacy.go b/vendor/github.com/ethereum/go-ethereum/core/types/legacy.go
deleted file mode 100644
index 14ed30d88..000000000
--- a/vendor/github.com/ethereum/go-ethereum/core/types/legacy.go
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright 2022 The go-ethereum Authors
-// This file is part of the go-ethereum library.
-//
-// The go-ethereum library is free software: you can redistribute it and/or modify
-// it under the terms of the GNU Lesser General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// The go-ethereum library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public License
-// along with the go-ethereum library. If not, see .
-
-package types
-
-import (
- "errors"
-
- "github.com/ethereum/go-ethereum/rlp"
-)
-
-// IsLegacyStoredReceipts tries to parse the RLP-encoded blob
-// first as an array of v3 stored receipt, then v4 stored receipt and
-// returns true if successful.
-func IsLegacyStoredReceipts(raw []byte) (bool, error) {
- var v3 []v3StoredReceiptRLP
- if err := rlp.DecodeBytes(raw, &v3); err == nil {
- return true, nil
- }
- var v4 []v4StoredReceiptRLP
- if err := rlp.DecodeBytes(raw, &v4); err == nil {
- return true, nil
- }
- var v5 []storedReceiptRLP
- // Check to see valid fresh stored receipt
- if err := rlp.DecodeBytes(raw, &v5); err == nil {
- return false, nil
- }
- return false, errors.New("value is not a valid receipt encoding")
-}
-
-// ConvertLegacyStoredReceipts takes the RLP encoding of an array of legacy
-// stored receipts and returns a fresh RLP-encoded stored receipt.
-func ConvertLegacyStoredReceipts(raw []byte) ([]byte, error) {
- var receipts []ReceiptForStorage
- if err := rlp.DecodeBytes(raw, &receipts); err != nil {
- return nil, err
- }
- return rlp.EncodeToBytes(&receipts)
-}
diff --git a/vendor/github.com/ethereum/go-ethereum/core/types/log.go b/vendor/github.com/ethereum/go-ethereum/core/types/log.go
index eb30957b1..e48919136 100644
--- a/vendor/github.com/ethereum/go-ethereum/core/types/log.go
+++ b/vendor/github.com/ethereum/go-ethereum/core/types/log.go
@@ -64,24 +64,13 @@ type logMarshaling struct {
//go:generate go run ../../rlp/rlpgen -type rlpLog -out gen_log_rlp.go
+// rlpLog is used to RLP-encode both the consensus and storage formats.
type rlpLog struct {
Address common.Address
Topics []common.Hash
Data []byte
}
-// legacyRlpStorageLog is the previous storage encoding of a log including some redundant fields.
-type legacyRlpStorageLog struct {
- Address common.Address
- Topics []common.Hash
- Data []byte
- BlockNumber uint64
- TxHash common.Hash
- TxIndex uint
- BlockHash common.Hash
- Index uint
-}
-
// EncodeRLP implements rlp.Encoder.
func (l *Log) EncodeRLP(w io.Writer) error {
rl := rlpLog{Address: l.Address, Topics: l.Topics, Data: l.Data}
@@ -97,44 +86,3 @@ func (l *Log) DecodeRLP(s *rlp.Stream) error {
}
return err
}
-
-// LogForStorage is a wrapper around a Log that handles
-// backward compatibility with prior storage formats.
-type LogForStorage Log
-
-// EncodeRLP implements rlp.Encoder.
-func (l *LogForStorage) EncodeRLP(w io.Writer) error {
- rl := rlpLog{Address: l.Address, Topics: l.Topics, Data: l.Data}
- return rlp.Encode(w, &rl)
-}
-
-// DecodeRLP implements rlp.Decoder.
-//
-// Note some redundant fields(e.g. block number, tx hash etc) will be assembled later.
-func (l *LogForStorage) DecodeRLP(s *rlp.Stream) error {
- blob, err := s.Raw()
- if err != nil {
- return err
- }
- var dec rlpLog
- err = rlp.DecodeBytes(blob, &dec)
- if err == nil {
- *l = LogForStorage{
- Address: dec.Address,
- Topics: dec.Topics,
- Data: dec.Data,
- }
- } else {
- // Try to decode log with previous definition.
- var dec legacyRlpStorageLog
- err = rlp.DecodeBytes(blob, &dec)
- if err == nil {
- *l = LogForStorage{
- Address: dec.Address,
- Topics: dec.Topics,
- Data: dec.Data,
- }
- }
- }
- return err
-}
diff --git a/vendor/github.com/ethereum/go-ethereum/core/types/opt_types.go b/vendor/github.com/ethereum/go-ethereum/core/types/opt_types.go
deleted file mode 100644
index 4c7e5cf9d..000000000
--- a/vendor/github.com/ethereum/go-ethereum/core/types/opt_types.go
+++ /dev/null
@@ -1,65 +0,0 @@
-package types
-
-import (
- "math/big"
-
- "github.com/ethereum/go-ethereum/common"
-)
-
-type OptimismDepositTx struct {
- ChainID *big.Int
- From common.Address
- To common.Address
- Mint *big.Int
- Value *big.Int
- Data []byte
- GasLimit uint64
-}
-
-func (d *OptimismDepositTx) txType() byte {
- return OptimismDepositTxType
-}
-
-func (d *OptimismDepositTx) copy() TxData {
- tx := &OptimismDepositTx{
- From: d.From,
- To: d.To,
- Mint: new(big.Int),
- Value: new(big.Int),
- ChainID: new(big.Int),
- Data: d.Data,
- GasLimit: d.GasLimit,
- }
- if d.Value != nil {
- tx.Value.Set(d.Value)
- }
-
- if d.ChainID != nil {
- tx.Value.Set(d.ChainID)
- }
-
- if d.Mint != nil {
- tx.Value.Set(d.Mint)
- }
- return tx
-}
-
-func (d *OptimismDepositTx) chainID() *big.Int { return d.ChainID }
-func (d *OptimismDepositTx) accessList() AccessList { return nil }
-func (d *OptimismDepositTx) data() []byte { return nil }
-func (d *OptimismDepositTx) gas() uint64 { return 0 }
-func (d *OptimismDepositTx) gasPrice() *big.Int { return bigZero }
-func (d *OptimismDepositTx) gasTipCap() *big.Int { return bigZero }
-func (d *OptimismDepositTx) gasFeeCap() *big.Int { return bigZero }
-func (d *OptimismDepositTx) value() *big.Int { return d.Value }
-func (d *OptimismDepositTx) nonce() uint64 { return 0 }
-func (d *OptimismDepositTx) to() *common.Address { return &d.To }
-func (d *OptimismDepositTx) isFake() bool { return true }
-
-func (d *OptimismDepositTx) rawSignatureValues() (v, r, s *big.Int) {
- return bigZero, bigZero, bigZero
-}
-
-func (d *OptimismDepositTx) setSignatureValues(chainID, v, r, s *big.Int) {
-
-}
diff --git a/vendor/github.com/ethereum/go-ethereum/core/types/optimism_deposit_tx.go b/vendor/github.com/ethereum/go-ethereum/core/types/optimism_deposit_tx.go
new file mode 100644
index 000000000..0f6c9f9c0
--- /dev/null
+++ b/vendor/github.com/ethereum/go-ethereum/core/types/optimism_deposit_tx.go
@@ -0,0 +1,92 @@
+// Copyright 2021 The go-ethereum Authors
+// This file is part of the go-ethereum library.
+//
+// The go-ethereum library is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Lesser General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// The go-ethereum library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public License
+// along with the go-ethereum library. If not, see .
+
+package types
+
+import (
+ "math/big"
+
+ "github.com/ethereum/go-ethereum/common"
+)
+
+type OptimismDepositTx struct {
+ // SourceHash uniquely identifies the source of the deposit
+ SourceHash common.Hash
+ // From is exposed through the types.Signer, not through TxData
+ From common.Address
+ // nil means contract creation
+ To *common.Address `rlp:"nil"`
+ // Mint is minted on L2, locked on L1, nil if no minting.
+ Mint *big.Int `rlp:"nil"`
+ // Value is transferred from L2 balance, executed after Mint (if any)
+ Value *big.Int
+ // gas limit
+ Gas uint64
+ // Field indicating if this transaction is exempt from the L2 gas limit.
+ IsSystemTransaction bool
+ // Normal Tx data
+ Data []byte
+}
+
+// copy creates a deep copy of the transaction data and initializes all fields.
+func (tx *OptimismDepositTx) copy() TxData {
+ cpy := &OptimismDepositTx{
+ SourceHash: tx.SourceHash,
+ From: tx.From,
+ To: copyAddressPtr(tx.To),
+ Mint: nil,
+ Value: new(big.Int),
+ Gas: tx.Gas,
+ IsSystemTransaction: tx.IsSystemTransaction,
+ Data: common.CopyBytes(tx.Data),
+ }
+ if tx.Mint != nil {
+ cpy.Mint = new(big.Int).Set(tx.Mint)
+ }
+ if tx.Value != nil {
+ cpy.Value.Set(tx.Value)
+ }
+ return cpy
+}
+
+// accessors for innerTx.
+func (tx *OptimismDepositTx) txType() byte { return OptimismDepositTxType }
+func (tx *OptimismDepositTx) chainID() *big.Int { return common.Big0 }
+func (tx *OptimismDepositTx) accessList() AccessList { return nil }
+func (tx *OptimismDepositTx) data() []byte { return tx.Data }
+func (tx *OptimismDepositTx) gas() uint64 { return tx.Gas }
+func (tx *OptimismDepositTx) gasFeeCap() *big.Int { return new(big.Int) }
+func (tx *OptimismDepositTx) gasTipCap() *big.Int { return new(big.Int) }
+func (tx *OptimismDepositTx) gasPrice() *big.Int { return new(big.Int) }
+func (tx *OptimismDepositTx) value() *big.Int { return tx.Value }
+func (tx *OptimismDepositTx) nonce() uint64 { return 0 }
+func (tx *OptimismDepositTx) to() *common.Address { return tx.To }
+func (tx *OptimismDepositTx) isFake() bool { return true }
+func (tx *OptimismDepositTx) isSystemTx() bool { return tx.IsSystemTransaction }
+
+func (tx *OptimismDepositTx) effectiveGasPrice(dst *big.Int, baseFee *big.Int) *big.Int {
+ return dst.Set(new(big.Int))
+}
+
+func (tx *OptimismDepositTx) effectiveNonce() *uint64 { return nil }
+
+func (tx *OptimismDepositTx) rawSignatureValues() (v, r, s *big.Int) {
+ return common.Big0, common.Big0, common.Big0
+}
+
+func (tx *OptimismDepositTx) setSignatureValues(chainID, v, r, s *big.Int) {
+ // this is a noop for deposit transactions
+}
diff --git a/vendor/github.com/ethereum/go-ethereum/core/types/receipt.go b/vendor/github.com/ethereum/go-ethereum/core/types/receipt.go
index bdf484514..8b4292604 100644
--- a/vendor/github.com/ethereum/go-ethereum/core/types/receipt.go
+++ b/vendor/github.com/ethereum/go-ethereum/core/types/receipt.go
@@ -36,6 +36,7 @@ import (
var (
receiptStatusFailedRLP = []byte{}
receiptStatusSuccessfulRLP = []byte{0x01}
+ receiptRootArbitrumLegacy = []byte{0x00}
)
var errShortTypedReceipt = errors.New("typed receipt too short")
@@ -50,6 +51,9 @@ const (
// Receipt represents the results of a transaction.
type Receipt struct {
+ // Arbitrum Implementation fields
+ GasUsedForL1 uint64 `json:"gasUsedForL1,omitempty"`
+
// Consensus fields: These fields are defined by the Yellow Paper
Type uint8 `json:"type,omitempty"`
PostState []byte `json:"root"`
@@ -58,20 +62,34 @@ type Receipt struct {
Bloom Bloom `json:"logsBloom" gencodec:"required"`
Logs []*Log `json:"logs" gencodec:"required"`
- // Implementation fields: These fields are added by geth when processing a transaction.
- // They are stored in the chain database.
- TxHash common.Hash `json:"transactionHash" gencodec:"required"`
- ContractAddress common.Address `json:"contractAddress"`
- GasUsed uint64 `json:"gasUsed" gencodec:"required"`
+ // Implementation fields: These fields are added by geth when processing a transaction or retrieving a receipt.
+ // gencodec annotated fields: these are stored in the chain database.
+ TxHash common.Hash `json:"transactionHash" gencodec:"required"`
+ ContractAddress common.Address `json:"contractAddress"`
+ GasUsed uint64 `json:"gasUsed" gencodec:"required"`
+ EffectiveGasPrice *big.Int `json:"effectiveGasPrice"`
+
+ // DepositNonce was introduced in Regolith to store the actual nonce used by deposit transactions
+ // The state transition process ensures this is only set for Regolith deposit transactions.
+ DepositNonce *uint64 `json:"depositNonce,omitempty"`
// Inclusion information: These fields provide information about the inclusion of the
// transaction corresponding to this receipt.
BlockHash common.Hash `json:"blockHash,omitempty"`
BlockNumber *big.Int `json:"blockNumber,omitempty"`
TransactionIndex uint `json:"transactionIndex"`
+
+ // OVM legacy: extend receipts with their L1 price (if a rollup tx)
+ L1GasPrice *big.Int `json:"l1GasPrice,omitempty"`
+ L1GasUsed *big.Int `json:"l1GasUsed,omitempty"`
+ L1Fee *big.Int `json:"l1Fee,omitempty"`
+ FeeScalar *big.Float `json:"l1FeeScalar,omitempty"`
}
type receiptMarshaling struct {
+ // Arbitrum specific fields
+ GasUsedForL1 hexutil.Uint64
+
Type hexutil.Uint64
PostState hexutil.Bytes
Status hexutil.Uint64
@@ -79,6 +97,12 @@ type receiptMarshaling struct {
GasUsed hexutil.Uint64
BlockNumber *hexutil.Big
TransactionIndex hexutil.Uint
+
+ // Optimism: extend receipts with their L1 price (if a rollup tx)
+ L1GasPrice *hexutil.Big
+ L1GasUsed *hexutil.Big
+ L1Fee *hexutil.Big
+ FeeScalar *big.Float
}
// receiptRLP is the consensus encoding of a receipt.
@@ -89,32 +113,102 @@ type receiptRLP struct {
Logs []*Log
}
+type optimismDepositReceiptRlp struct {
+ PostStateOrStatus []byte
+ CumulativeGasUsed uint64
+ Bloom Bloom
+ Logs []*Log
+ // DepositNonce was introduced in Regolith to store the actual nonce used by deposit transactions.
+ // Must be nil for any transactions prior to Regolith or that aren't deposit transactions.
+ DepositNonce *uint64 `rlp:"optional"`
+}
+
// storedReceiptRLP is the storage encoding of a receipt.
type storedReceiptRLP struct {
PostStateOrStatus []byte
CumulativeGasUsed uint64
- Logs []*LogForStorage
+ L1GasUsed *uint64 `rlp:"optional"`
+ Logs []*Log
+ ContractAddress *common.Address `rlp:"optional"` // set on new versions if an Arbitrum tx type
+ // DepositNonce was introduced in Regolith to store the actual nonce used by deposit transactions.
+ // Must be nil for any transactions prior to Regolith or that aren't deposit transactions.
+ DepositNonce *uint64 `rlp:"optional"`
}
-// v4StoredReceiptRLP is the storage encoding of a receipt used in database version 4.
-type v4StoredReceiptRLP struct {
+type arbLegacyStoredReceiptRLP struct {
PostStateOrStatus []byte
CumulativeGasUsed uint64
- TxHash common.Hash
- ContractAddress common.Address
- Logs []*LogForStorage
GasUsed uint64
+ L1GasUsed uint64
+ Status uint64
+ ContractAddress common.Address
+ Logs []*Log
}
-// v3StoredReceiptRLP is the original storage encoding of a receipt including some unnecessary fields.
-type v3StoredReceiptRLP struct {
+// LegacyOptimismStoredReceiptRLP is the pre bedrock storage encoding of a
+// receipt. It will only exist in the database if it was migrated using the
+// migration tool. Nodes that sync using snap-sync will not have any of these
+// entries.
+type LegacyOptimismStoredReceiptRLP struct {
PostStateOrStatus []byte
CumulativeGasUsed uint64
- Bloom Bloom
- TxHash common.Hash
- ContractAddress common.Address
Logs []*LogForStorage
- GasUsed uint64
+ L1GasUsed *big.Int
+ L1GasPrice *big.Int
+ L1Fee *big.Int
+ FeeScalar string
+}
+
+// LogForStorage is a wrapper around a Log that handles
+// backward compatibility with prior storage formats.
+type LogForStorage Log
+
+// EncodeRLP implements rlp.Encoder.
+func (l *LogForStorage) EncodeRLP(w io.Writer) error {
+ rl := rlpLog{Address: l.Address, Topics: l.Topics, Data: l.Data}
+ return rlp.Encode(w, &rl)
+}
+
+type legacyRlpStorageLog struct {
+ Address common.Address
+ Topics []common.Hash
+ Data []byte
+ BlockNumber uint64
+ TxHash common.Hash
+ TxIndex uint
+ BlockHash common.Hash
+ Index uint
+}
+
+// DecodeRLP implements rlp.Decoder.
+//
+// Note some redundant fields(e.g. block number, tx hash etc) will be assembled later.
+func (l *LogForStorage) DecodeRLP(s *rlp.Stream) error {
+ blob, err := s.Raw()
+ if err != nil {
+ return err
+ }
+ var dec rlpLog
+ err = rlp.DecodeBytes(blob, &dec)
+ if err == nil {
+ *l = LogForStorage{
+ Address: dec.Address,
+ Topics: dec.Topics,
+ Data: dec.Data,
+ }
+ } else {
+ // Try to decode log with previous definition.
+ var dec legacyRlpStorageLog
+ err = rlp.DecodeBytes(blob, &dec)
+ if err == nil {
+ *l = LogForStorage{
+ Address: dec.Address,
+ Topics: dec.Topics,
+ Data: dec.Data,
+ }
+ }
+ }
+ return err
}
// NewReceipt creates a barebone transaction receipt, copying the init fields.
@@ -140,6 +234,7 @@ func (r *Receipt) EncodeRLP(w io.Writer) error {
if r.Type == LegacyTxType {
return rlp.Encode(w, data)
}
+ // It's an EIP-2718 typed TX envelope.
buf := encodeBufferPool.Get().(*bytes.Buffer)
defer encodeBufferPool.Put(buf)
buf.Reset()
@@ -152,7 +247,13 @@ func (r *Receipt) EncodeRLP(w io.Writer) error {
// encodeTyped writes the canonical encoding of a typed receipt to w.
func (r *Receipt) encodeTyped(data *receiptRLP, w *bytes.Buffer) error {
w.WriteByte(r.Type)
- return rlp.Encode(w, data)
+ switch r.Type {
+ case OptimismDepositTxType:
+ withNonce := optimismDepositReceiptRlp{data.PostStateOrStatus, data.CumulativeGasUsed, data.Bloom, data.Logs, r.DepositNonce}
+ return rlp.Encode(w, withNonce)
+ default:
+ return rlp.Encode(w, data)
+ }
}
// MarshalBinary returns the consensus encoding of the receipt.
@@ -222,6 +323,15 @@ func (r *Receipt) decodeTyped(b []byte) error {
}
r.Type = b[0]
return r.setFromRLP(data)
+ case OptimismDepositTxType:
+ var data optimismDepositReceiptRlp
+ err := rlp.DecodeBytes(b[1:], &data)
+ if err != nil {
+ return err
+ }
+ r.Type = b[0]
+ r.DepositNonce = data.DepositNonce
+ return r.setFromRLP(receiptRLP{data.PostStateOrStatus, data.CumulativeGasUsed, data.Bloom, data.Logs})
default:
return ErrTxTypeNotSupported
}
@@ -274,10 +384,23 @@ type ReceiptForStorage Receipt
// EncodeRLP implements rlp.Encoder, and flattens all content fields of a receipt
// into an RLP stream.
func (r *ReceiptForStorage) EncodeRLP(_w io.Writer) error {
+
w := rlp.NewEncoderBuffer(_w)
outerList := w.List()
- w.WriteBytes((*Receipt)(r).statusEncoding())
- w.WriteUint64(r.CumulativeGasUsed)
+ if r.Type == ArbitrumLegacyTxType {
+ w.WriteBytes(receiptRootArbitrumLegacy)
+ w.WriteUint64(r.CumulativeGasUsed)
+ w.WriteUint64(r.GasUsed)
+ w.WriteUint64(r.GasUsedForL1)
+ w.WriteUint64(r.Status)
+ rlp.Encode(w, r.ContractAddress)
+ } else {
+ w.WriteBytes((*Receipt)(r).statusEncoding())
+ w.WriteUint64(r.CumulativeGasUsed)
+ if isTypeArbitrum(r.Type) {
+ w.WriteUint64(r.GasUsedForL1)
+ }
+ }
logList := w.List()
for _, log := range r.Logs {
if err := rlp.Encode(w, log); err != nil {
@@ -285,6 +408,12 @@ func (r *ReceiptForStorage) EncodeRLP(_w io.Writer) error {
}
}
w.ListEnd(logList)
+ if r.DepositNonce != nil {
+ w.WriteUint64(*r.DepositNonce)
+ }
+ if isTypeArbitrum(r.Type) && r.Type != ArbitrumLegacyTxType && r.ContractAddress != (common.Address{}) {
+ w.WriteBytes(r.ContractAddress[:])
+ }
w.ListEnd(outerList)
return w.Flush()
}
@@ -303,10 +432,61 @@ func (r *ReceiptForStorage) DecodeRLP(s *rlp.Stream) error {
if err := decodeStoredReceiptRLP(r, blob); err == nil {
return nil
}
- if err := decodeV3StoredReceiptRLP(r, blob); err == nil {
+ if err := decodeArbitrumLegacyStoredReceiptRLP(r, blob); err == nil {
return nil
}
- return decodeV4StoredReceiptRLP(r, blob)
+ return decodeLegacyOptimismReceiptRLP(r, blob)
+}
+
+func decodeArbitrumLegacyStoredReceiptRLP(r *ReceiptForStorage, blob []byte) error {
+ var stored arbLegacyStoredReceiptRLP
+ if err := rlp.DecodeBytes(blob, &stored); err != nil {
+ return err
+ }
+ if !bytes.Equal(stored.PostStateOrStatus, receiptRootArbitrumLegacy) {
+ return errors.New("not arbitrum legacy Tx")
+ }
+ r.Type = ArbitrumLegacyTxType
+ (*Receipt)(r).PostState = receiptRootArbitrumLegacy
+ r.Status = stored.Status
+ r.CumulativeGasUsed = stored.CumulativeGasUsed
+ r.GasUsed = stored.GasUsed
+ r.GasUsedForL1 = stored.L1GasUsed
+ r.ContractAddress = stored.ContractAddress
+ r.Logs = stored.Logs
+ r.Bloom = CreateBloom(Receipts{(*Receipt)(r)})
+
+ return nil
+}
+
+func decodeLegacyOptimismReceiptRLP(r *ReceiptForStorage, blob []byte) error {
+ var stored LegacyOptimismStoredReceiptRLP
+ if err := rlp.DecodeBytes(blob, &stored); err != nil {
+ return err
+ }
+ if err := (*Receipt)(r).setStatus(stored.PostStateOrStatus); err != nil {
+ return err
+ }
+ r.CumulativeGasUsed = stored.CumulativeGasUsed
+ r.Logs = make([]*Log, len(stored.Logs))
+ for i, log := range stored.Logs {
+ r.Logs[i] = (*Log)(log)
+ }
+ r.Bloom = CreateBloom(Receipts{(*Receipt)(r)})
+ // UsingOVM
+ scalar := new(big.Float)
+ if stored.FeeScalar != "" {
+ var ok bool
+ scalar, ok = scalar.SetString(stored.FeeScalar)
+ if !ok {
+ return errors.New("cannot parse fee scalar")
+ }
+ }
+ r.L1GasUsed = stored.L1GasUsed
+ r.L1GasPrice = stored.L1GasPrice
+ r.L1Fee = stored.L1Fee
+ r.FeeScalar = scalar
+ return nil
}
func decodeStoredReceiptRLP(r *ReceiptForStorage, blob []byte) error {
@@ -318,52 +498,16 @@ func decodeStoredReceiptRLP(r *ReceiptForStorage, blob []byte) error {
return err
}
r.CumulativeGasUsed = stored.CumulativeGasUsed
- r.Logs = make([]*Log, len(stored.Logs))
- for i, log := range stored.Logs {
- r.Logs[i] = (*Log)(log)
+ if stored.L1GasUsed != nil {
+ r.GasUsedForL1 = *stored.L1GasUsed
}
+ r.Logs = stored.Logs
r.Bloom = CreateBloom(Receipts{(*Receipt)(r)})
-
- return nil
-}
-
-func decodeV4StoredReceiptRLP(r *ReceiptForStorage, blob []byte) error {
- var stored v4StoredReceiptRLP
- if err := rlp.DecodeBytes(blob, &stored); err != nil {
- return err
+ if stored.ContractAddress != nil {
+ r.ContractAddress = *stored.ContractAddress
}
- if err := (*Receipt)(r).setStatus(stored.PostStateOrStatus); err != nil {
- return err
- }
- r.CumulativeGasUsed = stored.CumulativeGasUsed
- r.TxHash = stored.TxHash
- r.ContractAddress = stored.ContractAddress
- r.GasUsed = stored.GasUsed
- r.Logs = make([]*Log, len(stored.Logs))
- for i, log := range stored.Logs {
- r.Logs[i] = (*Log)(log)
- }
- r.Bloom = CreateBloom(Receipts{(*Receipt)(r)})
-
- return nil
-}
-
-func decodeV3StoredReceiptRLP(r *ReceiptForStorage, blob []byte) error {
- var stored v3StoredReceiptRLP
- if err := rlp.DecodeBytes(blob, &stored); err != nil {
- return err
- }
- if err := (*Receipt)(r).setStatus(stored.PostStateOrStatus); err != nil {
- return err
- }
- r.CumulativeGasUsed = stored.CumulativeGasUsed
- r.Bloom = stored.Bloom
- r.TxHash = stored.TxHash
- r.ContractAddress = stored.ContractAddress
- r.GasUsed = stored.GasUsed
- r.Logs = make([]*Log, len(stored.Logs))
- for i, log := range stored.Logs {
- r.Logs[i] = (*Log)(log)
+ if stored.DepositNonce != nil {
+ r.DepositNonce = stored.DepositNonce
}
return nil
}
@@ -379,13 +523,10 @@ func (rs Receipts) EncodeIndex(i int, w *bytes.Buffer) {
r := rs[i]
data := &receiptRLP{r.statusEncoding(), r.CumulativeGasUsed, r.Bloom, r.Logs}
switch r.Type {
- case LegacyTxType:
+ case LegacyTxType, ArbitrumLegacyTxType:
rlp.Encode(w, data)
- case AccessListTxType:
- w.WriteByte(AccessListTxType)
- rlp.Encode(w, data)
- case DynamicFeeTxType:
- w.WriteByte(DynamicFeeTxType)
+ case AccessListTxType, DynamicFeeTxType, ArbitrumDepositTxType, ArbitrumUnsignedTxType, ArbitrumContractTxType, ArbitrumRetryTxType, ArbitrumSubmitRetryableTxType, ArbitrumInternalTxType, OptimismDepositTxType:
+ w.WriteByte(r.Type)
rlp.Encode(w, data)
default:
// For unsupported types, write nothing. Since this is for
@@ -396,7 +537,7 @@ func (rs Receipts) EncodeIndex(i int, w *bytes.Buffer) {
// DeriveFields fills the receipts with their computed fields based on consensus
// data and contextual infos like containing block and transactions.
-func (rs Receipts) DeriveFields(config *params.ChainConfig, hash common.Hash, number uint64, txs Transactions) error {
+func (rs Receipts) DeriveFields(config *params.ChainConfig, hash common.Hash, number uint64, time uint64, baseFee *big.Int, txs Transactions) error {
signer := MakeSigner(config, new(big.Int).SetUint64(number))
logIndex := uint(0)
@@ -408,23 +549,33 @@ func (rs Receipts) DeriveFields(config *params.ChainConfig, hash common.Hash, nu
rs[i].Type = txs[i].Type()
rs[i].TxHash = txs[i].Hash()
+ rs[i].EffectiveGasPrice = txs[i].inner.effectiveGasPrice(new(big.Int), baseFee)
+
// block location fields
rs[i].BlockHash = hash
rs[i].BlockNumber = new(big.Int).SetUint64(number)
rs[i].TransactionIndex = uint(i)
- // The contract address can be derived from the transaction itself
- if txs[i].To() == nil {
- // Deriving the signer is expensive, only do if it's actually needed
- from, _ := Sender(signer, txs[i])
- rs[i].ContractAddress = crypto.CreateAddress(from, txs[i].Nonce())
- }
- // The used gas can be calculated based on previous r
- if i == 0 {
- rs[i].GasUsed = rs[i].CumulativeGasUsed
- } else {
- rs[i].GasUsed = rs[i].CumulativeGasUsed - rs[i-1].CumulativeGasUsed
+ if rs[i].Type != ArbitrumLegacyTxType {
+ // The contract address can be derived from the transaction itself
+ if txs[i].To() == nil {
+ if rs[i].ContractAddress == (common.Address{}) {
+ // Deriving the signer is expensive, only do if it's actually needed
+ from, _ := Sender(signer, txs[i])
+ rs[i].ContractAddress = crypto.CreateAddress(from, txs[i].Nonce())
+ }
+ } else {
+ rs[i].ContractAddress = common.Address{}
+ }
+
+ // The used gas can be calculated based on previous r
+ if i == 0 {
+ rs[i].GasUsed = rs[i].CumulativeGasUsed
+ } else {
+ rs[i].GasUsed = rs[i].CumulativeGasUsed - rs[i-1].CumulativeGasUsed
+ }
}
+
// The derived log fields can simply be set from the block and transaction
for j := 0; j < len(rs[i].Logs); j++ {
rs[i].Logs[j].BlockNumber = number
diff --git a/vendor/github.com/ethereum/go-ethereum/core/types/rollup_l1_cost.go b/vendor/github.com/ethereum/go-ethereum/core/types/rollup_l1_cost.go
new file mode 100644
index 000000000..a9fb588dc
--- /dev/null
+++ b/vendor/github.com/ethereum/go-ethereum/core/types/rollup_l1_cost.go
@@ -0,0 +1,88 @@
+// Copyright 2022 The go-ethereum Authors
+// This file is part of the go-ethereum library.
+//
+// The go-ethereum library is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Lesser General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// The go-ethereum library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public License
+// along with the go-ethereum library. If not, see .
+
+package types
+
+import (
+ "math/big"
+
+ "github.com/ethereum/go-ethereum/common"
+)
+
+type RollupGasData struct {
+ Zeroes, Ones uint64
+}
+
+/*
+ // Unused, depends on other unneeded changes
+ func (r RollupGasData) DataGas(time uint64, cfg *params.ChainConfig) (gas uint64) {
+ gas = r.Zeroes * params.TxDataZeroGas
+ if cfg.IsRegolith(time) {
+ gas += r.Ones * params.TxDataNonZeroGasEIP2028
+ } else {
+ gas += (r.Ones + 68) * params.TxDataNonZeroGasEIP2028
+ }
+ return gas
+ }
+*/
+
+type StateGetter interface {
+ GetState(common.Address, common.Hash) common.Hash
+}
+
+// L1CostFunc is used in the state transition to determine the cost of a rollup message.
+// Returns nil if there is no cost.
+type L1CostFunc func(blockNum uint64, blockTime uint64, dataGas RollupGasData, isDepositTx bool) *big.Int
+
+var (
+ L1BaseFeeSlot = common.BigToHash(big.NewInt(1))
+ OverheadSlot = common.BigToHash(big.NewInt(5))
+ ScalarSlot = common.BigToHash(big.NewInt(6))
+)
+
+var L1BlockAddr = common.HexToAddress("0x4200000000000000000000000000000000000015")
+
+// NewL1CostFunc returns a function used for calculating L1 fee cost.
+// This depends on the oracles because gas costs can change over time.
+// It returns nil if there is no applicable cost function.
+/*
+// Unused, depends on other unneeded changes
+func NewL1CostFunc(config *params.ChainConfig, statedb StateGetter) L1CostFunc {
+ cacheBlockNum := ^uint64(0)
+ var l1BaseFee, overhead, scalar *big.Int
+ return func(blockNum uint64, blockTime uint64, dataGas RollupGasData, isDepositTx bool) *big.Int {
+ rollupDataGas := dataGas.DataGas(blockTime, config) // Only fake txs for RPC view-calls are 0.
+ if config.Optimism == nil || isDepositTx || rollupDataGas == 0 {
+ return nil
+ }
+ if blockNum != cacheBlockNum {
+ l1BaseFee = statedb.GetState(L1BlockAddr, L1BaseFeeSlot).Big()
+ overhead = statedb.GetState(L1BlockAddr, OverheadSlot).Big()
+ scalar = statedb.GetState(L1BlockAddr, ScalarSlot).Big()
+ cacheBlockNum = blockNum
+ }
+ return L1Cost(rollupDataGas, l1BaseFee, overhead, scalar)
+ }
+}
+*/
+
+func L1Cost(rollupDataGas uint64, l1BaseFee, overhead, scalar *big.Int) *big.Int {
+ l1GasUsed := new(big.Int).SetUint64(rollupDataGas)
+ l1GasUsed = l1GasUsed.Add(l1GasUsed, overhead)
+ l1Cost := l1GasUsed.Mul(l1GasUsed, l1BaseFee)
+ l1Cost = l1Cost.Mul(l1Cost, scalar)
+ return l1Cost.Div(l1Cost, big.NewInt(1_000_000))
+}
diff --git a/vendor/github.com/ethereum/go-ethereum/core/types/transaction.go b/vendor/github.com/ethereum/go-ethereum/core/types/transaction.go
index 008040124..6315f1386 100644
--- a/vendor/github.com/ethereum/go-ethereum/core/types/transaction.go
+++ b/vendor/github.com/ethereum/go-ethereum/core/types/transaction.go
@@ -28,6 +28,7 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/math"
"github.com/ethereum/go-ethereum/crypto"
+ "github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/rlp"
)
@@ -67,6 +68,9 @@ type Transaction struct {
hash atomic.Value
size atomic.Value
from atomic.Value
+
+ // cache of RollupGasData details to compute the gas the tx takes on L1 for its share of rollup data
+ rollupGas atomic.Value
}
// NewTx creates a new transaction.
@@ -76,6 +80,18 @@ func NewTx(inner TxData) *Transaction {
return tx
}
+func isTypeOptimism(txType uint8) bool {
+ return txType == OptimismDepositTxType
+}
+
+func isTypeArbitrum(txType uint8) bool {
+ switch txType {
+ case ArbitrumDepositTxType, ArbitrumUnsignedTxType, ArbitrumContractTxType, ArbitrumRetryTxType, ArbitrumSubmitRetryableTxType, ArbitrumInternalTxType, ArbitrumLegacyTxType:
+ return true
+ }
+ return false
+}
+
// TxData is the underlying data of a transaction.
//
// This is implemented by DynamicFeeTx, LegacyTx and AccessListTx.
@@ -93,11 +109,19 @@ type TxData interface {
value() *big.Int
nonce() uint64
to() *common.Address
+ isFake() bool
+ isSystemTx() bool
rawSignatureValues() (v, r, s *big.Int)
setSignatureValues(chainID, v, r, s *big.Int)
- isFake() bool
+ // effectiveGasPrice computes the gas price paid by the transaction, given
+ // the inclusion block baseFee.
+ //
+ // Unlike other TxData methods, the returned *big.Int should be an independent
+ // copy of the computed value, i.e. callers are allowed to mutate the result.
+ // Method implementations can use 'dst' to store the result.
+ effectiveGasPrice(dst *big.Int, baseFee *big.Int) *big.Int
}
// EncodeRLP implements rlp.Encoder
@@ -144,7 +168,7 @@ func (tx *Transaction) DecodeRLP(s *rlp.Stream) error {
var inner LegacyTx
err := s.Decode(&inner)
if err == nil {
- tx.setDecoded(&inner, int(rlp.ListSize(size)))
+ tx.setDecoded(&inner, rlp.ListSize(size))
}
return err
default:
@@ -155,7 +179,7 @@ func (tx *Transaction) DecodeRLP(s *rlp.Stream) error {
}
inner, err := tx.decodeTyped(b, true)
if err == nil {
- tx.setDecoded(inner, len(b))
+ tx.setDecoded(inner, uint64(len(b)))
}
return err
}
@@ -171,7 +195,7 @@ func (tx *Transaction) UnmarshalBinary(b []byte) error {
if err != nil {
return err
}
- tx.setDecoded(&data, len(b))
+ tx.setDecoded(&data, uint64(len(b)))
return nil
}
// It's an EIP2718 typed transaction envelope.
@@ -179,16 +203,16 @@ func (tx *Transaction) UnmarshalBinary(b []byte) error {
if err != nil {
return err
}
- tx.setDecoded(inner, len(b))
+ tx.setDecoded(inner, uint64(len(b)))
return nil
}
// decodeTyped decodes a typed transaction from the canonical format.
-func (tx *Transaction) decodeTyped(b []byte, arbParsing bool) (TxData, error) {
+func (tx *Transaction) decodeTyped(b []byte, l2Parsing bool) (TxData, error) {
if len(b) <= 1 {
return nil, errShortTypedTx
}
- if arbParsing {
+ if l2Parsing {
switch b[0] {
case ArbitrumDepositTxType:
var inner ArbitrumDepositTx
@@ -214,6 +238,14 @@ func (tx *Transaction) decodeTyped(b []byte, arbParsing bool) (TxData, error) {
var inner ArbitrumSubmitRetryableTx
err := rlp.DecodeBytes(b[1:], &inner)
return &inner, err
+ case ArbitrumLegacyTxType:
+ var inner ArbitrumLegacyTxData
+ err := rlp.DecodeBytes(b[1:], &inner)
+ return &inner, err
+ case OptimismDepositTxType:
+ var inner OptimismDepositTx
+ err := rlp.DecodeBytes(b[1:], &inner)
+ return &inner, err
}
}
switch b[0] {
@@ -225,21 +257,17 @@ func (tx *Transaction) decodeTyped(b []byte, arbParsing bool) (TxData, error) {
var inner DynamicFeeTx
err := rlp.DecodeBytes(b[1:], &inner)
return &inner, err
- case ArbitrumLegacyTxType:
- var inner ArbitrumLegacyTxData
- err := rlp.DecodeBytes(b[1:], &inner)
- return &inner, err
default:
return nil, ErrTxTypeNotSupported
}
}
// setDecoded sets the inner transaction and size after decoding.
-func (tx *Transaction) setDecoded(inner TxData, size int) {
+func (tx *Transaction) setDecoded(inner TxData, size uint64) {
tx.inner = inner
tx.time = time.Now()
if size > 0 {
- tx.size.Store(common.StorageSize(size))
+ tx.size.Store(size)
}
}
@@ -328,12 +356,56 @@ func (tx *Transaction) Value() *big.Int { return new(big.Int).Set(tx.inner.value
// Nonce returns the sender account nonce of the transaction.
func (tx *Transaction) Nonce() uint64 { return tx.inner.nonce() }
+// EffectiveNonce returns the nonce that was actually used as part of transaction execution
+// Returns nil if the effective nonce is not known
+func (tx *Transaction) EffectiveNonce() *uint64 {
+ type txWithEffectiveNonce interface {
+ effectiveNonce() *uint64
+ }
+
+ if itx, ok := tx.inner.(txWithEffectiveNonce); ok {
+ return itx.effectiveNonce()
+ }
+ nonce := tx.inner.nonce()
+ return &nonce
+}
+
// To returns the recipient address of the transaction.
// For contract-creation transactions, To returns nil.
func (tx *Transaction) To() *common.Address {
return copyAddressPtr(tx.inner.to())
}
+// SourceHash returns the hash that uniquely identifies the source of the deposit tx,
+// e.g. a user deposit event, or a L1 info deposit included in a specific L2 block height.
+// Non-deposit transactions return a zeroed hash.
+func (tx *Transaction) SourceHash() common.Hash {
+ if dep, ok := tx.inner.(*OptimismDepositTx); ok {
+ return dep.SourceHash
+ }
+ return common.Hash{}
+}
+
+// Mint returns the ETH to mint in the deposit tx.
+// This returns nil if there is nothing to mint, or if this is not a deposit tx.
+func (tx *Transaction) Mint() *big.Int {
+ if dep, ok := tx.inner.(*OptimismDepositTx); ok {
+ return dep.Mint
+ }
+ return nil
+}
+
+// IsDepositTx returns true if the transaction is a deposit tx type.
+func (tx *Transaction) IsDepositTx() bool {
+ return tx.Type() == OptimismDepositTxType
+}
+
+// IsSystemTx returns true for deposits that are system transactions. These transactions
+// are executed in an unmetered environment & do not contribute to the block gas limit.
+func (tx *Transaction) IsSystemTx() bool {
+ return tx.inner.isSystemTx()
+}
+
// Cost returns gas * gasPrice + value.
func (tx *Transaction) Cost() *big.Int {
total := new(big.Int).Mul(tx.GasPrice(), new(big.Int).SetUint64(tx.Gas()))
@@ -341,6 +413,30 @@ func (tx *Transaction) Cost() *big.Int {
return total
}
+// RollupDataGas is the amount of gas it takes to confirm the tx on L1 as a rollup
+func (tx *Transaction) RollupDataGas() RollupGasData {
+ if tx.Type() == OptimismDepositTxType {
+ return RollupGasData{}
+ }
+ if v := tx.rollupGas.Load(); v != nil {
+ return v.(RollupGasData)
+ }
+ data, err := tx.MarshalBinary()
+ if err != nil { // Silent error, invalid txs will not be marshalled/unmarshalled for batch submission anyway.
+ log.Error("failed to encode tx for L1 cost computation", "err", err)
+ }
+ var out RollupGasData
+ for _, byt := range data {
+ if byt == 0 {
+ out.Zeroes++
+ } else {
+ out.Ones++
+ }
+ }
+ tx.rollupGas.Store(out)
+ return out
+}
+
// RawSignatureValues returns the V, R, S signature values of the transaction.
// The return values should not be modified by the caller.
func (tx *Transaction) RawSignatureValues() (v, r, s *big.Int) {
@@ -371,6 +467,9 @@ func (tx *Transaction) GasTipCapIntCmp(other *big.Int) int {
// Note: if the effective gasTipCap is negative, this method returns both error
// the actual negative value, _and_ ErrGasFeeCapTooLow
func (tx *Transaction) EffectiveGasTip(baseFee *big.Int) (*big.Int, error) {
+ if tx.Type() == OptimismDepositTxType {
+ return new(big.Int), nil
+ }
if baseFee == nil {
return tx.GasTipCap(), nil
}
@@ -423,16 +522,21 @@ func (tx *Transaction) Hash() common.Hash {
return h
}
-// Size returns the true RLP encoded storage size of the transaction, either by
-// encoding and returning it, or returning a previously cached value.
-func (tx *Transaction) Size() common.StorageSize {
+// Size returns the true encoded storage size of the transaction, either by encoding
+// and returning it, or returning a previously cached value.
+func (tx *Transaction) Size() uint64 {
if size := tx.size.Load(); size != nil {
- return size.(common.StorageSize)
+ return size.(uint64)
}
c := writeCounter(0)
rlp.Encode(&c, &tx.inner)
- tx.size.Store(common.StorageSize(c))
- return common.StorageSize(c)
+
+ size := uint64(c)
+ if tx.Type() != LegacyTxType {
+ size += 1 // type byte
+ }
+ tx.size.Store(size)
+ return size
}
// WithSignature returns a new transaction with the given signature.
@@ -557,6 +661,7 @@ func (s *TxByPriceAndTime) Pop() interface{} {
old := *s
n := len(old)
x := old[n-1]
+ old[n-1] = nil
*s = old[0 : n-1]
return x
}
@@ -648,6 +753,7 @@ type Message struct {
accessList AccessList
checkNonce bool
isFake bool
+ isSystemTx bool
}
type MessageRunMode uint8
@@ -672,6 +778,7 @@ func NewMessage(from common.Address, to *common.Address, nonce uint64, amount *b
accessList: accessList,
checkNonce: checkNonce,
isFake: false,
+ isSystemTx: false,
}
}
@@ -691,6 +798,7 @@ func (tx *Transaction) AsMessage(s Signer, baseFee *big.Int) (Message, error) {
accessList: tx.AccessList(),
checkNonce: true,
isFake: tx.inner.isFake(),
+ isSystemTx: tx.inner.isSystemTx(),
}
// If baseFee provided, set gasPrice to effectiveGasPrice.
if baseFee != nil {
@@ -716,6 +824,7 @@ func (m Message) Data() []byte { return m.data }
func (m Message) AccessList() AccessList { return m.accessList }
func (m Message) CheckNonce() bool { return m.checkNonce }
func (m Message) IsFake() bool { return m.isFake }
+func (m Message) IsSystemTx() bool { return m.isSystemTx }
// copyAddressPtr copies an address.
func copyAddressPtr(a *common.Address) *common.Address {
diff --git a/vendor/github.com/ethereum/go-ethereum/core/types/transaction_marshalling.go b/vendor/github.com/ethereum/go-ethereum/core/types/transaction_marshalling.go
index 12942ff01..b73965e19 100644
--- a/vendor/github.com/ethereum/go-ethereum/core/types/transaction_marshalling.go
+++ b/vendor/github.com/ethereum/go-ethereum/core/types/transaction_marshalling.go
@@ -19,10 +19,12 @@ package types
import (
"encoding/json"
"errors"
+ "io"
"math/big"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
+ "github.com/ethereum/go-ethereum/rlp"
)
// txJSON is the JSON representation of transactions.
@@ -42,12 +44,18 @@ type txJSON struct {
S *hexutil.Big `json:"s"`
To *common.Address `json:"to"`
+ // Optimism Deposit transaction fields
+ SourceHash *common.Hash `json:"sourceHash,omitempty"`
+ From *common.Address `json:"from,omitempty"`
+ Mint *hexutil.Big `json:"mint,omitempty"`
+ IsSystemTx *bool `json:"isSystemTx,omitempty"`
+
// Access list transaction fields:
ChainID *hexutil.Big `json:"chainId,omitempty"`
AccessList *AccessList `json:"accessList,omitempty"`
// Arbitrum fields:
- From *common.Address `json:"from,omitempty"` // Contract SubmitRetryable Unsigned Retry
+ //From *common.Address `json:"from,omitempty"` // Contract SubmitRetryable Unsigned Retry
RequestId *common.Hash `json:"requestId,omitempty"` // Contract SubmitRetryable Deposit
TicketId *common.Hash `json:"ticketId,omitempty"` // Retry
MaxRefund *hexutil.Big `json:"maxRefund,omitempty"` // Retry
@@ -68,11 +76,11 @@ type txJSON struct {
}
// MarshalJSON marshals as JSON with a hash.
-func (t *Transaction) MarshalJSON() ([]byte, error) {
+func (tx *Transaction) MarshalJSON() ([]byte, error) {
var enc txJSON
// These are set for all tx types.
- enc.Hash = t.Hash()
- enc.Type = hexutil.Uint64(t.Type())
+ enc.Hash = tx.Hash()
+ enc.Type = hexutil.Uint64(tx.Type())
// Arbitrum: set to 0 for compatibility
var zero uint64
@@ -86,118 +94,130 @@ func (t *Transaction) MarshalJSON() ([]byte, error) {
enc.S = (*hexutil.Big)(common.Big0)
// Other fields are set conditionally depending on tx type.
- switch tx := t.inner.(type) {
+ switch itx := tx.inner.(type) {
case *LegacyTx:
- enc.Nonce = (*hexutil.Uint64)(&tx.Nonce)
- enc.Gas = (*hexutil.Uint64)(&tx.Gas)
- enc.GasPrice = (*hexutil.Big)(tx.GasPrice)
- enc.Value = (*hexutil.Big)(tx.Value)
- enc.Data = (*hexutil.Bytes)(&tx.Data)
- enc.To = t.To()
- enc.V = (*hexutil.Big)(tx.V)
- enc.R = (*hexutil.Big)(tx.R)
- enc.S = (*hexutil.Big)(tx.S)
+ enc.Nonce = (*hexutil.Uint64)(&itx.Nonce)
+ enc.Gas = (*hexutil.Uint64)(&itx.Gas)
+ enc.GasPrice = (*hexutil.Big)(itx.GasPrice)
+ enc.Value = (*hexutil.Big)(itx.Value)
+ enc.Data = (*hexutil.Bytes)(&itx.Data)
+ enc.To = tx.To()
+ enc.V = (*hexutil.Big)(itx.V)
+ enc.R = (*hexutil.Big)(itx.R)
+ enc.S = (*hexutil.Big)(itx.S)
case *AccessListTx:
- enc.ChainID = (*hexutil.Big)(tx.ChainID)
- enc.AccessList = &tx.AccessList
- enc.Nonce = (*hexutil.Uint64)(&tx.Nonce)
- enc.Gas = (*hexutil.Uint64)(&tx.Gas)
- enc.GasPrice = (*hexutil.Big)(tx.GasPrice)
- enc.Value = (*hexutil.Big)(tx.Value)
- enc.Data = (*hexutil.Bytes)(&tx.Data)
- enc.To = t.To()
- enc.V = (*hexutil.Big)(tx.V)
- enc.R = (*hexutil.Big)(tx.R)
- enc.S = (*hexutil.Big)(tx.S)
+ enc.ChainID = (*hexutil.Big)(itx.ChainID)
+ enc.AccessList = &itx.AccessList
+ enc.Nonce = (*hexutil.Uint64)(&itx.Nonce)
+ enc.Gas = (*hexutil.Uint64)(&itx.Gas)
+ enc.GasPrice = (*hexutil.Big)(itx.GasPrice)
+ enc.Value = (*hexutil.Big)(itx.Value)
+ enc.Data = (*hexutil.Bytes)(&itx.Data)
+ enc.To = tx.To()
+ enc.V = (*hexutil.Big)(itx.V)
+ enc.R = (*hexutil.Big)(itx.R)
+ enc.S = (*hexutil.Big)(itx.S)
case *DynamicFeeTx:
- enc.ChainID = (*hexutil.Big)(tx.ChainID)
- enc.AccessList = &tx.AccessList
- enc.Nonce = (*hexutil.Uint64)(&tx.Nonce)
- enc.Gas = (*hexutil.Uint64)(&tx.Gas)
- enc.MaxFeePerGas = (*hexutil.Big)(tx.GasFeeCap)
- enc.MaxPriorityFeePerGas = (*hexutil.Big)(tx.GasTipCap)
- enc.Value = (*hexutil.Big)(tx.Value)
- enc.Data = (*hexutil.Bytes)(&tx.Data)
- enc.To = t.To()
- enc.V = (*hexutil.Big)(tx.V)
- enc.R = (*hexutil.Big)(tx.R)
- enc.S = (*hexutil.Big)(tx.S)
+ enc.ChainID = (*hexutil.Big)(itx.ChainID)
+ enc.AccessList = &itx.AccessList
+ enc.Nonce = (*hexutil.Uint64)(&itx.Nonce)
+ enc.Gas = (*hexutil.Uint64)(&itx.Gas)
+ enc.MaxFeePerGas = (*hexutil.Big)(itx.GasFeeCap)
+ enc.MaxPriorityFeePerGas = (*hexutil.Big)(itx.GasTipCap)
+ enc.Value = (*hexutil.Big)(itx.Value)
+ enc.Data = (*hexutil.Bytes)(&itx.Data)
+ enc.To = tx.To()
+ enc.V = (*hexutil.Big)(itx.V)
+ enc.R = (*hexutil.Big)(itx.R)
+ enc.S = (*hexutil.Big)(itx.S)
case *ArbitrumLegacyTxData:
- enc.Nonce = (*hexutil.Uint64)(&tx.Nonce)
- enc.Gas = (*hexutil.Uint64)(&tx.Gas)
- enc.GasPrice = (*hexutil.Big)(tx.GasPrice)
- enc.Value = (*hexutil.Big)(tx.Value)
- enc.Data = (*hexutil.Bytes)(&tx.Data)
- enc.To = t.To()
- enc.V = (*hexutil.Big)(tx.V)
- enc.R = (*hexutil.Big)(tx.R)
- enc.S = (*hexutil.Big)(tx.S)
- enc.EffectiveGasPrice = (*hexutil.Uint64)(&tx.EffectiveGasPrice)
- enc.L1BlockNumber = (*hexutil.Uint64)(&tx.L1BlockNumber)
- enc.From = tx.Sender
+ enc.Nonce = (*hexutil.Uint64)(&itx.Nonce)
+ enc.Gas = (*hexutil.Uint64)(&itx.Gas)
+ enc.GasPrice = (*hexutil.Big)(itx.GasPrice)
+ enc.Value = (*hexutil.Big)(itx.Value)
+ enc.Data = (*hexutil.Bytes)(&itx.Data)
+ enc.To = tx.To()
+ enc.V = (*hexutil.Big)(itx.V)
+ enc.R = (*hexutil.Big)(itx.R)
+ enc.S = (*hexutil.Big)(itx.S)
+ enc.EffectiveGasPrice = (*hexutil.Uint64)(&itx.EffectiveGasPrice)
+ enc.L1BlockNumber = (*hexutil.Uint64)(&itx.L1BlockNumber)
+ enc.From = itx.Sender
case *ArbitrumInternalTx:
- enc.ChainID = (*hexutil.Big)(tx.ChainId)
- enc.Data = (*hexutil.Bytes)(&tx.Data)
+ enc.ChainID = (*hexutil.Big)(itx.ChainId)
+ enc.Data = (*hexutil.Bytes)(&itx.Data)
case *ArbitrumDepositTx:
- enc.RequestId = &tx.L1RequestId
- enc.From = &tx.From
- enc.ChainID = (*hexutil.Big)(tx.ChainId)
- enc.Value = (*hexutil.Big)(tx.Value)
- enc.To = t.To()
+ enc.RequestId = &itx.L1RequestId
+ enc.From = &itx.From
+ enc.ChainID = (*hexutil.Big)(itx.ChainId)
+ enc.Value = (*hexutil.Big)(itx.Value)
+ enc.To = tx.To()
case *ArbitrumUnsignedTx:
- enc.From = (*common.Address)(&tx.From)
- enc.ChainID = (*hexutil.Big)(tx.ChainId)
- enc.Nonce = (*hexutil.Uint64)(&tx.Nonce)
- enc.Gas = (*hexutil.Uint64)(&tx.Gas)
- enc.MaxFeePerGas = (*hexutil.Big)(tx.GasFeeCap)
- enc.Value = (*hexutil.Big)(tx.Value)
- enc.Data = (*hexutil.Bytes)(&tx.Data)
- enc.To = t.To()
+ enc.From = (*common.Address)(&itx.From)
+ enc.ChainID = (*hexutil.Big)(itx.ChainId)
+ enc.Nonce = (*hexutil.Uint64)(&itx.Nonce)
+ enc.Gas = (*hexutil.Uint64)(&itx.Gas)
+ enc.MaxFeePerGas = (*hexutil.Big)(itx.GasFeeCap)
+ enc.Value = (*hexutil.Big)(itx.Value)
+ enc.Data = (*hexutil.Bytes)(&itx.Data)
+ enc.To = tx.To()
case *ArbitrumContractTx:
- enc.RequestId = &tx.RequestId
- enc.From = (*common.Address)(&tx.From)
- enc.ChainID = (*hexutil.Big)(tx.ChainId)
- enc.Gas = (*hexutil.Uint64)(&tx.Gas)
- enc.MaxFeePerGas = (*hexutil.Big)(tx.GasFeeCap)
- enc.Value = (*hexutil.Big)(tx.Value)
- enc.Data = (*hexutil.Bytes)(&tx.Data)
- enc.To = t.To()
+ enc.RequestId = &itx.RequestId
+ enc.From = (*common.Address)(&itx.From)
+ enc.ChainID = (*hexutil.Big)(itx.ChainId)
+ enc.Gas = (*hexutil.Uint64)(&itx.Gas)
+ enc.MaxFeePerGas = (*hexutil.Big)(itx.GasFeeCap)
+ enc.Value = (*hexutil.Big)(itx.Value)
+ enc.Data = (*hexutil.Bytes)(&itx.Data)
+ enc.To = tx.To()
case *ArbitrumRetryTx:
- enc.From = (*common.Address)(&tx.From)
- enc.TicketId = &tx.TicketId
- enc.RefundTo = &tx.RefundTo
- enc.ChainID = (*hexutil.Big)(tx.ChainId)
- enc.Nonce = (*hexutil.Uint64)(&tx.Nonce)
- enc.Gas = (*hexutil.Uint64)(&tx.Gas)
- enc.MaxFeePerGas = (*hexutil.Big)(tx.GasFeeCap)
- enc.Value = (*hexutil.Big)(tx.Value)
- enc.Data = (*hexutil.Bytes)(&tx.Data)
- enc.MaxRefund = (*hexutil.Big)(tx.MaxRefund)
- enc.SubmissionFeeRefund = (*hexutil.Big)(tx.SubmissionFeeRefund)
- enc.To = t.To()
+ enc.From = (*common.Address)(&itx.From)
+ enc.TicketId = &itx.TicketId
+ enc.RefundTo = &itx.RefundTo
+ enc.ChainID = (*hexutil.Big)(itx.ChainId)
+ enc.Nonce = (*hexutil.Uint64)(&itx.Nonce)
+ enc.Gas = (*hexutil.Uint64)(&itx.Gas)
+ enc.MaxFeePerGas = (*hexutil.Big)(itx.GasFeeCap)
+ enc.Value = (*hexutil.Big)(itx.Value)
+ enc.Data = (*hexutil.Bytes)(&itx.Data)
+ enc.MaxRefund = (*hexutil.Big)(itx.MaxRefund)
+ enc.SubmissionFeeRefund = (*hexutil.Big)(itx.SubmissionFeeRefund)
+ enc.To = tx.To()
case *ArbitrumSubmitRetryableTx:
- enc.RequestId = &tx.RequestId
- enc.From = &tx.From
- enc.L1BaseFee = (*hexutil.Big)(tx.L1BaseFee)
- enc.DepositValue = (*hexutil.Big)(tx.DepositValue)
- enc.Beneficiary = &tx.Beneficiary
- enc.RefundTo = &tx.FeeRefundAddr
- enc.MaxSubmissionFee = (*hexutil.Big)(tx.MaxSubmissionFee)
- enc.ChainID = (*hexutil.Big)(tx.ChainId)
- enc.Gas = (*hexutil.Uint64)(&tx.Gas)
- enc.MaxFeePerGas = (*hexutil.Big)(tx.GasFeeCap)
- enc.RetryTo = tx.RetryTo
- enc.RetryValue = (*hexutil.Big)(tx.RetryValue)
- enc.RetryData = (*hexutil.Bytes)(&tx.RetryData)
- data := tx.data()
+ enc.RequestId = &itx.RequestId
+ enc.From = &itx.From
+ enc.L1BaseFee = (*hexutil.Big)(itx.L1BaseFee)
+ enc.DepositValue = (*hexutil.Big)(itx.DepositValue)
+ enc.Beneficiary = &itx.Beneficiary
+ enc.RefundTo = &itx.FeeRefundAddr
+ enc.MaxSubmissionFee = (*hexutil.Big)(itx.MaxSubmissionFee)
+ enc.ChainID = (*hexutil.Big)(itx.ChainId)
+ enc.Gas = (*hexutil.Uint64)(&itx.Gas)
+ enc.MaxFeePerGas = (*hexutil.Big)(itx.GasFeeCap)
+ enc.RetryTo = itx.RetryTo
+ enc.RetryValue = (*hexutil.Big)(itx.RetryValue)
+ enc.RetryData = (*hexutil.Bytes)(&itx.RetryData)
+ data := itx.data()
enc.Data = (*hexutil.Bytes)(&data)
- enc.To = t.To()
+ enc.To = tx.To()
+ case *OptimismDepositTx:
+ enc.Gas = (*hexutil.Uint64)(&itx.Gas)
+ enc.Value = (*hexutil.Big)(itx.Value)
+ enc.Data = (*hexutil.Bytes)(&itx.Data)
+ enc.To = tx.To()
+ enc.SourceHash = &itx.SourceHash
+ enc.From = &itx.From
+ if itx.Mint != nil {
+ enc.Mint = (*hexutil.Big)(itx.Mint)
+ }
+ enc.IsSystemTx = &itx.IsSystemTransaction
+ // other fields will show up as null.
}
return json.Marshal(&enc)
}
// UnmarshalJSON unmarshals from JSON.
-func (t *Transaction) UnmarshalJSON(input []byte) error {
+func (tx *Transaction) UnmarshalJSON(input []byte) error {
var dec txJSON
if err := json.Unmarshal(input, &dec); err != nil {
return err
@@ -625,21 +645,72 @@ func (t *Transaction) UnmarshalJSON(input []byte) error {
RetryData: *dec.RetryData,
}
case OptimismDepositTxType:
- inner = &OptimismDepositTx{
- ChainID: big.NewInt(0),
- From: *dec.From,
- To: *dec.To,
- Mint: new(big.Int),
- Value: (*big.Int)(dec.Value),
- Data: *dec.Data,
+ if dec.AccessList != nil || dec.MaxFeePerGas != nil ||
+ dec.MaxPriorityFeePerGas != nil {
+ return errors.New("unexpected field(s) in deposit transaction")
+ }
+ if dec.GasPrice != nil && dec.GasPrice.ToInt().Cmp(common.Big0) != 0 {
+ return errors.New("deposit transaction GasPrice must be 0")
+ }
+ if (dec.V != nil && dec.V.ToInt().Cmp(common.Big0) != 0) ||
+ (dec.R != nil && dec.R.ToInt().Cmp(common.Big0) != 0) ||
+ (dec.S != nil && dec.S.ToInt().Cmp(common.Big0) != 0) {
+ return errors.New("deposit transaction signature must be 0 or unset")
+ }
+ var itx OptimismDepositTx
+ inner = &itx
+ if dec.To != nil {
+ itx.To = dec.To
+ }
+ if dec.Gas == nil {
+ return errors.New("missing required field 'gas' for txdata")
+ }
+ itx.Gas = uint64(*dec.Gas)
+ if dec.Value == nil {
+ return errors.New("missing required field 'value' in transaction")
+ }
+ itx.Value = (*big.Int)(dec.Value)
+ // mint may be omitted or nil if there is nothing to mint.
+ itx.Mint = (*big.Int)(dec.Mint)
+ if dec.Data == nil {
+ return errors.New("missing required field 'input' in transaction")
+ }
+ itx.Data = *dec.Data
+ if dec.From == nil {
+ return errors.New("missing required field 'from' in transaction")
+ }
+ itx.From = *dec.From
+ if dec.SourceHash == nil {
+ return errors.New("missing required field 'sourceHash' in transaction")
+ }
+ itx.SourceHash = *dec.SourceHash
+ // IsSystemTx may be omitted. Defaults to false.
+ if dec.IsSystemTx != nil {
+ itx.IsSystemTransaction = *dec.IsSystemTx
+ }
+
+ if dec.Nonce != nil {
+ inner = &optimismDepositTxWithNonce{OptimismDepositTx: itx, EffectiveNonce: uint64(*dec.Nonce)}
}
default:
return ErrTxTypeNotSupported
}
// Now set the inner transaction.
- t.setDecoded(inner, 0)
+ tx.setDecoded(inner, 0)
// TODO: check hash here?
return nil
}
+
+type optimismDepositTxWithNonce struct {
+ OptimismDepositTx
+ EffectiveNonce uint64
+}
+
+// EncodeRLP ensures that RLP encoding this transaction excludes the nonce. Otherwise, the tx Hash would change
+func (tx *optimismDepositTxWithNonce) EncodeRLP(w io.Writer) error {
+ return rlp.Encode(w, tx.OptimismDepositTx)
+}
+
+func (tx *optimismDepositTxWithNonce) effectiveNonce() *uint64 { return &tx.EffectiveNonce }
diff --git a/vendor/github.com/ethereum/go-ethereum/core/types/transaction_signing.go b/vendor/github.com/ethereum/go-ethereum/core/types/transaction_signing.go
index 87f0390a6..5391cbad5 100644
--- a/vendor/github.com/ethereum/go-ethereum/core/types/transaction_signing.go
+++ b/vendor/github.com/ethereum/go-ethereum/core/types/transaction_signing.go
@@ -51,6 +51,7 @@ func MakeSigner(config *params.ChainConfig, blockNumber *big.Int) Signer {
default:
signer = FrontierSigner{}
}
+ signer = NewArbitrumSigner(signer)
return signer
}
@@ -61,7 +62,7 @@ func MakeSigner(config *params.ChainConfig, blockNumber *big.Int) Signer {
//
// Use this in transaction-handling code where the current block number is unknown. If you
// have the current block number available, use MakeSigner instead.
-func LatestSigner(config *params.ChainConfig) Signer {
+func latestSignerImpl(config *params.ChainConfig) Signer {
if config.ChainID != nil {
if config.LondonBlock != nil {
return NewLondonSigner(config.ChainID)
@@ -76,6 +77,10 @@ func LatestSigner(config *params.ChainConfig) Signer {
return HomesteadSigner{}
}
+func LatestSigner(config *params.ChainConfig) Signer {
+ return NewArbitrumSigner(latestSignerImpl(config))
+}
+
// LatestSignerForChainID returns the 'most permissive' Signer available. Specifically,
// this enables support for EIP-155 replay protection and all implemented EIP-2718
// transaction types if chainID is non-nil.
@@ -83,13 +88,17 @@ func LatestSigner(config *params.ChainConfig) Signer {
// Use this in transaction-handling code where the current block number and fork
// configuration are unknown. If you have a ChainConfig, use LatestSigner instead.
// If you have a ChainConfig and know the current block number, use MakeSigner instead.
-func LatestSignerForChainID(chainID *big.Int) Signer {
+func latestSignerForChainIDImpl(chainID *big.Int) Signer {
if chainID == nil {
return HomesteadSigner{}
}
return NewLondonSigner(chainID)
}
+func LatestSignerForChainID(chainID *big.Int) Signer {
+ return NewArbitrumSigner(latestSignerForChainIDImpl(chainID))
+}
+
// SignTx signs the transaction using the given signer and private key.
func SignTx(tx *Transaction, s Signer, prv *ecdsa.PrivateKey) (*Transaction, error) {
h := s.Hash(tx)
@@ -182,6 +191,14 @@ func NewLondonSigner(chainId *big.Int) Signer {
}
func (s londonSigner) Sender(tx *Transaction) (common.Address, error) {
+ if tx.Type() == OptimismDepositTxType {
+ switch tx.inner.(type) {
+ case *OptimismDepositTx:
+ return tx.inner.(*OptimismDepositTx).From, nil
+ case *optimismDepositTxWithNonce:
+ return tx.inner.(*optimismDepositTxWithNonce).From, nil
+ }
+ }
if tx.Type() != DynamicFeeTxType {
return s.eip2930Signer.Sender(tx)
}
@@ -201,6 +218,9 @@ func (s londonSigner) Equal(s2 Signer) bool {
}
func (s londonSigner) SignatureValues(tx *Transaction, sig []byte) (R, S, V *big.Int, err error) {
+ if tx.Type() == OptimismDepositTxType {
+ return nil, nil, nil, fmt.Errorf("deposits do not have a signature")
+ }
txdata, ok := tx.inner.(*DynamicFeeTx)
if !ok {
return s.eip2930Signer.SignatureValues(tx, sig)
@@ -218,6 +238,9 @@ func (s londonSigner) SignatureValues(tx *Transaction, sig []byte) (R, S, V *big
// Hash returns the hash to be signed by the sender.
// It does not uniquely identify the transaction.
func (s londonSigner) Hash(tx *Transaction) common.Hash {
+ if tx.Type() == OptimismDepositTxType {
+ panic("deposits cannot be signed and do not have a signing hash")
+ }
if tx.Type() != DynamicFeeTxType {
return s.eip2930Signer.Hash(tx)
}
diff --git a/vendor/github.com/ethereum/go-ethereum/core/types/access_list_tx.go b/vendor/github.com/ethereum/go-ethereum/core/types/tx_access_list.go
similarity index 95%
rename from vendor/github.com/ethereum/go-ethereum/core/types/access_list_tx.go
rename to vendor/github.com/ethereum/go-ethereum/core/types/tx_access_list.go
index 620848fe6..518fb6037 100644
--- a/vendor/github.com/ethereum/go-ethereum/core/types/access_list_tx.go
+++ b/vendor/github.com/ethereum/go-ethereum/core/types/tx_access_list.go
@@ -105,6 +105,11 @@ func (tx *AccessListTx) gasFeeCap() *big.Int { return tx.GasPrice }
func (tx *AccessListTx) value() *big.Int { return tx.Value }
func (tx *AccessListTx) nonce() uint64 { return tx.Nonce }
func (tx *AccessListTx) to() *common.Address { return tx.To }
+func (tx *AccessListTx) isSystemTx() bool { return false }
+
+func (tx *AccessListTx) effectiveGasPrice(dst *big.Int, baseFee *big.Int) *big.Int {
+ return dst.Set(tx.GasPrice)
+}
func (tx *AccessListTx) rawSignatureValues() (v, r, s *big.Int) {
return tx.V, tx.R, tx.S
diff --git a/vendor/github.com/ethereum/go-ethereum/core/types/dynamic_fee_tx.go b/vendor/github.com/ethereum/go-ethereum/core/types/tx_dynamic_fee.go
similarity index 90%
rename from vendor/github.com/ethereum/go-ethereum/core/types/dynamic_fee_tx.go
rename to vendor/github.com/ethereum/go-ethereum/core/types/tx_dynamic_fee.go
index 53f246ea1..ee84b7741 100644
--- a/vendor/github.com/ethereum/go-ethereum/core/types/dynamic_fee_tx.go
+++ b/vendor/github.com/ethereum/go-ethereum/core/types/tx_dynamic_fee.go
@@ -93,6 +93,18 @@ func (tx *DynamicFeeTx) gasPrice() *big.Int { return tx.GasFeeCap }
func (tx *DynamicFeeTx) value() *big.Int { return tx.Value }
func (tx *DynamicFeeTx) nonce() uint64 { return tx.Nonce }
func (tx *DynamicFeeTx) to() *common.Address { return tx.To }
+func (tx *DynamicFeeTx) isSystemTx() bool { return false }
+
+func (tx *DynamicFeeTx) effectiveGasPrice(dst *big.Int, baseFee *big.Int) *big.Int {
+ if baseFee == nil {
+ return dst.Set(tx.GasFeeCap)
+ }
+ tip := dst.Sub(tx.GasFeeCap, baseFee)
+ if tip.Cmp(tx.GasTipCap) > 0 {
+ tip.Set(tx.GasTipCap)
+ }
+ return tip.Add(tip, baseFee)
+}
func (tx *DynamicFeeTx) rawSignatureValues() (v, r, s *big.Int) {
return tx.V, tx.R, tx.S
diff --git a/vendor/github.com/ethereum/go-ethereum/core/types/legacy_tx.go b/vendor/github.com/ethereum/go-ethereum/core/types/tx_legacy.go
similarity index 95%
rename from vendor/github.com/ethereum/go-ethereum/core/types/legacy_tx.go
rename to vendor/github.com/ethereum/go-ethereum/core/types/tx_legacy.go
index 14d307829..3fdbaf1ee 100644
--- a/vendor/github.com/ethereum/go-ethereum/core/types/legacy_tx.go
+++ b/vendor/github.com/ethereum/go-ethereum/core/types/tx_legacy.go
@@ -102,6 +102,11 @@ func (tx *LegacyTx) gasFeeCap() *big.Int { return tx.GasPrice }
func (tx *LegacyTx) value() *big.Int { return tx.Value }
func (tx *LegacyTx) nonce() uint64 { return tx.Nonce }
func (tx *LegacyTx) to() *common.Address { return tx.To }
+func (tx *LegacyTx) isSystemTx() bool { return false }
+
+func (tx *LegacyTx) effectiveGasPrice(dst *big.Int, baseFee *big.Int) *big.Int {
+ return dst.Set(tx.GasPrice)
+}
func (tx *LegacyTx) rawSignatureValues() (v, r, s *big.Int) {
return tx.V, tx.R, tx.S
diff --git a/vendor/github.com/ethereum/go-ethereum/core/types/withdrawal.go b/vendor/github.com/ethereum/go-ethereum/core/types/withdrawal.go
new file mode 100644
index 000000000..d1ad918f9
--- /dev/null
+++ b/vendor/github.com/ethereum/go-ethereum/core/types/withdrawal.go
@@ -0,0 +1,56 @@
+// Copyright 2022 The go-ethereum Authors
+// This file is part of the go-ethereum library.
+//
+// The go-ethereum library is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Lesser General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// The go-ethereum library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public License
+// along with the go-ethereum library. If not, see .
+
+package types
+
+import (
+ "bytes"
+
+ "github.com/ethereum/go-ethereum/common"
+ "github.com/ethereum/go-ethereum/common/hexutil"
+ "github.com/ethereum/go-ethereum/rlp"
+)
+
+//go:generate go run github.com/fjl/gencodec -type Withdrawal -field-override withdrawalMarshaling -out gen_withdrawal_json.go
+//go:generate go run ../../rlp/rlpgen -type Withdrawal -out gen_withdrawal_rlp.go
+
+// Withdrawal represents a validator withdrawal from the consensus layer.
+type Withdrawal struct {
+ Index uint64 `json:"index"` // monotonically increasing identifier issued by consensus layer
+ Validator uint64 `json:"validatorIndex"` // index of validator associated with withdrawal
+ Address common.Address `json:"address"` // target address for withdrawn ether
+ Amount uint64 `json:"amount"` // value of withdrawal in Gwei
+}
+
+// field type overrides for gencodec
+type withdrawalMarshaling struct {
+ Index hexutil.Uint64
+ Validator hexutil.Uint64
+ Amount hexutil.Uint64
+}
+
+// Withdrawals implements DerivableList for withdrawals.
+type Withdrawals []*Withdrawal
+
+// Len returns the length of s.
+func (s Withdrawals) Len() int { return len(s) }
+
+// EncodeIndex encodes the i'th withdrawal to w. Note that this does not check for errors
+// because we assume that *Withdrawal will only ever contain valid withdrawals that were either
+// constructed by decoding or via public API in this package.
+func (s Withdrawals) EncodeIndex(i int, w *bytes.Buffer) {
+ rlp.Encode(w, s[i])
+}
diff --git a/vendor/github.com/ethereum/go-ethereum/crypto/secp256k1/libsecp256k1/contrib/lax_der_parsing.c b/vendor/github.com/ethereum/go-ethereum/crypto/secp256k1/libsecp256k1/contrib/lax_der_parsing.c
deleted file mode 100644
index 5b141a994..000000000
--- a/vendor/github.com/ethereum/go-ethereum/crypto/secp256k1/libsecp256k1/contrib/lax_der_parsing.c
+++ /dev/null
@@ -1,150 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2015 Pieter Wuille *
- * Distributed under the MIT software license, see the accompanying *
- * file COPYING or http://www.opensource.org/licenses/mit-license.php.*
- **********************************************************************/
-
-#include
-#include
-
-#include "lax_der_parsing.h"
-
-int ecdsa_signature_parse_der_lax(const secp256k1_context* ctx, secp256k1_ecdsa_signature* sig, const unsigned char *input, size_t inputlen) {
- size_t rpos, rlen, spos, slen;
- size_t pos = 0;
- size_t lenbyte;
- unsigned char tmpsig[64] = {0};
- int overflow = 0;
-
- /* Hack to initialize sig with a correctly-parsed but invalid signature. */
- secp256k1_ecdsa_signature_parse_compact(ctx, sig, tmpsig);
-
- /* Sequence tag byte */
- if (pos == inputlen || input[pos] != 0x30) {
- return 0;
- }
- pos++;
-
- /* Sequence length bytes */
- if (pos == inputlen) {
- return 0;
- }
- lenbyte = input[pos++];
- if (lenbyte & 0x80) {
- lenbyte -= 0x80;
- if (pos + lenbyte > inputlen) {
- return 0;
- }
- pos += lenbyte;
- }
-
- /* Integer tag byte for R */
- if (pos == inputlen || input[pos] != 0x02) {
- return 0;
- }
- pos++;
-
- /* Integer length for R */
- if (pos == inputlen) {
- return 0;
- }
- lenbyte = input[pos++];
- if (lenbyte & 0x80) {
- lenbyte -= 0x80;
- if (pos + lenbyte > inputlen) {
- return 0;
- }
- while (lenbyte > 0 && input[pos] == 0) {
- pos++;
- lenbyte--;
- }
- if (lenbyte >= sizeof(size_t)) {
- return 0;
- }
- rlen = 0;
- while (lenbyte > 0) {
- rlen = (rlen << 8) + input[pos];
- pos++;
- lenbyte--;
- }
- } else {
- rlen = lenbyte;
- }
- if (rlen > inputlen - pos) {
- return 0;
- }
- rpos = pos;
- pos += rlen;
-
- /* Integer tag byte for S */
- if (pos == inputlen || input[pos] != 0x02) {
- return 0;
- }
- pos++;
-
- /* Integer length for S */
- if (pos == inputlen) {
- return 0;
- }
- lenbyte = input[pos++];
- if (lenbyte & 0x80) {
- lenbyte -= 0x80;
- if (pos + lenbyte > inputlen) {
- return 0;
- }
- while (lenbyte > 0 && input[pos] == 0) {
- pos++;
- lenbyte--;
- }
- if (lenbyte >= sizeof(size_t)) {
- return 0;
- }
- slen = 0;
- while (lenbyte > 0) {
- slen = (slen << 8) + input[pos];
- pos++;
- lenbyte--;
- }
- } else {
- slen = lenbyte;
- }
- if (slen > inputlen - pos) {
- return 0;
- }
- spos = pos;
- pos += slen;
-
- /* Ignore leading zeroes in R */
- while (rlen > 0 && input[rpos] == 0) {
- rlen--;
- rpos++;
- }
- /* Copy R value */
- if (rlen > 32) {
- overflow = 1;
- } else {
- memcpy(tmpsig + 32 - rlen, input + rpos, rlen);
- }
-
- /* Ignore leading zeroes in S */
- while (slen > 0 && input[spos] == 0) {
- slen--;
- spos++;
- }
- /* Copy S value */
- if (slen > 32) {
- overflow = 1;
- } else {
- memcpy(tmpsig + 64 - slen, input + spos, slen);
- }
-
- if (!overflow) {
- overflow = !secp256k1_ecdsa_signature_parse_compact(ctx, sig, tmpsig);
- }
- if (overflow) {
- memset(tmpsig, 0, 64);
- secp256k1_ecdsa_signature_parse_compact(ctx, sig, tmpsig);
- }
- return 1;
-}
-
diff --git a/vendor/github.com/ethereum/go-ethereum/crypto/secp256k1/libsecp256k1/contrib/lax_der_parsing.h b/vendor/github.com/ethereum/go-ethereum/crypto/secp256k1/libsecp256k1/contrib/lax_der_parsing.h
deleted file mode 100644
index 6d27871a7..000000000
--- a/vendor/github.com/ethereum/go-ethereum/crypto/secp256k1/libsecp256k1/contrib/lax_der_parsing.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2015 Pieter Wuille *
- * Distributed under the MIT software license, see the accompanying *
- * file COPYING or http://www.opensource.org/licenses/mit-license.php.*
- **********************************************************************/
-
-/****
- * Please do not link this file directly. It is not part of the libsecp256k1
- * project and does not promise any stability in its API, functionality or
- * presence. Projects which use this code should instead copy this header
- * and its accompanying .c file directly into their codebase.
- ****/
-
-/* This file defines a function that parses DER with various errors and
- * violations. This is not a part of the library itself, because the allowed
- * violations are chosen arbitrarily and do not follow or establish any
- * standard.
- *
- * In many places it matters that different implementations do not only accept
- * the same set of valid signatures, but also reject the same set of signatures.
- * The only means to accomplish that is by strictly obeying a standard, and not
- * accepting anything else.
- *
- * Nonetheless, sometimes there is a need for compatibility with systems that
- * use signatures which do not strictly obey DER. The snippet below shows how
- * certain violations are easily supported. You may need to adapt it.
- *
- * Do not use this for new systems. Use well-defined DER or compact signatures
- * instead if you have the choice (see secp256k1_ecdsa_signature_parse_der and
- * secp256k1_ecdsa_signature_parse_compact).
- *
- * The supported violations are:
- * - All numbers are parsed as nonnegative integers, even though X.609-0207
- * section 8.3.3 specifies that integers are always encoded as two's
- * complement.
- * - Integers can have length 0, even though section 8.3.1 says they can't.
- * - Integers with overly long padding are accepted, violation section
- * 8.3.2.
- * - 127-byte long length descriptors are accepted, even though section
- * 8.1.3.5.c says that they are not.
- * - Trailing garbage data inside or after the signature is ignored.
- * - The length descriptor of the sequence is ignored.
- *
- * Compared to for example OpenSSL, many violations are NOT supported:
- * - Using overly long tag descriptors for the sequence or integers inside,
- * violating section 8.1.2.2.
- * - Encoding primitive integers as constructed values, violating section
- * 8.3.1.
- */
-
-#ifndef _SECP256K1_CONTRIB_LAX_DER_PARSING_H_
-#define _SECP256K1_CONTRIB_LAX_DER_PARSING_H_
-
-#include
-
-# ifdef __cplusplus
-extern "C" {
-# endif
-
-/** Parse a signature in "lax DER" format
- *
- * Returns: 1 when the signature could be parsed, 0 otherwise.
- * Args: ctx: a secp256k1 context object
- * Out: sig: a pointer to a signature object
- * In: input: a pointer to the signature to be parsed
- * inputlen: the length of the array pointed to be input
- *
- * This function will accept any valid DER encoded signature, even if the
- * encoded numbers are out of range. In addition, it will accept signatures
- * which violate the DER spec in various ways. Its purpose is to allow
- * validation of the Bitcoin blockchain, which includes non-DER signatures
- * from before the network rules were updated to enforce DER. Note that
- * the set of supported violations is a strict subset of what OpenSSL will
- * accept.
- *
- * After the call, sig will always be initialized. If parsing failed or the
- * encoded numbers are out of range, signature validation with it is
- * guaranteed to fail for every message and public key.
- */
-int ecdsa_signature_parse_der_lax(
- const secp256k1_context* ctx,
- secp256k1_ecdsa_signature* sig,
- const unsigned char *input,
- size_t inputlen
-) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/vendor/github.com/ethereum/go-ethereum/crypto/secp256k1/libsecp256k1/contrib/lax_der_privatekey_parsing.c b/vendor/github.com/ethereum/go-ethereum/crypto/secp256k1/libsecp256k1/contrib/lax_der_privatekey_parsing.c
deleted file mode 100644
index c2e63b4b8..000000000
--- a/vendor/github.com/ethereum/go-ethereum/crypto/secp256k1/libsecp256k1/contrib/lax_der_privatekey_parsing.c
+++ /dev/null
@@ -1,113 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2014, 2015 Pieter Wuille *
- * Distributed under the MIT software license, see the accompanying *
- * file COPYING or http://www.opensource.org/licenses/mit-license.php.*
- **********************************************************************/
-
-#include
-#include
-
-#include "lax_der_privatekey_parsing.h"
-
-int ec_privkey_import_der(const secp256k1_context* ctx, unsigned char *out32, const unsigned char *privkey, size_t privkeylen) {
- const unsigned char *end = privkey + privkeylen;
- int lenb = 0;
- int len = 0;
- memset(out32, 0, 32);
- /* sequence header */
- if (end < privkey+1 || *privkey != 0x30) {
- return 0;
- }
- privkey++;
- /* sequence length constructor */
- if (end < privkey+1 || !(*privkey & 0x80)) {
- return 0;
- }
- lenb = *privkey & ~0x80; privkey++;
- if (lenb < 1 || lenb > 2) {
- return 0;
- }
- if (end < privkey+lenb) {
- return 0;
- }
- /* sequence length */
- len = privkey[lenb-1] | (lenb > 1 ? privkey[lenb-2] << 8 : 0);
- privkey += lenb;
- if (end < privkey+len) {
- return 0;
- }
- /* sequence element 0: version number (=1) */
- if (end < privkey+3 || privkey[0] != 0x02 || privkey[1] != 0x01 || privkey[2] != 0x01) {
- return 0;
- }
- privkey += 3;
- /* sequence element 1: octet string, up to 32 bytes */
- if (end < privkey+2 || privkey[0] != 0x04 || privkey[1] > 0x20 || end < privkey+2+privkey[1]) {
- return 0;
- }
- memcpy(out32 + 32 - privkey[1], privkey + 2, privkey[1]);
- if (!secp256k1_ec_seckey_verify(ctx, out32)) {
- memset(out32, 0, 32);
- return 0;
- }
- return 1;
-}
-
-int ec_privkey_export_der(const secp256k1_context *ctx, unsigned char *privkey, size_t *privkeylen, const unsigned char *key32, int compressed) {
- secp256k1_pubkey pubkey;
- size_t pubkeylen = 0;
- if (!secp256k1_ec_pubkey_create(ctx, &pubkey, key32)) {
- *privkeylen = 0;
- return 0;
- }
- if (compressed) {
- static const unsigned char begin[] = {
- 0x30,0x81,0xD3,0x02,0x01,0x01,0x04,0x20
- };
- static const unsigned char middle[] = {
- 0xA0,0x81,0x85,0x30,0x81,0x82,0x02,0x01,0x01,0x30,0x2C,0x06,0x07,0x2A,0x86,0x48,
- 0xCE,0x3D,0x01,0x01,0x02,0x21,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
- 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
- 0xFF,0xFF,0xFE,0xFF,0xFF,0xFC,0x2F,0x30,0x06,0x04,0x01,0x00,0x04,0x01,0x07,0x04,
- 0x21,0x02,0x79,0xBE,0x66,0x7E,0xF9,0xDC,0xBB,0xAC,0x55,0xA0,0x62,0x95,0xCE,0x87,
- 0x0B,0x07,0x02,0x9B,0xFC,0xDB,0x2D,0xCE,0x28,0xD9,0x59,0xF2,0x81,0x5B,0x16,0xF8,
- 0x17,0x98,0x02,0x21,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
- 0xFF,0xFF,0xFF,0xFF,0xFE,0xBA,0xAE,0xDC,0xE6,0xAF,0x48,0xA0,0x3B,0xBF,0xD2,0x5E,
- 0x8C,0xD0,0x36,0x41,0x41,0x02,0x01,0x01,0xA1,0x24,0x03,0x22,0x00
- };
- unsigned char *ptr = privkey;
- memcpy(ptr, begin, sizeof(begin)); ptr += sizeof(begin);
- memcpy(ptr, key32, 32); ptr += 32;
- memcpy(ptr, middle, sizeof(middle)); ptr += sizeof(middle);
- pubkeylen = 33;
- secp256k1_ec_pubkey_serialize(ctx, ptr, &pubkeylen, &pubkey, SECP256K1_EC_COMPRESSED);
- ptr += pubkeylen;
- *privkeylen = ptr - privkey;
- } else {
- static const unsigned char begin[] = {
- 0x30,0x82,0x01,0x13,0x02,0x01,0x01,0x04,0x20
- };
- static const unsigned char middle[] = {
- 0xA0,0x81,0xA5,0x30,0x81,0xA2,0x02,0x01,0x01,0x30,0x2C,0x06,0x07,0x2A,0x86,0x48,
- 0xCE,0x3D,0x01,0x01,0x02,0x21,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
- 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
- 0xFF,0xFF,0xFE,0xFF,0xFF,0xFC,0x2F,0x30,0x06,0x04,0x01,0x00,0x04,0x01,0x07,0x04,
- 0x41,0x04,0x79,0xBE,0x66,0x7E,0xF9,0xDC,0xBB,0xAC,0x55,0xA0,0x62,0x95,0xCE,0x87,
- 0x0B,0x07,0x02,0x9B,0xFC,0xDB,0x2D,0xCE,0x28,0xD9,0x59,0xF2,0x81,0x5B,0x16,0xF8,
- 0x17,0x98,0x48,0x3A,0xDA,0x77,0x26,0xA3,0xC4,0x65,0x5D,0xA4,0xFB,0xFC,0x0E,0x11,
- 0x08,0xA8,0xFD,0x17,0xB4,0x48,0xA6,0x85,0x54,0x19,0x9C,0x47,0xD0,0x8F,0xFB,0x10,
- 0xD4,0xB8,0x02,0x21,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
- 0xFF,0xFF,0xFF,0xFF,0xFE,0xBA,0xAE,0xDC,0xE6,0xAF,0x48,0xA0,0x3B,0xBF,0xD2,0x5E,
- 0x8C,0xD0,0x36,0x41,0x41,0x02,0x01,0x01,0xA1,0x44,0x03,0x42,0x00
- };
- unsigned char *ptr = privkey;
- memcpy(ptr, begin, sizeof(begin)); ptr += sizeof(begin);
- memcpy(ptr, key32, 32); ptr += 32;
- memcpy(ptr, middle, sizeof(middle)); ptr += sizeof(middle);
- pubkeylen = 65;
- secp256k1_ec_pubkey_serialize(ctx, ptr, &pubkeylen, &pubkey, SECP256K1_EC_UNCOMPRESSED);
- ptr += pubkeylen;
- *privkeylen = ptr - privkey;
- }
- return 1;
-}
diff --git a/vendor/github.com/ethereum/go-ethereum/crypto/secp256k1/libsecp256k1/contrib/lax_der_privatekey_parsing.h b/vendor/github.com/ethereum/go-ethereum/crypto/secp256k1/libsecp256k1/contrib/lax_der_privatekey_parsing.h
deleted file mode 100644
index 2fd088f8a..000000000
--- a/vendor/github.com/ethereum/go-ethereum/crypto/secp256k1/libsecp256k1/contrib/lax_der_privatekey_parsing.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2014, 2015 Pieter Wuille *
- * Distributed under the MIT software license, see the accompanying *
- * file COPYING or http://www.opensource.org/licenses/mit-license.php.*
- **********************************************************************/
-
-/****
- * Please do not link this file directly. It is not part of the libsecp256k1
- * project and does not promise any stability in its API, functionality or
- * presence. Projects which use this code should instead copy this header
- * and its accompanying .c file directly into their codebase.
- ****/
-
-/* This file contains code snippets that parse DER private keys with
- * various errors and violations. This is not a part of the library
- * itself, because the allowed violations are chosen arbitrarily and
- * do not follow or establish any standard.
- *
- * It also contains code to serialize private keys in a compatible
- * manner.
- *
- * These functions are meant for compatibility with applications
- * that require BER encoded keys. When working with secp256k1-specific
- * code, the simple 32-byte private keys normally used by the
- * library are sufficient.
- */
-
-#ifndef _SECP256K1_CONTRIB_BER_PRIVATEKEY_H_
-#define _SECP256K1_CONTRIB_BER_PRIVATEKEY_H_
-
-#include
-
-# ifdef __cplusplus
-extern "C" {
-# endif
-
-/** Export a private key in DER format.
- *
- * Returns: 1 if the private key was valid.
- * Args: ctx: pointer to a context object, initialized for signing (cannot
- * be NULL)
- * Out: privkey: pointer to an array for storing the private key in BER.
- * Should have space for 279 bytes, and cannot be NULL.
- * privkeylen: Pointer to an int where the length of the private key in
- * privkey will be stored.
- * In: seckey: pointer to a 32-byte secret key to export.
- * compressed: 1 if the key should be exported in
- * compressed format, 0 otherwise
- *
- * This function is purely meant for compatibility with applications that
- * require BER encoded keys. When working with secp256k1-specific code, the
- * simple 32-byte private keys are sufficient.
- *
- * Note that this function does not guarantee correct DER output. It is
- * guaranteed to be parsable by secp256k1_ec_privkey_import_der
- */
-SECP256K1_WARN_UNUSED_RESULT int ec_privkey_export_der(
- const secp256k1_context* ctx,
- unsigned char *privkey,
- size_t *privkeylen,
- const unsigned char *seckey,
- int compressed
-) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4);
-
-/** Import a private key in DER format.
- * Returns: 1 if a private key was extracted.
- * Args: ctx: pointer to a context object (cannot be NULL).
- * Out: seckey: pointer to a 32-byte array for storing the private key.
- * (cannot be NULL).
- * In: privkey: pointer to a private key in DER format (cannot be NULL).
- * privkeylen: length of the DER private key pointed to be privkey.
- *
- * This function will accept more than just strict DER, and even allow some BER
- * violations. The public key stored inside the DER-encoded private key is not
- * verified for correctness, nor are the curve parameters. Use this function
- * only if you know in advance it is supposed to contain a secp256k1 private
- * key.
- */
-SECP256K1_WARN_UNUSED_RESULT int ec_privkey_import_der(
- const secp256k1_context* ctx,
- unsigned char *seckey,
- const unsigned char *privkey,
- size_t privkeylen
-) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/vendor/github.com/ethereum/go-ethereum/crypto/secp256k1/libsecp256k1/src/java/org_bitcoin_NativeSecp256k1.c b/vendor/github.com/ethereum/go-ethereum/crypto/secp256k1/libsecp256k1/src/java/org_bitcoin_NativeSecp256k1.c
deleted file mode 100644
index bcef7b32c..000000000
--- a/vendor/github.com/ethereum/go-ethereum/crypto/secp256k1/libsecp256k1/src/java/org_bitcoin_NativeSecp256k1.c
+++ /dev/null
@@ -1,377 +0,0 @@
-#include
-#include
-#include
-#include "org_bitcoin_NativeSecp256k1.h"
-#include "include/secp256k1.h"
-#include "include/secp256k1_ecdh.h"
-#include "include/secp256k1_recovery.h"
-
-
-SECP256K1_API jlong JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1ctx_1clone
- (JNIEnv* env, jclass classObject, jlong ctx_l)
-{
- const secp256k1_context *ctx = (secp256k1_context*)(uintptr_t)ctx_l;
-
- jlong ctx_clone_l = (uintptr_t) secp256k1_context_clone(ctx);
-
- (void)classObject;(void)env;
-
- return ctx_clone_l;
-
-}
-
-SECP256K1_API jint JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1context_1randomize
- (JNIEnv* env, jclass classObject, jobject byteBufferObject, jlong ctx_l)
-{
- secp256k1_context *ctx = (secp256k1_context*)(uintptr_t)ctx_l;
-
- const unsigned char* seed = (unsigned char*) (*env)->GetDirectBufferAddress(env, byteBufferObject);
-
- (void)classObject;
-
- return secp256k1_context_randomize(ctx, seed);
-
-}
-
-SECP256K1_API void JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1destroy_1context
- (JNIEnv* env, jclass classObject, jlong ctx_l)
-{
- secp256k1_context *ctx = (secp256k1_context*)(uintptr_t)ctx_l;
-
- secp256k1_context_destroy(ctx);
-
- (void)classObject;(void)env;
-}
-
-SECP256K1_API jint JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1ecdsa_1verify
- (JNIEnv* env, jclass classObject, jobject byteBufferObject, jlong ctx_l, jint siglen, jint publen)
-{
- secp256k1_context *ctx = (secp256k1_context*)(uintptr_t)ctx_l;
-
- unsigned char* data = (unsigned char*) (*env)->GetDirectBufferAddress(env, byteBufferObject);
- const unsigned char* sigdata = { (unsigned char*) (data + 32) };
- const unsigned char* pubdata = { (unsigned char*) (data + siglen + 32) };
-
- secp256k1_ecdsa_signature sig;
- secp256k1_pubkey pubkey;
-
- int ret = secp256k1_ecdsa_signature_parse_der(ctx, &sig, sigdata, siglen);
-
- if( ret ) {
- ret = secp256k1_ec_pubkey_parse(ctx, &pubkey, pubdata, publen);
-
- if( ret ) {
- ret = secp256k1_ecdsa_verify(ctx, &sig, data, &pubkey);
- }
- }
-
- (void)classObject;
-
- return ret;
-}
-
-SECP256K1_API jobjectArray JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1ecdsa_1sign
- (JNIEnv* env, jclass classObject, jobject byteBufferObject, jlong ctx_l)
-{
- secp256k1_context *ctx = (secp256k1_context*)(uintptr_t)ctx_l;
- unsigned char* data = (unsigned char*) (*env)->GetDirectBufferAddress(env, byteBufferObject);
- unsigned char* secKey = (unsigned char*) (data + 32);
-
- jobjectArray retArray;
- jbyteArray sigArray, intsByteArray;
- unsigned char intsarray[2];
-
- secp256k1_ecdsa_signature sig[72];
-
- int ret = secp256k1_ecdsa_sign(ctx, sig, data, secKey, NULL, NULL );
-
- unsigned char outputSer[72];
- size_t outputLen = 72;
-
- if( ret ) {
- int ret2 = secp256k1_ecdsa_signature_serialize_der(ctx,outputSer, &outputLen, sig ); (void)ret2;
- }
-
- intsarray[0] = outputLen;
- intsarray[1] = ret;
-
- retArray = (*env)->NewObjectArray(env, 2,
- (*env)->FindClass(env, "[B"),
- (*env)->NewByteArray(env, 1));
-
- sigArray = (*env)->NewByteArray(env, outputLen);
- (*env)->SetByteArrayRegion(env, sigArray, 0, outputLen, (jbyte*)outputSer);
- (*env)->SetObjectArrayElement(env, retArray, 0, sigArray);
-
- intsByteArray = (*env)->NewByteArray(env, 2);
- (*env)->SetByteArrayRegion(env, intsByteArray, 0, 2, (jbyte*)intsarray);
- (*env)->SetObjectArrayElement(env, retArray, 1, intsByteArray);
-
- (void)classObject;
-
- return retArray;
-}
-
-SECP256K1_API jint JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1ec_1seckey_1verify
- (JNIEnv* env, jclass classObject, jobject byteBufferObject, jlong ctx_l)
-{
- secp256k1_context *ctx = (secp256k1_context*)(uintptr_t)ctx_l;
- unsigned char* secKey = (unsigned char*) (*env)->GetDirectBufferAddress(env, byteBufferObject);
-
- (void)classObject;
-
- return secp256k1_ec_seckey_verify(ctx, secKey);
-}
-
-SECP256K1_API jobjectArray JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1ec_1pubkey_1create
- (JNIEnv* env, jclass classObject, jobject byteBufferObject, jlong ctx_l)
-{
- secp256k1_context *ctx = (secp256k1_context*)(uintptr_t)ctx_l;
- const unsigned char* secKey = (unsigned char*) (*env)->GetDirectBufferAddress(env, byteBufferObject);
-
- secp256k1_pubkey pubkey;
-
- jobjectArray retArray;
- jbyteArray pubkeyArray, intsByteArray;
- unsigned char intsarray[2];
-
- int ret = secp256k1_ec_pubkey_create(ctx, &pubkey, secKey);
-
- unsigned char outputSer[65];
- size_t outputLen = 65;
-
- if( ret ) {
- int ret2 = secp256k1_ec_pubkey_serialize(ctx,outputSer, &outputLen, &pubkey,SECP256K1_EC_UNCOMPRESSED );(void)ret2;
- }
-
- intsarray[0] = outputLen;
- intsarray[1] = ret;
-
- retArray = (*env)->NewObjectArray(env, 2,
- (*env)->FindClass(env, "[B"),
- (*env)->NewByteArray(env, 1));
-
- pubkeyArray = (*env)->NewByteArray(env, outputLen);
- (*env)->SetByteArrayRegion(env, pubkeyArray, 0, outputLen, (jbyte*)outputSer);
- (*env)->SetObjectArrayElement(env, retArray, 0, pubkeyArray);
-
- intsByteArray = (*env)->NewByteArray(env, 2);
- (*env)->SetByteArrayRegion(env, intsByteArray, 0, 2, (jbyte*)intsarray);
- (*env)->SetObjectArrayElement(env, retArray, 1, intsByteArray);
-
- (void)classObject;
-
- return retArray;
-
-}
-
-SECP256K1_API jobjectArray JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1privkey_1tweak_1add
- (JNIEnv* env, jclass classObject, jobject byteBufferObject, jlong ctx_l)
-{
- secp256k1_context *ctx = (secp256k1_context*)(uintptr_t)ctx_l;
- unsigned char* privkey = (unsigned char*) (*env)->GetDirectBufferAddress(env, byteBufferObject);
- const unsigned char* tweak = (unsigned char*) (privkey + 32);
-
- jobjectArray retArray;
- jbyteArray privArray, intsByteArray;
- unsigned char intsarray[2];
-
- int privkeylen = 32;
-
- int ret = secp256k1_ec_privkey_tweak_add(ctx, privkey, tweak);
-
- intsarray[0] = privkeylen;
- intsarray[1] = ret;
-
- retArray = (*env)->NewObjectArray(env, 2,
- (*env)->FindClass(env, "[B"),
- (*env)->NewByteArray(env, 1));
-
- privArray = (*env)->NewByteArray(env, privkeylen);
- (*env)->SetByteArrayRegion(env, privArray, 0, privkeylen, (jbyte*)privkey);
- (*env)->SetObjectArrayElement(env, retArray, 0, privArray);
-
- intsByteArray = (*env)->NewByteArray(env, 2);
- (*env)->SetByteArrayRegion(env, intsByteArray, 0, 2, (jbyte*)intsarray);
- (*env)->SetObjectArrayElement(env, retArray, 1, intsByteArray);
-
- (void)classObject;
-
- return retArray;
-}
-
-SECP256K1_API jobjectArray JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1privkey_1tweak_1mul
- (JNIEnv* env, jclass classObject, jobject byteBufferObject, jlong ctx_l)
-{
- secp256k1_context *ctx = (secp256k1_context*)(uintptr_t)ctx_l;
- unsigned char* privkey = (unsigned char*) (*env)->GetDirectBufferAddress(env, byteBufferObject);
- const unsigned char* tweak = (unsigned char*) (privkey + 32);
-
- jobjectArray retArray;
- jbyteArray privArray, intsByteArray;
- unsigned char intsarray[2];
-
- int privkeylen = 32;
-
- int ret = secp256k1_ec_privkey_tweak_mul(ctx, privkey, tweak);
-
- intsarray[0] = privkeylen;
- intsarray[1] = ret;
-
- retArray = (*env)->NewObjectArray(env, 2,
- (*env)->FindClass(env, "[B"),
- (*env)->NewByteArray(env, 1));
-
- privArray = (*env)->NewByteArray(env, privkeylen);
- (*env)->SetByteArrayRegion(env, privArray, 0, privkeylen, (jbyte*)privkey);
- (*env)->SetObjectArrayElement(env, retArray, 0, privArray);
-
- intsByteArray = (*env)->NewByteArray(env, 2);
- (*env)->SetByteArrayRegion(env, intsByteArray, 0, 2, (jbyte*)intsarray);
- (*env)->SetObjectArrayElement(env, retArray, 1, intsByteArray);
-
- (void)classObject;
-
- return retArray;
-}
-
-SECP256K1_API jobjectArray JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1pubkey_1tweak_1add
- (JNIEnv* env, jclass classObject, jobject byteBufferObject, jlong ctx_l, jint publen)
-{
- secp256k1_context *ctx = (secp256k1_context*)(uintptr_t)ctx_l;
-/* secp256k1_pubkey* pubkey = (secp256k1_pubkey*) (*env)->GetDirectBufferAddress(env, byteBufferObject);*/
- unsigned char* pkey = (*env)->GetDirectBufferAddress(env, byteBufferObject);
- const unsigned char* tweak = (unsigned char*) (pkey + publen);
-
- jobjectArray retArray;
- jbyteArray pubArray, intsByteArray;
- unsigned char intsarray[2];
- unsigned char outputSer[65];
- size_t outputLen = 65;
-
- secp256k1_pubkey pubkey;
- int ret = secp256k1_ec_pubkey_parse(ctx, &pubkey, pkey, publen);
-
- if( ret ) {
- ret = secp256k1_ec_pubkey_tweak_add(ctx, &pubkey, tweak);
- }
-
- if( ret ) {
- int ret2 = secp256k1_ec_pubkey_serialize(ctx,outputSer, &outputLen, &pubkey,SECP256K1_EC_UNCOMPRESSED );(void)ret2;
- }
-
- intsarray[0] = outputLen;
- intsarray[1] = ret;
-
- retArray = (*env)->NewObjectArray(env, 2,
- (*env)->FindClass(env, "[B"),
- (*env)->NewByteArray(env, 1));
-
- pubArray = (*env)->NewByteArray(env, outputLen);
- (*env)->SetByteArrayRegion(env, pubArray, 0, outputLen, (jbyte*)outputSer);
- (*env)->SetObjectArrayElement(env, retArray, 0, pubArray);
-
- intsByteArray = (*env)->NewByteArray(env, 2);
- (*env)->SetByteArrayRegion(env, intsByteArray, 0, 2, (jbyte*)intsarray);
- (*env)->SetObjectArrayElement(env, retArray, 1, intsByteArray);
-
- (void)classObject;
-
- return retArray;
-}
-
-SECP256K1_API jobjectArray JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1pubkey_1tweak_1mul
- (JNIEnv* env, jclass classObject, jobject byteBufferObject, jlong ctx_l, jint publen)
-{
- secp256k1_context *ctx = (secp256k1_context*)(uintptr_t)ctx_l;
- unsigned char* pkey = (*env)->GetDirectBufferAddress(env, byteBufferObject);
- const unsigned char* tweak = (unsigned char*) (pkey + publen);
-
- jobjectArray retArray;
- jbyteArray pubArray, intsByteArray;
- unsigned char intsarray[2];
- unsigned char outputSer[65];
- size_t outputLen = 65;
-
- secp256k1_pubkey pubkey;
- int ret = secp256k1_ec_pubkey_parse(ctx, &pubkey, pkey, publen);
-
- if ( ret ) {
- ret = secp256k1_ec_pubkey_tweak_mul(ctx, &pubkey, tweak);
- }
-
- if( ret ) {
- int ret2 = secp256k1_ec_pubkey_serialize(ctx,outputSer, &outputLen, &pubkey,SECP256K1_EC_UNCOMPRESSED );(void)ret2;
- }
-
- intsarray[0] = outputLen;
- intsarray[1] = ret;
-
- retArray = (*env)->NewObjectArray(env, 2,
- (*env)->FindClass(env, "[B"),
- (*env)->NewByteArray(env, 1));
-
- pubArray = (*env)->NewByteArray(env, outputLen);
- (*env)->SetByteArrayRegion(env, pubArray, 0, outputLen, (jbyte*)outputSer);
- (*env)->SetObjectArrayElement(env, retArray, 0, pubArray);
-
- intsByteArray = (*env)->NewByteArray(env, 2);
- (*env)->SetByteArrayRegion(env, intsByteArray, 0, 2, (jbyte*)intsarray);
- (*env)->SetObjectArrayElement(env, retArray, 1, intsByteArray);
-
- (void)classObject;
-
- return retArray;
-}
-
-SECP256K1_API jlong JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1ecdsa_1pubkey_1combine
- (JNIEnv * env, jclass classObject, jobject byteBufferObject, jlong ctx_l, jint numkeys)
-{
- (void)classObject;(void)env;(void)byteBufferObject;(void)ctx_l;(void)numkeys;
-
- return 0;
-}
-
-SECP256K1_API jobjectArray JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1ecdh
- (JNIEnv* env, jclass classObject, jobject byteBufferObject, jlong ctx_l, jint publen)
-{
- secp256k1_context *ctx = (secp256k1_context*)(uintptr_t)ctx_l;
- const unsigned char* secdata = (*env)->GetDirectBufferAddress(env, byteBufferObject);
- const unsigned char* pubdata = (const unsigned char*) (secdata + 32);
-
- jobjectArray retArray;
- jbyteArray outArray, intsByteArray;
- unsigned char intsarray[1];
- secp256k1_pubkey pubkey;
- unsigned char nonce_res[32];
- size_t outputLen = 32;
-
- int ret = secp256k1_ec_pubkey_parse(ctx, &pubkey, pubdata, publen);
-
- if (ret) {
- ret = secp256k1_ecdh(
- ctx,
- nonce_res,
- &pubkey,
- secdata
- );
- }
-
- intsarray[0] = ret;
-
- retArray = (*env)->NewObjectArray(env, 2,
- (*env)->FindClass(env, "[B"),
- (*env)->NewByteArray(env, 1));
-
- outArray = (*env)->NewByteArray(env, outputLen);
- (*env)->SetByteArrayRegion(env, outArray, 0, 32, (jbyte*)nonce_res);
- (*env)->SetObjectArrayElement(env, retArray, 0, outArray);
-
- intsByteArray = (*env)->NewByteArray(env, 1);
- (*env)->SetByteArrayRegion(env, intsByteArray, 0, 1, (jbyte*)intsarray);
- (*env)->SetObjectArrayElement(env, retArray, 1, intsByteArray);
-
- (void)classObject;
-
- return retArray;
-}
diff --git a/vendor/github.com/ethereum/go-ethereum/crypto/secp256k1/libsecp256k1/src/java/org_bitcoin_NativeSecp256k1.h b/vendor/github.com/ethereum/go-ethereum/crypto/secp256k1/libsecp256k1/src/java/org_bitcoin_NativeSecp256k1.h
deleted file mode 100644
index fe613c9e9..000000000
--- a/vendor/github.com/ethereum/go-ethereum/crypto/secp256k1/libsecp256k1/src/java/org_bitcoin_NativeSecp256k1.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/* DO NOT EDIT THIS FILE - it is machine generated */
-#include
-#include "include/secp256k1.h"
-/* Header for class org_bitcoin_NativeSecp256k1 */
-
-#ifndef _Included_org_bitcoin_NativeSecp256k1
-#define _Included_org_bitcoin_NativeSecp256k1
-#ifdef __cplusplus
-extern "C" {
-#endif
-/*
- * Class: org_bitcoin_NativeSecp256k1
- * Method: secp256k1_ctx_clone
- * Signature: (J)J
- */
-SECP256K1_API jlong JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1ctx_1clone
- (JNIEnv *, jclass, jlong);
-
-/*
- * Class: org_bitcoin_NativeSecp256k1
- * Method: secp256k1_context_randomize
- * Signature: (Ljava/nio/ByteBuffer;J)I
- */
-SECP256K1_API jint JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1context_1randomize
- (JNIEnv *, jclass, jobject, jlong);
-
-/*
- * Class: org_bitcoin_NativeSecp256k1
- * Method: secp256k1_privkey_tweak_add
- * Signature: (Ljava/nio/ByteBuffer;J)[[B
- */
-SECP256K1_API jobjectArray JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1privkey_1tweak_1add
- (JNIEnv *, jclass, jobject, jlong);
-
-/*
- * Class: org_bitcoin_NativeSecp256k1
- * Method: secp256k1_privkey_tweak_mul
- * Signature: (Ljava/nio/ByteBuffer;J)[[B
- */
-SECP256K1_API jobjectArray JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1privkey_1tweak_1mul
- (JNIEnv *, jclass, jobject, jlong);
-
-/*
- * Class: org_bitcoin_NativeSecp256k1
- * Method: secp256k1_pubkey_tweak_add
- * Signature: (Ljava/nio/ByteBuffer;JI)[[B
- */
-SECP256K1_API jobjectArray JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1pubkey_1tweak_1add
- (JNIEnv *, jclass, jobject, jlong, jint);
-
-/*
- * Class: org_bitcoin_NativeSecp256k1
- * Method: secp256k1_pubkey_tweak_mul
- * Signature: (Ljava/nio/ByteBuffer;JI)[[B
- */
-SECP256K1_API jobjectArray JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1pubkey_1tweak_1mul
- (JNIEnv *, jclass, jobject, jlong, jint);
-
-/*
- * Class: org_bitcoin_NativeSecp256k1
- * Method: secp256k1_destroy_context
- * Signature: (J)V
- */
-SECP256K1_API void JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1destroy_1context
- (JNIEnv *, jclass, jlong);
-
-/*
- * Class: org_bitcoin_NativeSecp256k1
- * Method: secp256k1_ecdsa_verify
- * Signature: (Ljava/nio/ByteBuffer;JII)I
- */
-SECP256K1_API jint JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1ecdsa_1verify
- (JNIEnv *, jclass, jobject, jlong, jint, jint);
-
-/*
- * Class: org_bitcoin_NativeSecp256k1
- * Method: secp256k1_ecdsa_sign
- * Signature: (Ljava/nio/ByteBuffer;J)[[B
- */
-SECP256K1_API jobjectArray JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1ecdsa_1sign
- (JNIEnv *, jclass, jobject, jlong);
-
-/*
- * Class: org_bitcoin_NativeSecp256k1
- * Method: secp256k1_ec_seckey_verify
- * Signature: (Ljava/nio/ByteBuffer;J)I
- */
-SECP256K1_API jint JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1ec_1seckey_1verify
- (JNIEnv *, jclass, jobject, jlong);
-
-/*
- * Class: org_bitcoin_NativeSecp256k1
- * Method: secp256k1_ec_pubkey_create
- * Signature: (Ljava/nio/ByteBuffer;J)[[B
- */
-SECP256K1_API jobjectArray JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1ec_1pubkey_1create
- (JNIEnv *, jclass, jobject, jlong);
-
-/*
- * Class: org_bitcoin_NativeSecp256k1
- * Method: secp256k1_ec_pubkey_parse
- * Signature: (Ljava/nio/ByteBuffer;JI)[[B
- */
-SECP256K1_API jobjectArray JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1ec_1pubkey_1parse
- (JNIEnv *, jclass, jobject, jlong, jint);
-
-/*
- * Class: org_bitcoin_NativeSecp256k1
- * Method: secp256k1_ecdh
- * Signature: (Ljava/nio/ByteBuffer;JI)[[B
- */
-SECP256K1_API jobjectArray JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1ecdh
- (JNIEnv* env, jclass classObject, jobject byteBufferObject, jlong ctx_l, jint publen);
-
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/vendor/github.com/ethereum/go-ethereum/crypto/secp256k1/libsecp256k1/src/java/org_bitcoin_Secp256k1Context.c b/vendor/github.com/ethereum/go-ethereum/crypto/secp256k1/libsecp256k1/src/java/org_bitcoin_Secp256k1Context.c
deleted file mode 100644
index a52939e7e..000000000
--- a/vendor/github.com/ethereum/go-ethereum/crypto/secp256k1/libsecp256k1/src/java/org_bitcoin_Secp256k1Context.c
+++ /dev/null
@@ -1,15 +0,0 @@
-#include
-#include
-#include "org_bitcoin_Secp256k1Context.h"
-#include "include/secp256k1.h"
-
-SECP256K1_API jlong JNICALL Java_org_bitcoin_Secp256k1Context_secp256k1_1init_1context
- (JNIEnv* env, jclass classObject)
-{
- secp256k1_context *ctx = secp256k1_context_create(SECP256K1_CONTEXT_SIGN | SECP256K1_CONTEXT_VERIFY);
-
- (void)classObject;(void)env;
-
- return (uintptr_t)ctx;
-}
-
diff --git a/vendor/github.com/ethereum/go-ethereum/crypto/secp256k1/libsecp256k1/src/java/org_bitcoin_Secp256k1Context.h b/vendor/github.com/ethereum/go-ethereum/crypto/secp256k1/libsecp256k1/src/java/org_bitcoin_Secp256k1Context.h
deleted file mode 100644
index 0d2bc84b7..000000000
--- a/vendor/github.com/ethereum/go-ethereum/crypto/secp256k1/libsecp256k1/src/java/org_bitcoin_Secp256k1Context.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/* DO NOT EDIT THIS FILE - it is machine generated */
-#include
-#include "include/secp256k1.h"
-/* Header for class org_bitcoin_Secp256k1Context */
-
-#ifndef _Included_org_bitcoin_Secp256k1Context
-#define _Included_org_bitcoin_Secp256k1Context
-#ifdef __cplusplus
-extern "C" {
-#endif
-/*
- * Class: org_bitcoin_Secp256k1Context
- * Method: secp256k1_init_context
- * Signature: ()J
- */
-SECP256K1_API jlong JNICALL Java_org_bitcoin_Secp256k1Context_secp256k1_1init_1context
- (JNIEnv *, jclass);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/vendor/github.com/ethereum/go-ethereum/crypto/secp256k1/libsecp256k1/src/modules/ecdh/main_impl.h b/vendor/github.com/ethereum/go-ethereum/crypto/secp256k1/libsecp256k1/src/modules/ecdh/main_impl.h
deleted file mode 100644
index 9e30fb73d..000000000
--- a/vendor/github.com/ethereum/go-ethereum/crypto/secp256k1/libsecp256k1/src/modules/ecdh/main_impl.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2015 Andrew Poelstra *
- * Distributed under the MIT software license, see the accompanying *
- * file COPYING or http://www.opensource.org/licenses/mit-license.php.*
- **********************************************************************/
-
-#ifndef _SECP256K1_MODULE_ECDH_MAIN_
-#define _SECP256K1_MODULE_ECDH_MAIN_
-
-#include "include/secp256k1_ecdh.h"
-#include "ecmult_const_impl.h"
-
-int secp256k1_ecdh(const secp256k1_context* ctx, unsigned char *result, const secp256k1_pubkey *point, const unsigned char *scalar) {
- int ret = 0;
- int overflow = 0;
- secp256k1_gej res;
- secp256k1_ge pt;
- secp256k1_scalar s;
- VERIFY_CHECK(ctx != NULL);
- ARG_CHECK(result != NULL);
- ARG_CHECK(point != NULL);
- ARG_CHECK(scalar != NULL);
-
- secp256k1_pubkey_load(ctx, &pt, point);
- secp256k1_scalar_set_b32(&s, scalar, &overflow);
- if (overflow || secp256k1_scalar_is_zero(&s)) {
- ret = 0;
- } else {
- unsigned char x[32];
- unsigned char y[1];
- secp256k1_sha256_t sha;
-
- secp256k1_ecmult_const(&res, &pt, &s);
- secp256k1_ge_set_gej(&pt, &res);
- /* Compute a hash of the point in compressed form
- * Note we cannot use secp256k1_eckey_pubkey_serialize here since it does not
- * expect its output to be secret and has a timing sidechannel. */
- secp256k1_fe_normalize(&pt.x);
- secp256k1_fe_normalize(&pt.y);
- secp256k1_fe_get_b32(x, &pt.x);
- y[0] = 0x02 | secp256k1_fe_is_odd(&pt.y);
-
- secp256k1_sha256_initialize(&sha);
- secp256k1_sha256_write(&sha, y, sizeof(y));
- secp256k1_sha256_write(&sha, x, sizeof(x));
- secp256k1_sha256_finalize(&sha, result);
- ret = 1;
- }
-
- secp256k1_scalar_clear(&s);
- return ret;
-}
-
-#endif
diff --git a/vendor/github.com/ethereum/go-ethereum/crypto/secp256k1/libsecp256k1/src/modules/ecdh/tests_impl.h b/vendor/github.com/ethereum/go-ethereum/crypto/secp256k1/libsecp256k1/src/modules/ecdh/tests_impl.h
deleted file mode 100644
index 85a5d0a9a..000000000
--- a/vendor/github.com/ethereum/go-ethereum/crypto/secp256k1/libsecp256k1/src/modules/ecdh/tests_impl.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/**********************************************************************
- * Copyright (c) 2015 Andrew Poelstra *
- * Distributed under the MIT software license, see the accompanying *
- * file COPYING or http://www.opensource.org/licenses/mit-license.php.*
- **********************************************************************/
-
-#ifndef _SECP256K1_MODULE_ECDH_TESTS_
-#define _SECP256K1_MODULE_ECDH_TESTS_
-
-void test_ecdh_api(void) {
- /* Setup context that just counts errors */
- secp256k1_context *tctx = secp256k1_context_create(SECP256K1_CONTEXT_SIGN);
- secp256k1_pubkey point;
- unsigned char res[32];
- unsigned char s_one[32] = { 0 };
- int32_t ecount = 0;
- s_one[31] = 1;
-
- secp256k1_context_set_error_callback(tctx, counting_illegal_callback_fn, &ecount);
- secp256k1_context_set_illegal_callback(tctx, counting_illegal_callback_fn, &ecount);
- CHECK(secp256k1_ec_pubkey_create(tctx, &point, s_one) == 1);
-
- /* Check all NULLs are detected */
- CHECK(secp256k1_ecdh(tctx, res, &point, s_one) == 1);
- CHECK(ecount == 0);
- CHECK(secp256k1_ecdh(tctx, NULL, &point, s_one) == 0);
- CHECK(ecount == 1);
- CHECK(secp256k1_ecdh(tctx, res, NULL, s_one) == 0);
- CHECK(ecount == 2);
- CHECK(secp256k1_ecdh(tctx, res, &point, NULL) == 0);
- CHECK(ecount == 3);
- CHECK(secp256k1_ecdh(tctx, res, &point, s_one) == 1);
- CHECK(ecount == 3);
-
- /* Cleanup */
- secp256k1_context_destroy(tctx);
-}
-
-void test_ecdh_generator_basepoint(void) {
- unsigned char s_one[32] = { 0 };
- secp256k1_pubkey point[2];
- int i;
-
- s_one[31] = 1;
- /* Check against pubkey creation when the basepoint is the generator */
- for (i = 0; i < 100; ++i) {
- secp256k1_sha256_t sha;
- unsigned char s_b32[32];
- unsigned char output_ecdh[32];
- unsigned char output_ser[32];
- unsigned char point_ser[33];
- size_t point_ser_len = sizeof(point_ser);
- secp256k1_scalar s;
-
- random_scalar_order(&s);
- secp256k1_scalar_get_b32(s_b32, &s);
-
- /* compute using ECDH function */
- CHECK(secp256k1_ec_pubkey_create(ctx, &point[0], s_one) == 1);
- CHECK(secp256k1_ecdh(ctx, output_ecdh, &point[0], s_b32) == 1);
- /* compute "explicitly" */
- CHECK(secp256k1_ec_pubkey_create(ctx, &point[1], s_b32) == 1);
- CHECK(secp256k1_ec_pubkey_serialize(ctx, point_ser, &point_ser_len, &point[1], SECP256K1_EC_COMPRESSED) == 1);
- CHECK(point_ser_len == sizeof(point_ser));
- secp256k1_sha256_initialize(&sha);
- secp256k1_sha256_write(&sha, point_ser, point_ser_len);
- secp256k1_sha256_finalize(&sha, output_ser);
- /* compare */
- CHECK(memcmp(output_ecdh, output_ser, sizeof(output_ser)) == 0);
- }
-}
-
-void test_bad_scalar(void) {
- unsigned char s_zero[32] = { 0 };
- unsigned char s_overflow[32] = {
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe,
- 0xba, 0xae, 0xdc, 0xe6, 0xaf, 0x48, 0xa0, 0x3b,
- 0xbf, 0xd2, 0x5e, 0x8c, 0xd0, 0x36, 0x41, 0x41
- };
- unsigned char s_rand[32] = { 0 };
- unsigned char output[32];
- secp256k1_scalar rand;
- secp256k1_pubkey point;
-
- /* Create random point */
- random_scalar_order(&rand);
- secp256k1_scalar_get_b32(s_rand, &rand);
- CHECK(secp256k1_ec_pubkey_create(ctx, &point, s_rand) == 1);
-
- /* Try to multiply it by bad values */
- CHECK(secp256k1_ecdh(ctx, output, &point, s_zero) == 0);
- CHECK(secp256k1_ecdh(ctx, output, &point, s_overflow) == 0);
- /* ...and a good one */
- s_overflow[31] -= 1;
- CHECK(secp256k1_ecdh(ctx, output, &point, s_overflow) == 1);
-}
-
-void run_ecdh_tests(void) {
- test_ecdh_api();
- test_ecdh_generator_basepoint();
- test_bad_scalar();
-}
-
-#endif
diff --git a/vendor/github.com/mutecomm/go-sqlcipher/v4/_example/mod_regexp/sqlite3_mod_regexp.c b/vendor/github.com/mutecomm/go-sqlcipher/v4/_example/mod_regexp/sqlite3_mod_regexp.c
deleted file mode 100644
index d3ad149db..000000000
--- a/vendor/github.com/mutecomm/go-sqlcipher/v4/_example/mod_regexp/sqlite3_mod_regexp.c
+++ /dev/null
@@ -1,35 +0,0 @@
-#include
-#include
-#include
-#include
-
-SQLITE_EXTENSION_INIT1
-static void regexp_func(sqlite3_context *context, int argc, sqlite3_value **argv) {
- if (argc >= 2) {
- const char *target = (const char *)sqlite3_value_text(argv[1]);
- const char *pattern = (const char *)sqlite3_value_text(argv[0]);
- const char* errstr = NULL;
- int erroff = 0;
- int vec[500];
- int n, rc;
- pcre* re = pcre_compile(pattern, 0, &errstr, &erroff, NULL);
- if (!re) {
- sqlite3_result_error(context, errstr, 0);
- return;
- }
- rc = pcre_exec(re, NULL, target, strlen(target), 0, 0, vec, 500);
- if (rc <= 0) {
- sqlite3_result_int(context, 0);
- return;
- }
- sqlite3_result_int(context, 1);
- }
-}
-
-#ifdef _WIN32
-__declspec(dllexport)
-#endif
-int sqlite3_extension_init(sqlite3 *db, char **errmsg, const sqlite3_api_routines *api) {
- SQLITE_EXTENSION_INIT2(api);
- return sqlite3_create_function(db, "regexp", 2, SQLITE_UTF8, (void*)db, regexp_func, NULL, NULL);
-}
diff --git a/vendor/github.com/mutecomm/go-sqlcipher/v4/_example/mod_vtable/picojson.h b/vendor/github.com/mutecomm/go-sqlcipher/v4/_example/mod_vtable/picojson.h
deleted file mode 100644
index 21426470d..000000000
--- a/vendor/github.com/mutecomm/go-sqlcipher/v4/_example/mod_vtable/picojson.h
+++ /dev/null
@@ -1,1040 +0,0 @@
-/*
- * Copyright 2009-2010 Cybozu Labs, Inc.
- * Copyright 2011 Kazuho Oku
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY CYBOZU LABS, INC. ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
- * EVENT SHALL CYBOZU LABS, INC. OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * The views and conclusions contained in the software and documentation are
- * those of the authors and should not be interpreted as representing official
- * policies, either expressed or implied, of Cybozu Labs, Inc.
- *
- */
-#ifndef picojson_h
-#define picojson_h
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include