@@ -94,26 +94,15 @@ impl SubgraphAvailabilityManagerContract {
94
94
#[ async_trait]
95
95
impl StateManager for RewardsManagerContract {
96
96
async fn deny_many ( & self , denied_status : Vec < ( [ u8 ; 32 ] , bool ) > ) -> Result < ( ) , Error > {
97
- // Based on this gas profile data for `setDeniedMany`:
98
- // gas-used,items
99
- // 4517721,200
100
- // 2271420,100
101
- // 474431,20
102
- // 47642,1
103
- //
104
97
// 100 is considered as a good chunk size.
105
98
for chunk in denied_status. chunks ( 100 ) {
106
99
let ids: Vec < [ u8 ; 32usize ] > = chunk. iter ( ) . map ( |s| s. 0 ) . collect ( ) ;
107
100
let statuses: Vec < bool > = chunk. iter ( ) . map ( |s| s. 1 ) . collect ( ) ;
108
101
let num_subgraphs = ids. len ( ) as u64 ;
109
- let tx = self
110
- . contract
111
- . set_denied_many ( ids, statuses)
112
- // To avoid gas estimation errors, we use a high enough gas limit for 100 items
113
- . gas ( ethers:: core:: types:: U256 :: from ( 3_000_000u64 ) ) ;
102
+ let tx = self . contract . set_denied_many ( ids, statuses) ;
114
103
115
104
if let Err ( err) = tx. call ( ) . await {
116
- let message = err. decode_revert :: < String > ( ) . unwrap ( ) ;
105
+ let message = err. decode_revert :: < String > ( ) . unwrap_or ( err . to_string ( ) ) ;
117
106
error ! ( self . logger, "Transaction failed" ;
118
107
"message" => message,
119
108
) ;
@@ -130,27 +119,16 @@ impl StateManager for RewardsManagerContract {
130
119
#[ async_trait]
131
120
impl StateManager for SubgraphAvailabilityManagerContract {
132
121
async fn deny_many ( & self , denied_status : Vec < ( [ u8 ; 32 ] , bool ) > ) -> Result < ( ) , Error > {
133
- // Based on this gas profile data for `setDeniedMany`:
134
- // gas-used,items
135
- // 4517721,200
136
- // 2271420,100
137
- // 474431,20
138
- // 47642,1
139
- //
140
122
// 100 is considered as a good chunk size.
141
123
for chunk in denied_status. chunks ( 100 ) {
142
124
let ids: Vec < [ u8 ; 32usize ] > = chunk. iter ( ) . map ( |s| s. 0 ) . collect ( ) ;
143
125
let statuses: Vec < bool > = chunk. iter ( ) . map ( |s| s. 1 ) . collect ( ) ;
144
126
let num_subgraphs = ids. len ( ) as u64 ;
145
127
let oracle_index = U256 :: from ( self . oracle_index ) ;
146
- let tx = self
147
- . contract
148
- . vote_many ( ids, statuses, oracle_index)
149
- // To avoid gas estimation errors, we use a high enough gas limit for 100 items
150
- . gas ( U256 :: from ( 3_000_000u64 ) ) ;
128
+ let tx = self . contract . vote_many ( ids, statuses, oracle_index) ;
151
129
152
130
if let Err ( err) = tx. call ( ) . await {
153
- let message = err. decode_revert :: < String > ( ) . unwrap ( ) ;
131
+ let message = err. decode_revert :: < String > ( ) . unwrap_or ( err . to_string ( ) ) ;
154
132
error ! ( self . logger, "Transaction failed" ;
155
133
"message" => message,
156
134
) ;
0 commit comments